Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast cross_val_score as a numpy.array #160

Merged
merged 5 commits into from
Dec 17, 2018
Merged

Cast cross_val_score as a numpy.array #160

merged 5 commits into from
Dec 17, 2018

Conversation

Goto15
Copy link
Contributor

@Goto15 Goto15 commented Dec 14, 2018

In order to allow the use of mean(), cast the cross_val_score return data structure as a numpy.array. Also changed the in code comments to reflect the new return data structure.

Fixes #155

@welcome
Copy link

welcome bot commented Dec 14, 2018

💖 Thanks for opening this pull request! 💖

Please make sure you read our Contributing Guide and abide by our Code of Conduct.

A few things to keep in mind:

  • Remember to run make format to make sure your code follows our style guide.
  • If you need help writing tests, take a look at the existing ones for inspiration. If you don't know where to start, let us know and we'll walk you through it.
  • All new features should be documented. It helps to write the docstrings for your functions/classes before writing the code. This will help you think about your code design and results in better code.
  • No matter what, we are really grateful that you put in the effort to do this! ⭐

Copy link
Member

@leouieda leouieda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting @Goto15! Just need a quick fix for the test and everything else should work. Good job!

@@ -158,7 +158,7 @@ def cross_val_score(estimator, coordinates, data, weights=None, cv=None, client=
>>> data = 10 - coords[0] + 0.5*coords[1]
>>> # A linear trend should perfectly predict this data
>>> scores = cross_val_score(Trend(degree=1), coords, data)
>>> print(', '.join(['{:.2f}'.format(score) for score in scores]))
>>> print('{:.2f}'.format(scores), sep = ", ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>>> print('{:.2f}'.format(scores), sep = ", ")
>>> print(', '.join(['{:.2f}'.format(score) for score in scores]))

We can keep the same test and it should work.

@Goto15
Copy link
Contributor Author

Goto15 commented Dec 16, 2018

I reverted the requested code, but might have accidentally committed the change twice. My bad.

@leouieda leouieda merged commit b170909 into fatiando:master Dec 17, 2018
@welcome
Copy link

welcome bot commented Dec 17, 2018

🎉🎉🎉 Congrats on merging your first pull request and welcome to the team! 🎉🎉🎉

Please open a new pull request to add yourself to the AUTHORS.md file. We hope that this was a good experience for you. Let us know if there is any way that the contributing process could be improved.

@leouieda
Copy link
Member

No problem, we've all done this at some point 🙂

Thanks for contributing! It's much appreciated 🎉🎉🎉

@Goto15 Goto15 deleted the bug155 branch December 17, 2018 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants