org.apache.ignite.ml.trainers.transformers

## Class BaggingUpstreamTransformer

- java.lang.Object
- - org.apache.ignite.ml.trainers.transformers.BaggingUpstreamTransformer

- All Implemented Interfaces:
    Serializable, UpstreamTransformer

      public class BaggingUpstreamTransformer
      extends Object
      implements UpstreamTransformer

  This class encapsulates the logic needed to do bagging (bootstrap aggregating) by features. The action of this class on a given upstream is to replicate each entry in accordance to Poisson distribution.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaggingUpstreamTransformer(long seed, double subsampleRatio)` Construct instance of this transformer with a given subsample ratio.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <K,V> UpstreamTransformerBuilder` | `builder(double subsampleRatio, int mdlIdx)` Get builder of `BaggingUpstreamTransformer` for a model with a specified index in ensemble.
    `Stream<UpstreamEntry>` | `transform(Stream<UpstreamEntry> upstream)` Transform upstream.

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

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

- - ### Constructor Detail

    - #### BaggingUpstreamTransformer

          public BaggingUpstreamTransformer(long seed,
                                            double subsampleRatio)

      Construct instance of this transformer with a given subsample ratio.
      Parameters:
        `seed` - Seed used for generating poisson distribution which in turn used to make subsamples.
        `subsampleRatio` - Subsample ratio.

  - ### Method Detail

    - #### builder

          public static <K,V> UpstreamTransformerBuilder builder(double subsampleRatio,
                                                                 int mdlIdx)

      Get builder of `BaggingUpstreamTransformer` for a model with a specified index in ensemble.
      Type Parameters:
        `K` - Type of upstream keys.
        `V` - Type of upstream values.
      Parameters:
        `subsampleRatio` - Subsample ratio.
        `mdlIdx` - Index of model in ensemble.
      Returns:
        Builder of `BaggingUpstreamTransformer`.

    - #### transform

          public Stream<UpstreamEntry> transform(Stream<UpstreamEntry> upstream)

      Transform upstream.
      Specified by:
        `transform` in interface `UpstreamTransformer`
      Parameters:
        `upstream` - Upstream to transform.
      Returns:
        Transformed upstream.

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