org.apache.ignite.ml.selection.split

## Class TrainTestDatasetSplitter<K,V>

- java.lang.Object
- - org.apache.ignite.ml.selection.split.TrainTestDatasetSplitter<K,V>

- Type Parameters:
    `K` - Type of a key in `upstream` data.
    `V` - Type of a value in `upstream` data.
  All Implemented Interfaces:
    Serializable

      public class TrainTestDatasetSplitter<K,V>
      extends Object
      implements Serializable

  Dataset splitter that splits dataset into train and test subsets.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TrainTestDatasetSplitter()` Constructs a new instance of train test dataset splitter.
    `TrainTestDatasetSplitter(UniformMapper<K,V> mapper)` Constructs a new instance of train test dataset splitter.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TrainTestSplit<K,V>` | `split(double trainSize)` Splits dataset into train and test subsets.
    `TrainTestSplit<K,V>` | `split(double trainSize, double testSize)` Splits dataset into train and test subsets.

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

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

- - ### Constructor Detail

    - #### TrainTestDatasetSplitter

          public TrainTestDatasetSplitter()

      Constructs a new instance of train test dataset splitter.

    - #### TrainTestDatasetSplitter

          public TrainTestDatasetSplitter(UniformMapper<K,V> mapper)

      Constructs a new instance of train test dataset splitter.
      Parameters:
        `mapper` - Mapper used to map a key-value pair to a point on the segment (0, 1).

  - ### Method Detail

    - #### split

          public TrainTestSplit<K,V> split(double trainSize)

      Splits dataset into train and test subsets.
      Parameters:
        `trainSize` - The proportion of the dataset to include in the train split (should be between 0 and 1).
      Returns:
        Split with two predicates for training and testing parts.

    - #### split

          public TrainTestSplit<K,V> split(double trainSize,
                                           double testSize)

      Splits dataset into train and test subsets.
      Parameters:
        `trainSize` - The proportion of the dataset to include in the train split (should be between 0 and 1).
        `testSize` - The proportion of the dataset to include in the test split (should be a number between 0 and 1).
      Returns:
        Split with two predicates for training and testing parts.

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