org.apache.ignite.ml.composition

## Class ModelsComposition<M extends IgniteModel<Vector,Double>>

- java.lang.Object
- - org.apache.ignite.ml.composition.ModelsComposition<M>

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

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

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<M>` | `models` Models.
    `protected PredictionsAggregator` | `predictionsAggregator` Predictions aggregator.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModelsComposition()`
    `ModelsComposition(List<M> 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<M>` | `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`

- - ### Field Detail

    - #### predictionsAggregator

          protected PredictionsAggregator predictionsAggregator

      Predictions aggregator.

    - #### models

          protected List<M extends IgniteModel<Vector,Double>> models

      Models.

  - ### Constructor Detail

    - #### ModelsComposition

          public ModelsComposition(List<M> models,
                                   PredictionsAggregator predictionsAggregator)

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

    - #### ModelsComposition

          public ModelsComposition()

  - ### 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<M> 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`

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022