8000 MAINT Parameters validation for sklearn.metrics.pairwise.paired_manha… · thomasjpfan/scikit-learn@427408d · GitHub
[go: up one dir, main page]

Skip to content

Commit 427408d

Browse files
authored
MAINT Parameters validation for sklearn.metrics.pairwise.paired_manhattan_distances (scikit-learn#26074)
1 parent 1a9f5eb commit 427408d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sklearn/metrics/pairwise.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,9 @@ def paired_euclidean_distances(X, Y):
10511051
return row_norms(X - Y)
10521052

10531053

1054+
@validate_params(
1055+
{"X": ["array-like", "sparse matrix"], "Y": ["array-like", "sparse matrix"]}
1056+
)
10541057
def paired_manhattan_distances(X, Y):
10551058
"""Compute the paired L1 distances between X and Y.
10561059
@@ -1061,10 +1064,10 @@ def paired_manhattan_distances(X, Y):
10611064
10621065
Parameters
10631066
----------
1064-
X : array-like of shape (n_samples, n_features)
1067+
X : {array-like, sparse matrix} of shape (n_samples, n_features)
10651068
An array-like where each row is a sample and each column is a feature.
10661069
1067-
Y : array-like of shape (n_samples, n_features)
1070+
Y : {array-like, sparse matrix} of shape (n_samples, n_features)
10681071
An array-like where each row is a sample and each column is a feature.
10691072
10701073
Returns

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def _check_function_param_validation(
210210
"sklearn.metrics.pairwise.laplacian_kernel",
211211
"sklearn.metrics.pairwise.linear_kernel",
212212
"sklearn.metrics.pairwise.paired_euclidean_distances",
213+
"sklearn.metrics.pairwise.paired_manhattan_distances",
213214
"sklearn.metrics.precision_recall_curve",
214215
"sklearn.metrics.precision_recall_fscore_support",
215216
"sklearn.metrics.precision_score",

0 commit comments

Comments
 (0)
0