Skip to content

ENH _fit_and_score now returns a dictionary - #17332

Merged
adrinjalali merged 7 commits into
scikit-learn:masterfrom
thomasjpfan:fit_score_return_dict
Jun 26, 2020
Merged

adrinjalali merged 7 commits into
scikit-learn:masterfrom
thomasjpfan:fit_score_return_dict

Conversation

@thomasjpfan

Copy link
Copy Markdown
Member

Reference Issues/PRs

Related to #15126

What does this implement/fix? Explain your changes.

The goal of this PR is to make #15126 easily to review.

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

fit_params=fit_params,
return_n_test_samples=True,
error_score=error_score)
return results["test_scores"], parameters, results["n_test_samples"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it make sense to get the parameters from the dict?

Suggested change
return results["test_scores"], parameters, results["n_test_samples"]
return results["test_scores"], results["parameters"], results["n_test_samples"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In this case, I would say no. return_parameters is set to false so parameters is not in the dict and fit_grid_point is deprecated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OK make sense

Comment thread sklearn/model_selection/_validation.py Outdated
parameters : dict or None
The parameters that have been evaluated.
estimator : estimator object
The fitted estimator

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
The fitted estimator
The fitted estimator.

@glemaitre

Copy link
Copy Markdown
Member

We are going to have some git fun with some of the PR :)

@adrinjalali

Copy link
Copy Markdown
Member

ping: merge conflicts

@adrinjalali
adrinjalali merged commit 67bf1e7 into scikit-learn:master Jun 26, 2020
@alfaro96

alfaro96 commented Jun 26, 2020 •

Copy link
Copy Markdown
Member

I think that the documentation build was broken 😕.

I am working to fix this as soon as possible!

glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Jul 17, 2020
* ENH _fit_and_score now returns a dictionary

* MRG

* REV

* LOL

* Removing things in gitignore is fun
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
* ENH _fit_and_score now returns a dictionary

* MRG

* REV

* LOL

* Removing things in gitignore is fun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants