@@ -602,8 +602,7 @@ def paired_cosine_distances(X, Y):
602
602
'l2' : paired_euclidean_distances ,
603
603
'l1' : paired_manhattan_distances ,
604
604
'manhattan' : paired_manhattan_distances ,
605
- 'cityblock' : paired_manhattan_distances ,
606
- }
605
+ 'cityblock' : paired_manhattan_distances }
607
606
608
607
609
608
def paired_distances (X , Y , metric = "euclidean" , ** kwds ):
@@ -1050,8 +1049,8 @@ def pairwise_distances(X, Y=None, metric="euclidean", n_jobs=1, **kwds):
1050
1049
[n_samples_a, n_features] otherwise
1051
1050
Array of pairwise distances between samples, or a feature array.
1052
1051
1053
- Y : array [n_samples_b, n_features]
1054
- A second feature array only if X has shape [n_samples_a, n_features] .
1052
+ Y : array [n_samples_b, n_features], optional
1053
+ An optional second feature array. Only allowed if metric != "precomputed" .
1055
1054
1056
1055
metric : string, or callable
1057
1056
The metric to use when calculating distance between instances in a
@@ -1089,7 +1088,7 @@ def pairwise_distances(X, Y=None, metric="euclidean", n_jobs=1, **kwds):
1089
1088
1090
1089
"""
1091
1090
if (metric not in _VALID_METRICS and
1092
- not callable (metric ) and metric != "precomputed" ):
1091
+ not callable (metric ) and metric != "precomputed" ):
1093
1092
raise ValueError ("Unknown metric %s. "
1094
1093
"Valid metrics are %s, or 'precomputed', or a "
1095
1094
"callable" % (metric , _VALID_METRICS ))
0 commit comments