-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Add additional validation for user-supplied gram matrixes #19004
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
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.
thx @amidvidy
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
i believe I have resolved the above comments @agramfort |
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 did a first pass.
Please add an entry to the change log at doc/whats_new/v*.rst
. Like the other entries there, please reference this pull request with :pr:
and credit yourself (and other contributors if applicable) with :user:
.
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
thanks for the review @glemaitre. I believe I have resolved your comments, with the exception the calls to |
#19044 was resolved, so will update test and rebase. |
f58e161
to
da0e5aa
Compare
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 couple of last changes
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Outdated
Show resolved
Hide resolved
sklearn/linear_model/_base.py
Outdated
X : ndarray of shape (n_samples, n_features) | ||
Data array. | ||
|
||
precompute: array-like of shape (n_features, n_features) |
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.
precompute: array-like of shape (n_features, n_features) | |
precompute : array-like of shape (n_features, n_features) |
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 assume that precompute
should be an ndarray
and not an array-like
as specified in the docstring.
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.
in the docstring for the ElasticNet constructor, the precompute
param is also specified as array-like
.
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.
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've kept it as array-like
for consistency, perhaps it should be updated in both places?
the test failures on this latest commit seem to be related to #19096. |
Yes it should be fixed pretty soon. We can just discard it. |
Thanks @amidvidy. Good to be merged. |
Thanks again for the help with this PR @glemaitre & @agramfort |
Reference Issues/PRs
#18973
What does this implement/fix? Explain your changes.
Any other comments?
Thanks in advance for reviewing.