org.apache.ignite.ml.composition.combinators.sequential

## Class ModelsSequentialComposition<I,O1,O2>

- java.lang.Object
- - org.apache.ignite.ml.composition.combinators.sequential.ModelsSequentialComposition<I,O1,O2>

- Type Parameters:
    `I` - Type of input of the first model.
    `O1` - Type of output of the first model (and input of second).
    `O2` - Type of output of the second model.
  All Implemented Interfaces:
    Serializable, AutoCloseable, IgniteModel<I,O2>, Model<I,O2>

      public final class ModelsSequentialComposition<I,O1,O2>
      extends Object
      implements IgniteModel<I,O2>

  Sequential composition of models. Sequential composition is a model consisting of two models `mdl1 :: I -> O1, mdl2 :: O1 -> O2` with prediction corresponding to application of composition `mdl1 `andThen` mdl2` to input.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModelsSequentialComposition(IgniteModel<I,O1> mdl1, IgniteModel<O1,O2> mdl2)` Construct instance of this class from two given models.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `IgniteModel<I,O1>` | `firstModel()` Get first model.
    `static <I,O> ModelsSequentialComposition<I,O,O>` | `ofSame(List<? extends IgniteModel<I,O>> lst, IgniteFunction<O,I> output2Input)` Get sequential composition of submodels with same type.
    `O2` | `predict(I i1)` Make a prediction for the specified input arguments.
    `IgniteModel<O1,O2>` | `secondModel()` Get second model.

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

      `andBefore, andThen, andThen, combine, toString`

- - ### Constructor Detail

    - #### ModelsSequentialComposition

          public ModelsSequentialComposition(IgniteModel<I,O1> mdl1,
                                             IgniteModel<O1,O2> mdl2)

      Construct instance of this class from two given models.
      Parameters:
        `mdl1` - First model.
        `mdl2` - Second model.

  - ### Method Detail

    - #### ofSame

          public static <I,O> ModelsSequentialComposition<I,O,O> ofSame(List<? extends IgniteModel<I,O>> lst,
                                                                        IgniteFunction<O,I> output2Input)

      Get sequential composition of submodels with same type.
      Type Parameters:
        `I` - Type of input of submodel.
        `O` - Type of output of submodel.
      Parameters:
        `lst` - List of submodels.
        `output2Input` - Function for conversion output to input.
      Returns:
        Sequential composition of submodels with same type.

    - #### firstModel

          public IgniteModel<I,O1> firstModel()

      Get first model.
      Returns:
        First model.

    - #### secondModel

          public IgniteModel<O1,O2> secondModel()

      Get second model.
      Returns:
        Second model.

    - #### predict

          public O2 predict(I i1)

      Make a prediction for the specified input arguments.
      Specified by:
        `predict` in interface `Model<I,O2>`
      Parameters:
        `i1` - Input arguments.
      Returns:
        Prediction result.

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `IgniteModel<I,O2>`
      Specified by:
        `close` in interface `Model<I,O2>`

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021