8000 [MRG] Created 'cross-validation estimator' entry in glossary by NicolasHug · Pull Request #11661 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] Created 'cross-validation estimator' entry in glossary #11661

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

Merged
merged 5 commits into from
Oct 4, 2018

Conversation

NicolasHug
Copy link
Member

Reference Issues/PRs

Closes #11659

What does this implement/fix? Explain your changes.

This PR creates a 'cross-validation estimator' entry in glossary and adds references in every EstimatorCV class.

Any other comments?

Not everything from #11659 is addressed here, but I believe it makes more sense to close it with this PR and address the other points in other PRs.

@@ -28,7 +28,8 @@


class CalibratedClassifierCV(BaseEstimator, ClassifierMixin):
"""Probability calibration with isotonic regression or sigmoid.
""":term:`Cross-validated <cross-validation estimator>` Probability
Copy link
Member

Choose a reason for hiding this comment

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

Probability -> probability

@@ -1420,12 +1418,13 @@ class ElasticNetCV(LinearModelCV, RegressorMixin):
Length of the path. ``eps=1e-3`` means that
``alpha_min / alpha_max = 1e-3``.

n_alphas : int, optional
n_alphas : int, optional (default=10)
Copy link
Member

Choose a reason for hiding this comment

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

It seems kinda odd that here some parameters mention their default in the docstring, some don't.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes thanks, it's also unrelated to this PR so I reverted the changes.

Copy link
Member

Choose a reason for hiding this comment

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

All parameters should mention defaults at all times. But it's unrelated, so I don't mind.

Copy link
Member
@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @NicolasHug!

@amueller
Copy link
Member

I like the entry, not sure how I feel about violating some pep and having a line break in the first line of the docstring. No strong feelings, though.

@amueller
Copy link
Member

@jnothman thoughts?

Copy link
Member
@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

I'm okay with the description

@@ -467,7 +467,8 @@ def graphical_lasso_path(X, alphas, cov_init=None, X_test=None, mode='cd',


class GraphicalLassoCV(GraphicalLasso):
"""Sparse inverse covariance w/ cross-validated choice of the l1 penalty
"""Sparse inverse covariance with :term:`cross-validated choice
Copy link
Member

Choose a reason for hiding this comment

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

I don't think these references should be in the first line of a docstring. First lines have special roles in pydoc and elsewhere. They should be just one line, according to PEP257.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the feedback, would that be OK if I revert the first docstring line and add a new one saying something like:

See glossary entry for cross-validation estimators.

(with link included)

?

Copy link
Member

Choose a reason for hiding this comment

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

Yes.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

doc/glossary.rst Outdated
@@ -955,6 +955,20 @@ such as:
and do not provide :term:`set_params` or :term:`get_params`.
Parameter validation may be performed in ``__init__``.

cross-validation estimator
An estimator that has built-in cross-validation capabilities to
automatically select the best hyper-parameters, e.g.
Copy link
Member

Choose a reason for hiding this comment

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

See model selection docs.

doc/glossary.rst Outdated
automatically select the best hyper-parameters, e.g.
:class:`ElasticNetCV <linear_model.ElasticNetCV>`, or
:class:`LogisticRegressionCV <linear_model.LogisticRegressionCV>`.
Cross-validation estimators are named *EstimatorCV*. The advantage of
Copy link
Member

Choose a reason for hiding this comment

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

It might be helpful to make this more concrete, with a statement like:

That is, ``EstimatorCV()`` tends to be roughly equivalent to
``GridSearchCV(Estimator(), {'parm': [0, 1, 2, 3, ...]})``

Then again, maybe that adds confusion.

@amueller amueller merged commit b725921 into scikit-learn:master Oct 4, 2018
jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Oct 15, 2018
…learn#11661)

* Created 'cross-validation estimator' in glossary and referenced it where
needed

* Addressed adrinjalali comments

* updated glossary entry

* updaed docstrings according to commets
@NicolasHug NicolasHug deleted the cross_val_estimators_doc branch October 17, 2018 20:28
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.

Doc improvement suggestion for ElasticNetCV
4 participants
0