org.apache.ignite.ml.dataset.impl.local

## Class LocalDataset<C extends Serializable,D extends AutoCloseable>

- java.lang.Object
- - org.apache.ignite.ml.dataset.impl.local.LocalDataset<C,D>

- Type Parameters:
    `C` - Type of a partition `context`.
    `D` - Type of a partition `data`.
  All Implemented Interfaces:
    AutoCloseable, Dataset<C,D>

      public class LocalDataset<C extends Serializable,D extends AutoCloseable>
      extends Object
      implements Dataset<C,D>

  An implementation of dataset based on local data structures such as `Map` and `List` and doesn't require Ignite environment. Introduces for testing purposes mostly, but can be used for simple local computations as well.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `<R> R` | `compute(IgniteBiFunction<D,LearningEnvironment,R> map, IgniteBinaryOperator<R> reduce, R identity)` Applies the specified `map` function to every partition `data` and `LearningEnvironment` in the dataset and then reduces `map` results to final result by using the `reduce` function.
    `<R> R` | `computeWithCtx(IgniteTriFunction<C,D,LearningEnvironment,R> map, IgniteBinaryOperator<R> reduce, R identity)` Applies the specified `map` function to every partition `data`, `context` and partition index in the dataset and then reduces `map` results to final result by using the `reduce` function.
    `List<C>` | `getCtx()`
    `List<D>` | `getData()`

    - ### 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.dataset.Dataset

      `compute, compute, compute, compute, compute, computeWithCtx, computeWithCtx, computeWithCtx, computeWithCtx, computeWithCtx, wrap`

- - ### Method Detail

    - #### computeWithCtx

          public <R> R computeWithCtx(IgniteTriFunction<C,D,LearningEnvironment,R> map,
                                      IgniteBinaryOperator<R> reduce,
                                      R identity)

      Applies the specified `map` function to every partition `data`, `context` and partition index in the dataset and then reduces `map` results to final result by using the `reduce` function.
      Specified by:
        `computeWithCtx` in interface `Dataset<C extends Serializable,D extends AutoCloseable>`
      Type Parameters:
        `R` - Type of a result.
      Parameters:
        `map` - Function applied to every partition `data`, `context` and `LearningEnvironment`.
        `reduce` - Function applied to results of `map` to get final result.
        `identity` - Identity.
      Returns:
        Final result.

    - #### compute

          public <R> R compute(IgniteBiFunction<D,LearningEnvironment,R> map,
                               IgniteBinaryOperator<R> reduce,
                               R identity)

      Applies the specified `map` function to every partition `data` and `LearningEnvironment` in the dataset and then reduces `map` results to final result by using the `reduce` function.
      Specified by:
        `compute` in interface `Dataset<C extends Serializable,D extends AutoCloseable>`
      Type Parameters:
        `R` - Type of a result.
      Parameters:
        `map` - Function applied to every partition `data` and `LearningEnvironment`.
        `reduce` - Function applied to results of `map` to get final result.
        `identity` - Identity.
      Returns:
        Final result.

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`

    - #### getCtx

          public List<C> getCtx()

    - #### getData

          public List<D> getData()

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022