-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MNT Deprecate metrics.pairwise.paired_*_distances and paired_distances public functions #27129
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
base: main
Are you sure you want to change the base?
MNT Deprecate metrics.pairwise.paired_*_distances and paired_distances public functions #27129
Conversation
I've noticed that the changes to |
Maybe we could put the code in private functions (with a The |
…distance_public_funcs
…distance_public_funcs
I resolved the conflicts with |
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 am fine with the deprecation. I only commented to add some info that we use when we grep the files seeking for deprecated function/variables.
@@ -275,10 +275,6 @@ def _check_function_param_validation( | |||
"sklearn.metrics.pairwise.linear_kernel", | |||
"sklearn.metrics.pairwise.manhattan_distances", | |||
"sklearn.metrics.pairwise.nan_euclidean_distances", | |||
"sklearn.metrics.pairwise.paired_cosine_distances", |
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 would still test them but add a comment above to remove them.
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 still needs to be reverted.
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 am fine with the deprecation. I only commented to add some info that we use when we grep the files seeking for deprecated function/variables. Thanks @Shreesha3112
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 am fine with the deprecation. I only commented to add some info that we use when we grep the files seeking for deprecated function/variables. Thanks @Shreesha3112
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
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.
Looks good but I'd add a note to the deprecation message that tells users what function to use instead (pairwise_distances
I assume).
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.
Looks good but I'd add a note to the deprecation message that tells users what function to use instead (pairwise_distances I assume).
@amueller If the paired_*_distances
are removed, there is no direct replacement.
metrics.pairwise.paired_euclidean_distances | ||
metrics.pairwise.paired_manhattan_distances | ||
metrics.pairwise.paired_cosine_distances | ||
metrics.pairwise.paired_distances |
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.
Can these be moved to
scikit-learn/doc/modules/classes.rst
Lines 1903 to 1904 in 93f6ce9
Recently deprecated | |
=================== |
:func:`~metrics.pairwise.paired_euclidean_distances`, | ||
:func:`~metrics.pairwise.paired_manhattan_distances` and | ||
:func:`~metrics.pairwise.paired_cosine_distances` are now deprecated and | ||
will be removed in 1.6. |
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.
Since 1.4 is released, this changelog entry needs to be moved to v1.5.rst and:
will be removed in 1.6. | |
will be removed in 1.7. |
@@ -1129,6 +1130,11 @@ def cosine_distances(X, Y=None): | |||
return S | |||
|
|||
|
|||
# TODO(1.6): Remove in 1.6 |
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.
# TODO(1.6): Remove in 1.6 | |
# TODO(1.7): Remove in 1.7 |
# TODO(1.6): Remove in 1.6 | ||
@deprecated( | ||
"The public function `sklearn.pairwise.paired_euclidean_distances` has been " | ||
"deprecated in 1.4 and will be removed in 1.6." |
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.
"deprecated in 1.4 and will be removed in 1.6." | |
"deprecated in 1.5 and will be removed in 1.7." |
@@ -1157,6 +1186,11 @@ def paired_euclidean_distances(X, Y): | |||
return row_norms(X - Y) | |||
|
|||
|
|||
# TODO(1.6): Remove in 1.6 |
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.
# TODO(1.6): Remove in 1.6 | |
# TODO(1.7): Remove in 1.7 |
# TODO*1.6: Remove in 1.6 | ||
@deprecated( | ||
"The public function `sklearn.pairwise.paired_cosine_distances` has been " | ||
"deprecated in 1.4 and will be removed in 1.6." |
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.
"deprecated in 1.4 and will be removed in 1.6." | |
"deprecated in 1.5 and will be removed in 1.7." |
@@ -1201,6 +1260,11 @@ def paired_manhattan_distances(X, Y): | |||
return np.abs(diff).sum(axis=-1) | |||
|
|||
|
|||
# TODO*1.6: Remove in 1.6 |
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.
# TODO*1.6: Remove in 1.6 | |
# TODO(1.7): Remove in 1.7 |
|
||
# TODO(1.6): Remove in 1.6 |
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.
# TODO(1.6): Remove in 1.6 | |
# TODO(1.7): Remove in 1.7 |
# TODO(1.6): Remove in 1.6 | ||
@deprecated( | ||
"The public function `sklearn.pairwise.paired_distances` has been " | ||
"deprecated in 1.4 and will be removed in 1.6." |
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.
"deprecated in 1.4 and will be removed in 1.6." | |
"deprecated in 1.5 and will be removed in 1.7." |
@@ -275,10 +275,6 @@ def _check_function_param_validation( | |||
"sklearn.metrics.pairwise.linear_kernel", | |||
"sklearn.metrics.pairwise.manhattan_distances", | |||
"sklearn.metrics.pairwise.nan_euclidean_distances", | |||
"sklearn.metrics.pairwise.paired_cosine_distances", |
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 still needs to be reverted.
@Shreesha3112 since the core work is done, and all that remains is some small tidying, I wanted to remind you of this in case you'd still like to finish! |
@Micky774, @thomasjpfan Is this considered stalled ? I'll take a look at cleaning this up and finishing it since it appears @Shreesha3112 has gone dormant. Will start in the coming days if we get no response. |
@Sean-Jay-M are you working on this? |
Hey I'm not currently working on this. Trying to close out a different PR. Feel free to take the issue. I never got a response from the maintainers if it should be considered a stalled PR. I think should be considered stalled. |
Yes at this point the PR is stalled and continuation of the effort is welcomed! |
Reference Issues/PRs
Fixes #26982
What does this implement/fix? Explain your changes.
Deprecates
metrics.pairwise.paired_*_distance functions
andmetrics.pairwise.paired_distance
metrics.pairwise.paired_euclidean_distances
metrics.pairwise.paired_manhattan_distances
metrics.pairwise.paired_cosine_distances
metrics.pairwise.paired_distances
Any other comments?