org.apache.ignite.ml.composition

## Class ModelsComposition

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

- All Implemented Interfaces:
    Serializable, AutoCloseable, DeployableObject, Exportable<ModelsCompositionFormat>, IgniteModel<Vector,Double>, Model<Vector,Double>
  Direct Known Subclasses:
    GDBTrainer.GDBModel

      public class ModelsComposition
      extends Object
      implements IgniteModel<Vector,Double>, Exportable<ModelsCompositionFormat>, DeployableObject

  Model consisting of several models and prediction aggregation strategy.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModelsComposition(List<? extends IgniteModel<Vector,Double>> models, PredictionsAggregator predictionsAggregator)` Constructs a new instance of composition of models.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<Object>` | `getDependencies()` Returns dependencies of this object that can be object with class defined by client side and unknown for server.
    `List<IgniteModel<Vector,Double>>` | `getModels()` Returns containing models.
    `PredictionsAggregator` | `getPredictionsAggregator()` Returns predictions aggregator.
    `Double` | `predict(Vector features)` Applies containing models to features and aggregate them to one prediction.
    `<P> void` | `saveModel(Exporter<ModelsCompositionFormat,P> exporter, P path)` Save model by the given path.
    `String` | `toString()`
    `String` | `toString(boolean pretty)`

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

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

    - ### Methods inherited from interface org.apache.ignite.ml.IgniteModel

      `andBefore, andThen, andThen, close, combine`

- - ### Constructor Detail

    - #### ModelsComposition

          public ModelsComposition(List<? extends IgniteModel<Vector,Double>> models,
                                   PredictionsAggregator predictionsAggregator)

      Constructs a new instance of composition of models.
      Parameters:
        `models` - Basic models.
        `predictionsAggregator` - Predictions aggregator.

  - ### Method Detail

    - #### predict

          public Double predict(Vector features)

      Applies containing models to features and aggregate them to one prediction.
      Specified by:
        `predict` in interface `Model<Vector,Double>`
      Parameters:
        `features` - Features vector.
      Returns:
        Estimation.

    - #### getPredictionsAggregator

          public PredictionsAggregator getPredictionsAggregator()

      Returns predictions aggregator.

    - #### getModels

          public List<IgniteModel<Vector,Double>> getModels()

      Returns containing models.

    - #### saveModel

          public <P> void saveModel(Exporter<ModelsCompositionFormat,P> exporter,
                                    P path)

      Save model by the given path.
      Specified by:
        `saveModel` in interface `Exportable<ModelsCompositionFormat>`
      Parameters:
        `exporter` - Exporter.
        `path` - Path to saved model.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toString

          public String toString(boolean pretty)

      Specified by:
        `toString` in interface `IgniteModel<Vector,Double>`
      Parameters:
        `pretty` - Use pretty mode.

    - #### getDependencies

          public List<Object> getDependencies()

      Returns dependencies of this object that can be object with class defined by client side and unknown for server.
      Specified by:
        `getDependencies` in interface `DeployableObject`

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