org.apache.ignite.ml.preprocessing.encoding

## Class EncoderTrainer<K,V>

- java.lang.Object
- - org.apache.ignite.ml.preprocessing.encoding.EncoderTrainer<K,V>

- Type Parameters:
    `K` - Type of a key in `upstream` data.
    `V` - Type of a value in `upstream` data.
  All Implemented Interfaces:
    PreprocessingTrainer<K,V>

      public class EncoderTrainer<K,V>
      extends Object
      implements PreprocessingTrainer<K,V>

  Trainer of the String Encoder and One-Hot Encoder preprocessors.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EncoderTrainer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EncoderPreprocessor<K,V>` | `fit(LearningEnvironmentBuilder envBuilder, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> basePreprocessor)` Fits preprocessor.
    `EncoderTrainer<K,V>` | `withEncodedFeature(int idx)` Add the index of encoded feature.
    `EncoderTrainer<K,V>` | `withEncodedFeatures(Set<Integer> handledIndices)` Sets the indices of features which should be encoded.
    `EncoderTrainer<K,V>` | `withEncoderIndexingStrategy(EncoderSortingStrategy encoderSortingStgy)` Sets the encoder indexing strategy.
    `EncoderTrainer<K,V>` | `withEncoderType(EncoderType type)` Sets the encoder preprocessor type.

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

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

    - ### Methods inherited from interface org.apache.ignite.ml.preprocessing.PreprocessingTrainer

      `fit, fit, fit, fit, fit, learningEnvironment`

- - ### Constructor Detail

    - #### EncoderTrainer

          public EncoderTrainer()

  - ### Method Detail

    - #### fit

          public EncoderPreprocessor<K,V> fit(LearningEnvironmentBuilder envBuilder,
                                              DatasetBuilder<K,V> datasetBuilder,
                                              Preprocessor<K,V> basePreprocessor)

      Fits preprocessor.
      Specified by:
        `fit` in interface `PreprocessingTrainer<K,V>`
      Parameters:
        `envBuilder` - Learning environment builder.
        `datasetBuilder` - Dataset builder.
        `basePreprocessor` - Base preprocessor.
      Returns:
        Preprocessor.

    - #### withEncodedFeature

          public EncoderTrainer<K,V> withEncodedFeature(int idx)

      Add the index of encoded feature.
      Parameters:
        `idx` - The index of encoded feature.
      Returns:
        The changed trainer.

    - #### withEncoderIndexingStrategy

          public EncoderTrainer<K,V> withEncoderIndexingStrategy(EncoderSortingStrategy encoderSortingStgy)

      Sets the encoder indexing strategy.
      Parameters:
        `encoderSortingStgy` - The encoder indexing strategy.
      Returns:
        The changed trainer.

    - #### withEncoderType

          public EncoderTrainer<K,V> withEncoderType(EncoderType type)

      Sets the encoder preprocessor type.
      Parameters:
        `type` - The encoder preprocessor type.
      Returns:
        The changed trainer.

    - #### withEncodedFeatures

          public EncoderTrainer<K,V> withEncodedFeatures(Set<Integer> handledIndices)

      Sets the indices of features which should be encoded.
      Parameters:
        `handledIndices` - Indices of features which should be encoded.
      Returns:
        The changed trainer.

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