## Uses of Interface
org.apache.ignite.ml.math.distances.DistanceMeasure

- Packages that use DistanceMeasure
  Package | Description
  --- | ---
  org.apache.ignite.ml.clustering.kmeans | Contains kMeans clustering algorithm.
  org.apache.ignite.ml.knn | Contains main APIs for kNN algorithms.
  org.apache.ignite.ml.knn.ann | Contains main APIs for ANN classification algorithms.
  org.apache.ignite.ml.knn.utils | Contains util functionality for kNN algorithms.
  org.apache.ignite.ml.knn.utils.indices |
  org.apache.ignite.ml.math.distances | Contains main APIs for distances.

- - ### Uses of DistanceMeasure in org.apache.ignite.ml.clustering.kmeans

    Methods in org.apache.ignite.ml.clustering.kmeans that return DistanceMeasure
    Modifier and Type | Method and Description
    --- | ---
    `DistanceMeasure` | KMeansModel.`distanceMeasure()` Distance measure.
    `DistanceMeasure` | KMeansTrainer.`getDistance()` Gets the distance.
    `DistanceMeasure` | KMeansModelFormat.`getDistance()`

    Methods in org.apache.ignite.ml.clustering.kmeans with parameters of type DistanceMeasure
    Modifier and Type | Method and Description
    --- | ---
    `KMeansTrainer` | KMeansTrainer.`withDistance(DistanceMeasure distance)` Set up the distance.

    Constructors in org.apache.ignite.ml.clustering.kmeans with parameters of type DistanceMeasure
    Constructor and Description
    `KMeansModel(Vector[] centers, DistanceMeasure distanceMeasure)` Construct KMeans model with given centers and distanceMeasure measure.
    `KMeansModelFormat(Vector[] centers, DistanceMeasure distance)`

  - ### Uses of DistanceMeasure in org.apache.ignite.ml.knn

    Fields in org.apache.ignite.ml.knn declared as DistanceMeasure
    Modifier and Type | Field and Description
    --- | ---
    `protected DistanceMeasure` | NNClassificationModel.`distanceMeasure` Distance measure.
    `protected DistanceMeasure` | KNNTrainer.`distanceMeasure` Distance measure.
    `protected DistanceMeasure` | KNNModel.`distanceMeasure` Distance measure.

    Methods in org.apache.ignite.ml.knn that return DistanceMeasure
    Modifier and Type | Method and Description
    --- | ---
    `DistanceMeasure` | NNClassificationModel.`getDistanceMeasure()`

    Methods in org.apache.ignite.ml.knn with parameters of type DistanceMeasure
    Modifier and Type | Method and Description
    --- | ---
    `NNClassificationModel` | NNClassificationModel.`withDistanceMeasure(DistanceMeasure distanceMeasure)` Set up parameter of the NN model.
    `Self` | KNNTrainer.`withDistanceMeasure(DistanceMeasure distanceMeasure)` Sets up `distanceMeasure` parameter.

    Constructors in org.apache.ignite.ml.knn with parameters of type DistanceMeasure
    Constructor and Description
    `KNNModel(Dataset<EmptyContext,SpatialIndex<L>> dataset, DistanceMeasure distanceMeasure, int k, boolean weighted)` Constructs a new instance of KNN model.
    `KNNPartitionDataBuilder(Preprocessor<K,V> preprocessor, SpatialIndexType spatialIdxType, DistanceMeasure distanceMeasure)` Constructs a new instance of KNN partition data builder.

  - ### Uses of DistanceMeasure in org.apache.ignite.ml.knn.ann

    Fields in org.apache.ignite.ml.knn.ann declared as DistanceMeasure
    Modifier and Type | Field and Description
    --- | ---
    `protected DistanceMeasure` | KNNModelFormat.`distanceMeasure` Distance measure.

    Methods in org.apache.ignite.ml.knn.ann that return DistanceMeasure
    Modifier and Type | Method and Description
    --- | ---
    `DistanceMeasure` | ANNClassificationTrainer.`getDistance()` Gets the distance.
    `DistanceMeasure` | KNNModelFormat.`getDistanceMeasure()` Gets distance measure.

    Methods in org.apache.ignite.ml.knn.ann with parameters of type DistanceMeasure
    Modifier and Type | Method and Description
    --- | ---
    `ANNClassificationTrainer` | ANNClassificationTrainer.`withDistance(DistanceMeasure distance)` Set up the distance.

    Constructors in org.apache.ignite.ml.knn.ann with parameters of type DistanceMeasure
    Constructor and Description
    `ANNModelFormat(int k, DistanceMeasure measure, boolean weighted, LabeledVectorSet<LabeledVector> candidates, ANNClassificationTrainer.CentroidStat candidatesStat)` Creates an instance.
    `KNNModelFormat(int k, DistanceMeasure measure, boolean weighted)` Creates an instance.

  - ### Uses of DistanceMeasure in org.apache.ignite.ml.knn.utils

    Methods in org.apache.ignite.ml.knn.utils with parameters of type DistanceMeasure
    Modifier and Type | Method and Description
    --- | ---
    `static <L> void` | PointWithDistanceUtil.`tryToAddIntoHeap(Queue<PointWithDistance<L>> heap, int k, Vector pnt, List<LabeledVector<L>> dataPnts, DistanceMeasure distanceMeasure)` Util method that adds data points into heap if they fits (if heap size is less than `k` or a distance from taget point to data point is less than a distance from target point to the most distant data point in heap).

  - ### Uses of DistanceMeasure in org.apache.ignite.ml.knn.utils.indices

    Constructors in org.apache.ignite.ml.knn.utils.indices with parameters of type DistanceMeasure
    Constructor and Description
    `ArraySpatialIndex(List<LabeledVector<L>> data, DistanceMeasure distanceMeasure)` Construct a new array spatial index.
    `BallTreeSpatialIndex(List<LabeledVector<L>> data, DistanceMeasure distanceMeasure)` Constructs a new instance of Ball tree spatial index.
    `KDTreeSpatialIndex(List<LabeledVector<L>> data, DistanceMeasure distanceMeasure)` Constructs a new instance of KD tree spatial index.

  - ### Uses of DistanceMeasure in org.apache.ignite.ml.math.distances

    Classes in org.apache.ignite.ml.math.distances that implement DistanceMeasure
    Modifier and Type | Class and Description
    --- | ---
    `class` | `ChebyshevDistance` Calculates the `max(x_i - y_i)` (Chebyshev) distance between two points.
    `class` | `CosineSimilarity` Calculates the `A * B / (|A| * |B|)` (Cosine similarity) distance between two points.
    `class` | `EuclideanDistance` Calculates the L2 (Euclidean) distance between two points.
    `class` | `HammingDistance` Calculates the Hamming distance between two points.
    `class` | `JaccardIndex` Calculates `J = |A \cap B| / |A \cup B|` (Jaccard index) distance between two points.
    `class` | `ManhattanDistance` Calculates the L1 (sum of abs) distance between two points.
    `class` | `MinkowskiDistance` Calculates the Lp (Minkowski) distance between two points.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020