Top Description Methods
javax.visrec.ml.data

public Interface DataSet<E>

extends Iterable<E>
Known Direct Implementers
javax.visrec.ml.data.BasicDataSet
Type Parameters
<E>
type of data set elements
Imports
java.util.Collection, .Collections, .Iterator, .List, .Objects, .Random, java.util.stream.Stream

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

Method Summary

Modifier and TypeMethod and Description
public default DataSet<E>

Returns:

current instance of DataSet
add
(E
data set item to add to the data set
item
)

Adds an element to this data set.

public default DataSet<E>

Returns:

current instance of DataSet
addAll
(DataSet<E>
existing DataSet
dataSet
)

Add an existing DataSet to the current DataSet

public default void
clear()

Clear items of the DataSet

public default E

Returns:

item from the DataSet
get
(int
index as int which corresponds with the index of the DataSet
idx
)

Get an item from the DataSet

public List<Column>
getColumns()

Returns the columns of the data set.

public List<E>

Returns:

Collection
getItems
()

Get a collection of the items in the DataSet

public String[]

Returns:

Returns target columns
getTargetColumnsNames
()

Get the names of target columns.

public default boolean

Returns:

true if the DataSet is empty, otherwise false
isEmpty
()

Determines whether the DataSet is empty or not.

public default Iterator<E>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public void
setColumns(List<Column> columns)

Sets the columns of this data set.

public default void
shuffle()

Shuffles the data set.

public default void
shuffle(Random
random generator
rnd
)

Shuffles the data set using the specified random number generator.

public default int

Returns:

size in int
size
()

Get the number of elements in DataSet

public default DataSet<E>[]

Returns:

multiple DataSet in an array.
split
(int
number of parts to be returned
numParts
)

Split data set into specified number of equally sized parts.

public default DataSet<E>[]

Returns:

multiple DataSet in an array.
split
(int
number of parts/subsets to return
numParts
,
Random
random number generator
rnd
)

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

public default DataSet<E>[]

Returns:

multiple DataSet in an array.
split
(double
specified percentage of the first DataSet
part
)

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

public DataSet<E>[]

Returns:

array of DataSet
split
(double...
specific sizes of DataSet
parts
)

Split data set into parts of specified sizes

public default DataSet<E>[]

Returns:

array of DataSet
split
(Random
random generator
rnd
,
double...
specific sizes of DataSet
parts
)

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

public default Stream<E>
Inherited from java.lang.Iterable:
forEachspliterator

Method Detail

addback to summary
public default DataSet<E> add(E item)

Adds an element to this data set.

Parameters
item:E

data set item to add to the data set

Returns:DataSet<E>

current instance of DataSet

addAllback to summary
public default DataSet<E> addAll(DataSet<E> dataSet)

Add an existing DataSet to the current DataSet

Parameters
dataSet:DataSet<E>

existing DataSet

Returns:DataSet<E>

current instance of DataSet

clearback to summary
public default void clear()

Clear items of the DataSet

getback to summary
public default E get(int idx)

Get an item from the DataSet

Parameters
idx:int

index as int which corresponds with the index of the DataSet

Returns:E

item from the DataSet

getColumnsback to summary
public List<Column> getColumns()

Returns the columns of the data set.

getItemsback to summary
public List<E> getItems()

Get a collection of the items in the DataSet

Returns:List<E>

Collection

getTargetColumnsNamesback to summary
public String[] getTargetColumnsNames()

Get the names of target columns. Target columns are use as target output during the training.

Returns:String[]

Returns target columns

isEmptyback to summary
public default boolean isEmpty()

Determines whether the DataSet is empty or not.

Returns:boolean

true if the DataSet is empty, otherwise false

iteratorback to summary
public default Iterator<E> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<E>

an Iterator.

Annotations
@Override
setColumnsback to summary
public void setColumns(List<Column> columns)

Sets the columns of this data set.

shuffleback to summary
public default void shuffle()

Shuffles the data set.

shuffleback to summary
public default void shuffle(Random rnd)

Shuffles the data set using the specified random number generator.

Parameters
rnd:Random

random generator

sizeback to summary
public default int size()

Get the number of elements in DataSet

Returns:int

size in int

splitback to summary
public default DataSet<E>[] split(int numParts)

Split data set into specified number of equally sized parts.

Parameters
numParts:int

number of parts to be returned

Returns:DataSet<E>[]

multiple DataSet in an array.

splitback to summary
public default DataSet<E>[] split(int numParts, Random rnd)

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

Parameters
numParts:int

number of parts/subsets to return

rnd:Random

random number generator

Returns:DataSet<E>[]

multiple DataSet in an array.

splitback to summary
public 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:double

specified percentage of the first DataSet

Returns:DataSet<E>[]

multiple DataSet in an array.

splitback to summary
public DataSet<E>[] split(double... parts)

Split data set into parts of specified sizes

Parameters
parts:double[]

specific sizes of DataSet

Returns:DataSet<E>[]

array of DataSet

splitback to summary
public default DataSet<E>[] split(Random rnd, double... parts)

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

Parameters
rnd:Random

random generator

parts:double[]

specific sizes of DataSet

Returns:DataSet<E>[]

array of DataSet

streamback to summary
public default Stream<E> stream()