-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] DOC document default values for Lars #14512
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
Conversation
@qdeffense I might advise waiting a resolution regarding the standard that we would like to follow regarding the docstring formatting. We might not review this PR before having made a choice in #12356. You will need to be patient then :) |
sklearn/linear_model/least_angle.py
Outdated
Input targets. | ||
|
||
Xy : array-like shape=(n_samples,) or (n_samples, n_targets), default=None | ||
Xy : array-like of shape (n_samples,) or (n_samples, n_targets), default=None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm see my comment https://github.com/scikit-learn/scikit-learn/pull/12356/files#r311660392 I'm not sure I like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok seems like we're going with "of shape" now.
linting fails still |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments but mostly looks good, thanks for the PR @qdeffense
sklearn/linear_model/least_angle.py
Outdated
Whether to use a precomputed Gram matrix to speed up | ||
calculations. If set to ``'auto'`` let us decide. The Gram matrix | ||
cannot be passed as argument since we will use only subsets of X. | ||
|
||
cv : int, cross-validation generator or an iterable, optional | ||
cv : int, cross-validation generator or an iterable, default='warn' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default is None, same in other place
sklearn/linear_model/least_angle.py
Outdated
Maximum number of iterations to perform. | ||
|
||
eps : float, optional | ||
eps : float, default=np.finfo(np.float).eps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is one of the few cases where we could describe the default in the description instead.
E.g.
eps : float, optional
[...]. By default, ``np.finfo(np.float).eps`` is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NicolasHug and use optional
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, since the default isn't mentioned on the first line I think it's worth clarifying that the parameter is still optional
sklearn/linear_model/least_angle.py
Outdated
@@ -358,17 +361,17 @@ def _lars_path_solver(X, y, Xy=None, Gram=None, n_samples=None, max_iter=500, | |||
solution of the coordinate descent lasso_path function. | |||
|
|||
Returns | |||
------- | |||
alphas : array, shape (n_alphas + 1,) | |||
-------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thanks @qdeffense ! |
Reference Issues/PRs
Partially addresses #14452 and #14404
What does this implement/fix? Explain your changes.
document default values for Lars, LassoLars, LarsCV, LassoLarsCV and LassoLarsIC