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 Clean up deprecations for 1.5: in NearestCentroid #28813
MAINT Clean up deprecations for 1.5: in NearestCentroid #28813
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.
Some feedback. Otherwise, LGTM.
If `metric="euclidean"`, the centroid for the samples corresponding to each | ||
class is the arithmetic mean, which minimizes the sum of squared L1 distances. | ||
If `metric="manhattan"`, the centroid is the feature-wise median, which | ||
minimizes the sum of L1 distances. | ||
|
||
.. deprecated:: 1.3 | ||
Support for metrics other than `euclidean` and `manhattan` and for |
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.
This section should be updated as a versionchanged
(as done for the metric='precomputed'
case in 0.19) or just removed (but then the previous versionchanged
should also be removed for consistency).
@@ -111,12 +103,7 @@ class NearestCentroid(ClassifierMixin, BaseEstimator): | |||
_valid_metrics = set(_VALID_METRICS) - {"mahalanobis", "seuclidean", "wminkowski"} |
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.
This attribute can probably also be deleted, no?
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.
nitpicks. Otherwise LGTM.
Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai>
Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai>
Removed the deprecated metrics from
NearestCentroid
(everything but euclidean and manhattan).I also reworked the docstring a bit because it was wrong: