org.apache.ignite.ml.multiclass

## Class OneVsRestTrainer<M extends IgniteModel<Vector,Double>>

- java.lang.Object
- - org.apache.ignite.ml.trainers.DatasetTrainer<M,Double>
  - - org.apache.ignite.ml.trainers.SingleLabelDatasetTrainer<MultiClassModel<M>>
    - - org.apache.ignite.ml.multiclass.OneVsRestTrainer<M>

-     public class OneVsRestTrainer<M extends IgniteModel<Vector,Double>>
      extends SingleLabelDatasetTrainer<MultiClassModel<M>>

  This is a common heuristic trainer for multi-class labeled models. NOTE: The current implementation suffers from unbalanced training over the dataset due to unweighted approach during the process of reassign labels from all range of labels to 0,1.

- - ### 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.trainers.DatasetTrainer

      `envBuilder, environment`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OneVsRestTrainer(SingleLabelDatasetTrainer<M> classifier)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<K,V> MultiClassModel<M>` | `fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> extractor)` Trains model based on the specified data.
    `boolean` | `isUpdateable(MultiClassModel<M> mdl)`
    `protected <K,V> MultiClassModel<M>` | `updateModel(MultiClassModel<M> newMdl, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> extractor)` Gets state of model in arguments, update in according to new data and return new model.

    - ### 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

    - #### OneVsRestTrainer

          public OneVsRestTrainer(SingleLabelDatasetTrainer<M> classifier)

  - ### Method Detail

    - #### fitWithInitializedDeployingContext

          public <K,V> MultiClassModel<M> fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder,
                                                                             Preprocessor<K,V> extractor)

      Trains model based on the specified data.
      Specified by:
        `fitWithInitializedDeployingContext` in class `DatasetTrainer<MultiClassModel<M extends IgniteModel<Vector,Double>>,Double>`
      Type Parameters:
        `K` - Type of a key in `upstream` data.
        `V` - Type of a value in `upstream` data.
      Parameters:
        `datasetBuilder` - Dataset builder.
        `extractor` - Extractor of `UpstreamEntry` into `LabeledVector`.
      Returns:
        Model.

    - #### updateModel

          protected <K,V> MultiClassModel<M> updateModel(MultiClassModel<M> newMdl,
                                                         DatasetBuilder<K,V> datasetBuilder,
                                                         Preprocessor<K,V> extractor)

      Gets state of model in arguments, update in according to new data and return new model.
      Specified by:
        `updateModel` in class `DatasetTrainer<MultiClassModel<M extends IgniteModel<Vector,Double>>,Double>`
      Type Parameters:
        `K` - Type of a key in `upstream` data.
        `V` - Type of a value in `upstream` data.
      Parameters:
        `newMdl` - Learned model.
        `datasetBuilder` - Dataset builder.
        `extractor` - Extractor of `UpstreamEntry` into `LabeledVector`.
      Returns:
        Updated model.

    - #### isUpdateable

          public boolean isUpdateable(MultiClassModel<M> mdl)

      Specified by:
        `isUpdateable` in class `DatasetTrainer<MultiClassModel<M extends IgniteModel<Vector,Double>>,Double>`
      Parameters:
        `mdl` - Model.
      Returns:
        True if current critical for training parameters correspond to parameters from last training.

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021