Package smile.data

Interface Collectors


public interface Collectors
Stream collectors for Dataset, DataFrame, and Matrix.
  • Method Details

    • toDataset

      static <D, T> Collector<SampleInstance<D,T>,List<SampleInstance<D,T>>,Dataset<D,T>> toDataset()
      Returns a stream collector that accumulates elements into a Dataset.
      Type Parameters:
      D - the data type.
      T - the target type.
      Returns:
      the stream collector.
    • toDataFrame

      static <T> Collector<T,List<T>,DataFrame> toDataFrame(Class<T> clazz)
      Returns a stream collector that accumulates objects into a DataFrame.
      Type Parameters:
      T - the type of input elements to the reduction operation
      Parameters:
      clazz - The class type of elements.
      Returns:
      the stream collector.
    • toDataFrame

      static Collector<Tuple,List<Tuple>,DataFrame> toDataFrame(StructType schema)
      Returns a stream collector that accumulates tuples into a DataFrame.
      Returns:
      the stream collector.
    • toMatrix

      static Collector<Tuple,List<Tuple>,Matrix> toMatrix()
      Returns a stream collector that accumulates tuples into a Matrix.
      Returns:
      the stream collector.