org.apache.ignite.ml.knn.ann

## Class ANNClassificationModel

- java.lang.Object
- - org.apache.ignite.ml.knn.NNClassificationModel
  - - org.apache.ignite.ml.knn.ann.ANNClassificationModel

- All Implemented Interfaces:
    Serializable, AutoCloseable, DeployableObject, Exportable<KNNModelFormat>, IgniteModel<Vector,Double>, Model<Vector,Double>

      public final class ANNClassificationModel
      extends NNClassificationModel

  ANN model to predict labels in multi-class classification task.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.apache.ignite.ml.knn.NNClassificationModel

      `distanceMeasure, k, weighted`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ANNClassificationModel(LabeledVectorSet<LabeledVector> centers, ANNClassificationTrainer.CentroidStat centroindsStat)` Build the model based on a candidates set.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `LabeledVectorSet<LabeledVector>` | `getCandidates()`
    `ANNClassificationTrainer.CentroidStat` | `getCentroindsStat()`
    `int` | `hashCode()`
    `Double` | `predict(Vector v)` Make a prediction for the specified input arguments.
    `<P> void` | `saveModel(Exporter<KNNModelFormat,P> exporter, P path)` Save model by the given path.
    `String` | `toString()`
    `String` | `toString(boolean pretty)`

    - ### Methods inherited from class org.apache.ignite.ml.knn.NNClassificationModel

      `buildLabeledDatasetOnListOfVectors, copyParametersFrom, getClassVoteForVector, getClassWithMaxVotes, getDependencies, getDistanceMeasure, getDistances, getKClosestVectors, putDistanceIdxPair, withDistanceMeasure, withK, withWeighted`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.ignite.ml.IgniteModel

      `andBefore, andThen, andThen, close, combine`

- - ### Constructor Detail

    - #### ANNClassificationModel

          public ANNClassificationModel(LabeledVectorSet<LabeledVector> centers,
                                        ANNClassificationTrainer.CentroidStat centroindsStat)

      Build the model based on a candidates set.
      Parameters:
        `centers` - The candidates set.
        `centroindsStat` - The stat about centroids.

  - ### Method Detail

    - #### getCandidates

          public LabeledVectorSet<LabeledVector> getCandidates()

    - #### getCentroindsStat

          public ANNClassificationTrainer.CentroidStat getCentroindsStat()

    - #### predict

          public Double predict(Vector v)

      Make a prediction for the specified input arguments.
      Parameters:
        `v` - Input arguments.
      Returns:
        Prediction result.

    - #### saveModel

          public <P> void saveModel(Exporter<KNNModelFormat,P> exporter,
                                    P path)

      Description copied from class: `NNClassificationModel`
      Save model by the given path.
      Specified by:
        `saveModel` in interface `Exportable<KNNModelFormat>`
      Specified by:
        `saveModel` in class `NNClassificationModel`
      Parameters:
        `exporter` - Exporter.
        `path` - Path to saved model.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `NNClassificationModel`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `NNClassificationModel`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `NNClassificationModel`

    - #### toString

          public String toString(boolean pretty)

      Specified by:
        `toString` in interface `IgniteModel<Vector,Double>`
      Overrides:
        `toString` in class `NNClassificationModel`
      Parameters:
        `pretty` - Use pretty mode.

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