org.apache.ignite.ml.preprocessing.encoding

## Class EncoderPreprocessor<K,V>

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

- Type Parameters:
    `K` - Type of a key in `upstream` data.
    `V` - Type of a value in `upstream` data.
  All Implemented Interfaces:
    Serializable, BiFunction<K,V,LabeledVector>, IgniteBiFunction<K,V,LabeledVector>, Preprocessor<K,V>
  Direct Known Subclasses:
    FrequencyEncoderPreprocessor, LabelEncoderPreprocessor, OneHotEncoderPreprocessor, StringEncoderPreprocessor, TargetEncoderPreprocessor

      public abstract class EncoderPreprocessor<K,V>
      extends Object
      implements Preprocessor<K,V>

  Preprocessing function that makes encoding. This a base abstract class that keeps the common fields for all child encoding preprocessors.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Preprocessor<K,V>` | `basePreprocessor` Base preprocessor.
    `protected Map<String,Integer>[]` | `encodingValues` Filling values.
    `protected Set<Integer>` | `handledIndices` Feature indices to apply encoder.
    `static String` | `KEY_FOR_NULL_VALUES`
    `protected Map<String,Integer>` | `labelFrequencies` Frequencies of categories for label presented as strings.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `EncoderPreprocessor(Map<String,Integer>[] encodingValues, Preprocessor<K,V> basePreprocessor, Set<Integer> handledIndices)` Constructs a new instance of Encoder preprocessor.
    `protected` | `EncoderPreprocessor(Map<String,Integer> labelFrequencies, Preprocessor<K,V> basePreprocessor)` Constructs a new instance of Encoder preprocessor.

  - ### Method Summary

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

      `map`

    - ### Methods inherited from interface org.apache.ignite.ml.math.functions.IgniteBiFunction

      `andThen`

    - ### Methods inherited from interface java.util.function.BiFunction

      `andThen, apply`

- - ### Field Detail

    - #### KEY_FOR_NULL_VALUES

          public static final String KEY_FOR_NULL_VALUES

      See Also:
        Constant Field Values

    - #### encodingValues

          protected Map<String,Integer>[] encodingValues

      Filling values.

    - #### labelFrequencies

          protected Map<String,Integer> labelFrequencies

      Frequencies of categories for label presented as strings.

    - #### basePreprocessor

          protected final Preprocessor<K,V> basePreprocessor

      Base preprocessor.

    - #### handledIndices

          protected Set<Integer> handledIndices

      Feature indices to apply encoder.

  - ### Constructor Detail

    - #### EncoderPreprocessor

          protected EncoderPreprocessor(Map<String,Integer>[] encodingValues,
                                        Preprocessor<K,V> basePreprocessor,
                                        Set<Integer> handledIndices)

      Constructs a new instance of Encoder preprocessor.
      Parameters:
        `basePreprocessor` - Base preprocessor.
        `handledIndices` - Handled indices.

    - #### EncoderPreprocessor

          protected EncoderPreprocessor(Map<String,Integer> labelFrequencies,
                                        Preprocessor<K,V> basePreprocessor)

      Constructs a new instance of Encoder preprocessor.
      Parameters:
        `basePreprocessor` - Base preprocessor.

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022