Package smile.data
Interface Dataset<T>
- Type Parameters:
T
- the type of data objects.
- All Known Subinterfaces:
BinarySparseDataset
,DataFrame
,SparseDataset
- All Known Implementing Classes:
IndexDataFrame
public interface Dataset<T>
An immutable collection of data objects.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault T
apply
(int i) Returns the element at the specified position in this dataset.default boolean
Returns true if the dataset is distributed over multiple machines.get
(int i) Returns the element at the specified position in this dataset.default boolean
isEmpty()
Returns true if the dataset is empty.static <T> Dataset<T>
of
(Collection<T> data) Returns a default implementation of Dataset from a collection.int
size()
Returns the number of elements in this collection.stream()
Returns a (possibly parallel) Stream with this collection as its source.toList()
Returns theList
of data items.default String
toString
(int numRows) Returns the string representation of the dataset.
-
Method Details
-
distributed
default boolean distributed()Returns true if the dataset is distributed over multiple machines.- Returns:
- true if the dataset is distributed over multiple machines.
-
size
int size()Returns the number of elements in this collection.- Returns:
- the number of elements in this collection.
-
isEmpty
default boolean isEmpty()Returns true if the dataset is empty.- Returns:
- true if the dataset is empty.
-
get
Returns the element at the specified position in this dataset.- Parameters:
i
- the index of the element to be returned.- Returns:
- the i-th element.
-
apply
Returns the element at the specified position in this dataset.- Parameters:
i
- the index of the element to be returned.- Returns:
- the i-th element.
-
stream
Returns a (possibly parallel) Stream with this collection as its source.- Returns:
- a (possibly parallel) Stream with this collection as its source.
-
toList
Returns theList
of data items.- Returns:
- the
List
of data items.
-
toString
Returns the string representation of the dataset.- Parameters:
numRows
- the number of rows to show.- Returns:
- the string representation of the dataset.
-
of
Returns a default implementation of Dataset from a collection.- Type Parameters:
T
- the type of input elements.- Parameters:
data
- the data collection.- Returns:
- the dataset.
-