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

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Stream collectors.
  • Method Summary

    Modifier and Type
    Method
    Description
    default 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
    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
    Returns the number of elements in this collection.
    Returns a (possibly parallel) Stream with this collection as its source.
    default List<T>
    Returns the List 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

      T get(int i)
      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

      default T apply(int i)
      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

      Stream<T> stream()
      Returns a (possibly parallel) Stream with this collection as its source.
      Returns:
      a (possibly parallel) Stream with this collection as its source.
    • toList

      default List<T> toList()
      Returns the List of data items.
      Returns:
      the List of data items.
    • toString

      default String toString(int numRows)
      Returns the string representation of the dataset.
      Parameters:
      numRows - the number of rows to show.
      Returns:
      the string representation of the dataset.
    • of

      static <T> Dataset<T> of(Collection<T> data)
      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.