8000 MAINT Parameters validation for manhattan_distances by rand0wn · Pull Request #26152 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

MAINT Parameters validation for manhattan_distances #26152

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sklearn/metrics/pairwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
Real,
Hidden,
MissingValues,
StrOptions,
)

from ._pairwise_distances_reduction import ArgKmin
Expand Down Expand Up @@ -904,6 +905,13 @@ def haversine_distances(X, Y=None):
return DistanceMetric.get_metric("haversine").pairwise(X, Y)


@validate_params(
{
"X": ["array-like", "sparse matrix"],
"Y": ["array-like", "sparse matrix", None],
"sum_over_features": ["boolean", Hidden(StrOptions({"deprecated"}))],
}
)
def manhattan_distances(X, Y=None, *, sum_over_features="deprecated"):
"""Compute the L1 distances between the vectors in X and Y.

Expand Down
1 change: 1 addition & 0 deletions sklearn/tests/test_public_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def _check_function_param_validation(
"sklearn.tree.export_text",
"sklearn.tree.plot_tree",
"sklearn.utils.gen_batches",
"sklearn.metrics.pairwise.manhattan_distances",
]


Expand Down
0