DOC added example for Chebyshev distance
@@ -518,6 +518,18 @@ cdef class ChebyshevDistance(DistanceMetric):
.. math::
D(x, y) = max_i (|x_i - y_i|)
+
+ Examples
+ --------
+ >>> from sklearn.neighbors.dist_metrics import DistanceMetric
+ >>> dist = DistanceMetric.get_metric('chebyshev')
+ >>> X = [[0, 1, 2],
+ ... [3, 4, 5]]
+ >>> Y = [[-1, 0, 1],
+ ... [3, 4, 5]]
+ >>> dist.pairwise(X, Y)
+ array([[1.732..., 5.196...],
+ [6.928..., 0.... ]])
"""
def __init__(self):
self.p = INF
