org.apache.ignite.ml.svm

## Class SVMLinearClassificationTrainer

- java.lang.Object
- - org.apache.ignite.ml.trainers.DatasetTrainer<M,Double>
  - - org.apache.ignite.ml.trainers.SingleLabelDatasetTrainer<SVMLinearClassificationModel>
    - - org.apache.ignite.ml.svm.SVMLinearClassificationTrainer

-     public class SVMLinearClassificationTrainer
      extends SingleLabelDatasetTrainer<SVMLinearClassificationModel>

  Base class for a soft-margin SVM linear classification trainer based on the communication-efficient distributed dual coordinate ascent algorithm (CoCoA) with hinge-loss function.

  This trainer takes input as Labeled Dataset with 0 and 1 labels for two classes and makes binary classification.

  The paper about this algorithm could be found here https://arxiv.org/abs/1409.1458.

- - ### 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
    `SVMLinearClassificationTrainer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<K,V> SVMLinearClassificationModel` | `fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)` Trains model based on the specified data.
    `int` | `getAmountOfIterations()` Get the amount of outer iterations of SCDA algorithm.
    `int` | `getAmountOfLocIterations()` Get the amount of local iterations of SCDA algorithm.
    `double` | `getLambda()` Get the regularization lambda.
    `long` | `getSeed()` Get the seed number.
    `boolean` | `isUpdateable(SVMLinearClassificationModel mdl)`
    `protected <K,V> SVMLinearClassificationModel` | `updateModel(SVMLinearClassificationModel mdl, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)` Gets state of model in arguments, update in according to new data and return new model.
    `SVMLinearClassificationTrainer` | `withAmountOfIterations(int amountOfIterations)` Set up the amount of outer iterations of SCDA algorithm.
    `SVMLinearClassificationTrainer` | `withAmountOfLocIterations(int amountOfLocIterations)` Set up the amount of local iterations of SCDA algorithm.
    `SVMLinearClassificationTrainer` | `withLambda(double lambda)` Set up the regularization parameter.
    `SVMLinearClassificationTrainer` | `withSeed(long seed)` Set up the seed.

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

    - #### SVMLinearClassificationTrainer

          public SVMLinearClassificationTrainer()

  - ### Method Detail

    - #### fitWithInitializedDeployingContext

          public <K,V> SVMLinearClassificationModel fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder,
                                                                                       Preprocessor<K,V> preprocessor)

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

    - #### updateModel

          protected <K,V> SVMLinearClassificationModel updateModel(SVMLinearClassificationModel mdl,
                                                                   DatasetBuilder<K,V> datasetBuilder,
                                                                   Preprocessor<K,V> preprocessor)

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

    - #### isUpdateable

          public boolean isUpdateable(SVMLinearClassificationModel mdl)

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

    - #### withLambda

          public SVMLinearClassificationTrainer withLambda(double lambda)

      Set up the regularization parameter.
      Parameters:
        `lambda` - The regularization parameter. Should be more than 0.0.
      Returns:
        Trainer with new lambda parameter value.

    - #### getLambda

          public double getLambda()

      Get the regularization lambda.
      Returns:
        The property value.

    - #### getAmountOfIterations

          public int getAmountOfIterations()

      Get the amount of outer iterations of SCDA algorithm.
      Returns:
        The property value.

    - #### withAmountOfIterations

          public SVMLinearClassificationTrainer withAmountOfIterations(int amountOfIterations)

      Set up the amount of outer iterations of SCDA algorithm.
      Parameters:
        `amountOfIterations` - The parameter value.
      Returns:
        Trainer with new amountOfIterations parameter value.

    - #### getAmountOfLocIterations

          public int getAmountOfLocIterations()

      Get the amount of local iterations of SCDA algorithm.
      Returns:
        The property value.

    - #### withAmountOfLocIterations

          public SVMLinearClassificationTrainer withAmountOfLocIterations(int amountOfLocIterations)

      Set up the amount of local iterations of SCDA algorithm.
      Parameters:
        `amountOfLocIterations` - The parameter value.
      Returns:
        Trainer with new amountOfLocIterations parameter value.

    - #### getSeed

          public long getSeed()

      Get the seed number.
      Returns:
        The property value.

    - #### withSeed

          public SVMLinearClassificationTrainer withSeed(long seed)

      Set up the seed.
      Parameters:
        `seed` - The parameter value.
      Returns:
        Model with new seed parameter value.

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