javax.visrec.ml.data

## Interface DataSet<E>

Type Parameters:
  `E` - type of data set elements

All Superinterfaces:
  Iterable<E>

All Known Implementing Classes:
  BasicDataSet

    public interface DataSet<E>
    extends Iterable<E>

Generic interface for all data sets for machine learning, independent of type of elements.

Since:
  1.0
Author:
  Zoran Sevarac

### Nested Class Summary

Nested Classes
`static class` `DataSet.Column`
`static class` `DataSet.ColumnType`

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`default DataSet<E>` `add(E item)` Adds an element to this data set.
`default DataSet<E>` `addAll(DataSet<E> dataSet)` Add an existing `DataSet` to the current `DataSet`
`default void` `clear()` Clear items of the `DataSet`
`default E` `get(int index)` Get an item from the `DataSet`
`List<E>` `getItems()` Get a collection of the items in the `DataSet`
`default boolean` `isEmpty()` Determines whether the `DataSet` is empty or not.
`default void` `shuffle()` Shuffles the data set.
`default void` `shuffle(Random rnd)` Shuffles the data set using the specified random number generator.
`default int` `size()` Get the number of elements in `DataSet`
`DataSet<E>[]` `split(double... parts)` Split data set into parts of specified sizes
`default DataSet<E>[]` `split(double part)` Split data set in two parts, one with size of specified percentage, and other with rest of the data set
`DataSet<E>[]` `split(int numParts)` Split dataset into specified number of equally sized parts.
`DataSet<E>[]` `split(int numParts, Random rnd)` Split dataset into specified number of equally sized parts, using specified random generator.
`DataSet<E>[]` `split(Random rnd, double... parts)` Split data set into parts of specified sizes using specified random generator

### Methods inherited from interface java.lang.Iterable

`forEach, iterator, spliterator`

### Method Detail

#### getItems

    List<E> getItems()

Get a collection of the items in the `DataSet`

Returns:
  `Collection`

#### add

    default DataSet<E> add(E item)

Adds an element to this data set.

Parameters:
  `item` - data set item to add to the data set
Returns:
  current instance of `DataSet`

#### addAll

    default DataSet<E> addAll(DataSet<E> dataSet)

Add an existing `DataSet` to the current `DataSet`

Parameters:
  `dataSet` - existing `DataSet`
Returns:
  current instance of `DataSet`

#### get

    default E get(int index)

Get an item from the `DataSet`

Parameters:
  `index` - index as `int` which corresponds with the index of the `DataSet`
Returns:
  item from the `DataSet`

#### clear

    default void clear()

Clear items of the `DataSet`

#### isEmpty

    default boolean isEmpty()

Determines whether the `DataSet` is empty or not.

Returns:
  `true` if the `DataSet` is empty, otherwise `false`

#### size

    default int size()

Get the number of elements in `DataSet`

Returns:
  size in `int`

#### split

    DataSet<E>[] split(int numParts)

Split dataset into specified number of equally sized parts.

Parameters:
  `numParts` - number of parts to be returned
Returns:
  multiple `DataSet` in an array.

#### split

    DataSet<E>[] split(int numParts,
                       Random rnd)

Split dataset into specified number of equally sized parts, using specified random generator.

Parameters:
  `numParts` - number of parts/subsets to return
  `rnd` - random number generator
Returns:
  multiple `DataSet` in an array.

#### split

    default DataSet<E>[] split(double part)

Split data set in two parts, one with size of specified percentage, and other with rest of the data set

Parameters:
  `part` - specified percentage of the first `DataSet`
Returns:
  multiple `DataSet` in an array.

#### split

    DataSet<E>[] split(double... parts)

Split data set into parts of specified sizes

Parameters:
  `parts` - specific sizes of `DataSet`
Returns:
  array of `DataSet`

#### split

    DataSet<E>[] split(Random rnd,
                       double... parts)

Split data set into parts of specified sizes using specified random generator

Parameters:
  `rnd` - random generator
  `parts` - specific sizes of `DataSet`
Returns:
  array of `DataSet`

#### shuffle

    default void shuffle()

Shuffles the data set.

#### shuffle

    default void shuffle(Random rnd)

Shuffles the data set using the specified random number generator.

Parameters:
  `rnd` - random generator