Skip to content

Commit 6901d7e

Browse files
committed
Fix doc mistakes.
1 parent 4ac7a41 commit 6901d7e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sklearn/neighbors/nearest_centroid.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ class NearestCentroid(BaseEstimator, ClassifierMixin):
2727
metric: string, or callable
2828
The metric to use when calculating distance between instances in a
2929
feature array. If metric is a string or callable, it must be one of
30-
the options allowed by metrics.pairwise.calculate_distance for its
30+
the options allowed by metrics.pairwise.pairwise_distances for its
3131
metric parameter.
32-
If metric is "precomputed", X is assumed to be a distance matrix and
33-
must be square.
3432
shrink_threshold : float, optional
3533
Threshold for shrinking centroids to remove features.
3634
@@ -145,6 +143,12 @@ def predict(self, X):
145143
Returns
146144
-------
147145
C : array, shape = [n_samples]
146+
147+
Note
148+
----
149+
If the metric constructor parameter is "precomputed", X is assumed to
150+
be the distance matrix between the data to be predicted and
151+
self.centroids_.
148152
"""
149153
X = atleast2d_or_csr(X)
150154
if not hasattr(self, "centroids_"):

0 commit comments

Comments
 (0)