Package smile.data
Class SimpleDataset<D,T>
java.lang.Object
smile.data.SimpleDataset<D,T>
- Type Parameters:
D
- the data type.T
- the target type.
- All Implemented Interfaces:
Iterable<SampleInstance<D,
,T>> Dataset<D,
T>
- Direct Known Subclasses:
BinarySparseDataset
,BinarySparseSequenceDataset
,SparseDataset
A simple implementation of Dataset that store data in single machine's memory.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget
(int i) Returns the instance at the specified index.iterator()
int
size()
Returns the number of elements in this collection.stream()
Returns a (possibly parallel) Stream with this collection as its source.List
<SampleInstance<D, T>> toList()
Returns theList
of data items.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SimpleDataset
Constructor- Parameters:
instances
- The sample instances.
-
-
Method Details
-
size
public int size()Description copied from interface:Dataset
Returns the number of elements in this collection. -
get
Description copied from interface:Dataset
Returns the instance at the specified index. -
stream
Description copied from interface:Dataset
Returns a (possibly parallel) Stream with this collection as its source. -
iterator
-
toList
Description copied from interface:Dataset
Returns theList
of data items.
-