org.apache.ignite.ml.regressions.logistic

## Class LogisticRegressionSGDTrainer

- java.lang.Object
- - org.apache.ignite.ml.trainers.DatasetTrainer<M,Double>
  - - org.apache.ignite.ml.trainers.SingleLabelDatasetTrainer<LogisticRegressionModel>
    - - org.apache.ignite.ml.regressions.logistic.LogisticRegressionSGDTrainer

-     public class LogisticRegressionSGDTrainer
      extends SingleLabelDatasetTrainer<LogisticRegressionModel>

  Trainer of the logistic regression model based on stochastic gradient descent algorithm.

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<K,V> LogisticRegressionModel` | `fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> extractor)` Trains model based on the specified data.
    `int` | `getBatchSize()` Get the batch size.
    `int` | `getLocIterations()` Get the amount of local iterations.
    `int` | `getMaxIterations()` Get the max amount of iterations.
    `long` | `getSeed()` Get the seed for random generator.
    `UpdatesStrategy` | `getUpdatesStgy()` Get the update strategy.
    `boolean` | `isUpdateable(LogisticRegressionModel mdl)`
    `protected <K,V> LogisticRegressionModel` | `updateModel(LogisticRegressionModel mdl, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> extractor)` Gets state of model in arguments, update in according to new data and return new model.
    `LogisticRegressionSGDTrainer` | `withBatchSize(double batchSize)` Set up the batchSize parameter.
    `LogisticRegressionSGDTrainer` | `withLocIterations(double amountOfLocIterations)` Set up the amount of local iterations of SGD algorithm.
    `LogisticRegressionSGDTrainer` | `withMaxIterations(double maxIterations)` Set up the max amount of iterations before convergence.
    `LogisticRegressionSGDTrainer` | `withSeed(long seed)` Set up the random seed parameter.
    `LogisticRegressionSGDTrainer` | `withUpdatesStgy(UpdatesStrategy updatesStgy)` Set up the regularization parameter.

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

    - #### LogisticRegressionSGDTrainer

          public LogisticRegressionSGDTrainer()

  - ### Method Detail

    - #### fitWithInitializedDeployingContext

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

      Trains model based on the specified data.
      Specified by:
        `fitWithInitializedDeployingContext` in class `DatasetTrainer<LogisticRegressionModel,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> LogisticRegressionModel updateModel(LogisticRegressionModel mdl,
                                                              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<LogisticRegressionModel,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.
        `extractor` - Extractor of `UpstreamEntry` into `LabeledVector`.
      Returns:
        Updated model.

    - #### isUpdateable

          public boolean isUpdateable(LogisticRegressionModel mdl)

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

    - #### withMaxIterations

          public LogisticRegressionSGDTrainer withMaxIterations(double maxIterations)

      Set up the max amount of iterations before convergence.
      Parameters:
        `maxIterations` - The parameter value.
      Returns:
        Model with new max number of iterations before convergence parameter value.

    - #### withBatchSize

          public LogisticRegressionSGDTrainer withBatchSize(double batchSize)

      Set up the batchSize parameter.
      Parameters:
        `batchSize` - The size of learning batch.
      Returns:
        Trainer with new batch size parameter value.

    - #### withLocIterations

          public LogisticRegressionSGDTrainer withLocIterations(double amountOfLocIterations)

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

    - #### withSeed

          public LogisticRegressionSGDTrainer withSeed(long seed)

      Set up the random seed parameter.
      Parameters:
        `seed` - Seed for random generator.
      Returns:
        Trainer with new seed parameter value.

    - #### withUpdatesStgy

          public LogisticRegressionSGDTrainer withUpdatesStgy(UpdatesStrategy updatesStgy)

      Set up the regularization parameter.
      Parameters:
        `updatesStgy` - Update strategy.
      Returns:
        Trainer with new update strategy parameter value.

    - #### getUpdatesStgy

          public UpdatesStrategy getUpdatesStgy()

      Get the update strategy.
      Returns:
        The property value.

    - #### getMaxIterations

          public int getMaxIterations()

      Get the max amount of iterations.
      Returns:
        The property value.

    - #### getBatchSize

          public int getBatchSize()

      Get the batch size.
      Returns:
        The property value.

    - #### getLocIterations

          public int getLocIterations()

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

    - #### getSeed

          public long getSeed()

      Get the seed for random generator.
      Returns:
        The property value.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020