-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Allowing sparse inputs in MeanShift.predict #20733
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
Comments
I agree this should be updated. In 0.23.X, we did support sparse matrices: scikit-learn/ 8000 sklearn/cluster/_mean_shift.py Lines 450 to 465 in 0fb307b
where @milana2 Would you be interested with opening a PR with your suggested fix? |
Yes, I'll go ahead and open a PR. Thanks! |
I want to make my first contribution . Can I work on this issue ? |
@milana2 Is this only for the predict function of MeanShift? |
Was fixed in the associated issue |
Describe the bug
MeanShift.predict should work with a sparse X according to the documentation, but the code throws an exception when a sparse matrix is passed. Apologies if this is a non-issue or the issue has been fixed.
This is the same issue as in AffinityPropagation.predict (issue #20049) that was fixed by PR #20117.
Steps/Code to Reproduce
MeanShift.predict with a sparse X throws an exception:
Expected Results
If we change sklearn/cluster/_mean_shift.py#L466 into
or
then it works:
Actual Results
The exception shown above.
Versions
The text was updated successfully, but these errors were encountered: