org.apache.ignite.ml.composition

## Class CompositionUtils

- java.lang.Object
- - org.apache.ignite.ml.composition.CompositionUtils

-     public class CompositionUtils
      extends Object

  Various utility functions for trainers composition.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositionUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <K,V,L> IgniteBiFunction<K,V,Vector>` | `asFeatureExtractor(FeatureLabelExtractor<K,V,L> extractor)` Create feature extractor from given mapping `(key, value) -> LabeledVector`.
    `static <K,V,L> IgniteBiFunction<K,V,L>` | `asLabelExtractor(FeatureLabelExtractor<K,V,L> extractor)` Label extractor feature extractor from given mapping `(key, value) -> LabeledVector`.
    `static <I,O,M extends IgniteModel<I,O>,L> DatasetTrainer<IgniteModel<I,O>,L>` | `unsafeCoerce(DatasetTrainer<? extends M,L> trainer)` Perform blurring of model type of given trainer to `IgniteModel<I, O>`, where I, O are input and output types of original model.

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

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

- - ### Constructor Detail

    - #### CompositionUtils

          public CompositionUtils()

  - ### Method Detail

    - #### unsafeCoerce

          public static <I,O,M extends IgniteModel<I,O>,L> DatasetTrainer<IgniteModel<I,O>,L> unsafeCoerce(DatasetTrainer<? extends M,L> trainer)

      Perform blurring of model type of given trainer to `IgniteModel<I, O>`, where I, O are input and output types of original model.
      Type Parameters:
        `I` - Type of input of model produced by coerced trainer.
        `O` - Type of output of model produced by coerced trainer.
        `M` - Type of model produced by coerced trainer.
        `L` - Type of labels.
      Parameters:
        `trainer` - Trainer to coerce.
      Returns:
        Trainer coerced to `DatasetTrainer<IgniteModel<I, O>, L>`.

    - #### asFeatureExtractor

          public static <K,V,L> IgniteBiFunction<K,V,Vector> asFeatureExtractor(FeatureLabelExtractor<K,V,L> extractor)

      Create feature extractor from given mapping `(key, value) -> LabeledVector`.
      Type Parameters:
        `K` - Type of keys.
        `V` - Type of values.
        `L` - Type of labels.
      Parameters:
        `extractor` - Mapping `(key, value) -> LabeledVector`.
      Returns:
        Feature extractor created from given mapping `(key, value) -> LabeledVector`.

    - #### asLabelExtractor

          public static <K,V,L> IgniteBiFunction<K,V,L> asLabelExtractor(FeatureLabelExtractor<K,V,L> extractor)

      Label extractor feature extractor from given mapping `(key, value) -> LabeledVector`.
      Type Parameters:
        `K` - Type of keys.
        `V` - Type of values.
        `L` - Type of labels.
      Parameters:
        `extractor` - Mapping `(key, value) -> LabeledVector`.
      Returns:
        Label extractor created from given mapping `(key, value) -> LabeledVector`.

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