-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT Parameters validation for cluster.estimate_bandwidth #24869
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
MAINT Parameters validation for cluster.estimate_bandwidth #24869
Conversation
For the moment, we don't validate parameters. However, we only call once |
"random_state": ["random_state"], | ||
"n_jobs": [Integral, None], | ||
} | ||
) | ||
def estimate_bandwidth(X, *, quantile=0.3, n_samples=None, random_state=0, n_jobs=None): | ||
"""Estimate the bandwidth to use with the mean-shift algorithm. | ||
|
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 that we should update the comment below:
This function takes time at least quadratic in `n_samples`. For large
datasets, it is wise to subsample by setting `n_samples`. Alternatively,
the parameter `bandwidth` can be set to a small value without estimating
it.
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.
You should remove the test sklearn.cluster.tests.test_estimate_bandwidth_with_sparse_matrix
since they are covered by the common test.
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 @OmarManzoor
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 @OmarManzoor
Reference Issues/PRs
Towards #24862
What does this implement/fix? Explain your changes.
Any other comments?