org.apache.ignite.ml.knn.classification

## Class KNNClassificationTrainer

- java.lang.Object
- - org.apache.ignite.ml.trainers.DatasetTrainer<M,Double>
  - - org.apache.ignite.ml.trainers.SingleLabelDatasetTrainer<M>
    - - org.apache.ignite.ml.knn.KNNTrainer<KNNClassificationModel,KNNClassificationTrainer>
      - - org.apache.ignite.ml.knn.classification.KNNClassificationTrainer

-     public class KNNClassificationTrainer
      extends KNNTrainer<KNNClassificationModel,KNNClassificationTrainer>

  KNN classification model trader that trains model on top of distributed spatial indices. Be aware that this model is linked with cluster environment it's been built on and can't be saved or used in other places. Under the hood it keeps `Dataset` that consists of a set of resources allocated across the cluster.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.ignite.ml.trainers.DatasetTrainer

      `DatasetTrainer.EmptyDatasetException`

  - ### Field Summary

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

      `distanceMeasure, k, weighted`

    - ### Fields inherited from class org.apache.ignite.ml.trainers.DatasetTrainer

      `envBuilder, environment`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KNNClassificationTrainer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected KNNClassificationModel` | `convertDatasetIntoModel(Dataset<EmptyContext,SpatialIndex<Double>> dataset)` Convers given dataset into KNN model (classification or regression depends on implementation).
    `protected KNNClassificationTrainer` | `self()` Returns `this` instance.

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

      `fitWithInitializedDeployingContext, isUpdateable, updateModel, withDataTtl, withDistanceMeasure, withIdxType, withK, withWeighted`

    - ### Methods inherited from class org.apache.ignite.ml.trainers.DatasetTrainer

      `fit, fit, fit, fit, fit, fit, getLastTrainedModelOrThrowEmptyDatasetException, identityTrainer, learningEnvironment, update, update, update, update, update, withConvertedLabels, withEnvironmentBuilder`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KNNClassificationTrainer

          public KNNClassificationTrainer()

  - ### Method Detail

    - #### convertDatasetIntoModel

          protected KNNClassificationModel convertDatasetIntoModel(Dataset<EmptyContext,SpatialIndex<Double>> dataset)

      Convers given dataset into KNN model (classification or regression depends on implementation).
      Specified by:
        `convertDatasetIntoModel` in class `KNNTrainer<KNNClassificationModel,KNNClassificationTrainer>`
      Parameters:
        `dataset` - Dataset of spatial indices.
      Returns:
        KNN model.

    - #### self

          protected KNNClassificationTrainer self()

      Returns `this` instance.
      Specified by:
        `self` in class `KNNTrainer<KNNClassificationModel,KNNClassificationTrainer>`
      Returns:
        This instance.

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021