Package smile.deep

Interface Dataset

All Superinterfaces:
Iterable<SampleBatch>
All Known Implementing Classes:
ImageDataset

public interface Dataset extends Iterable<SampleBatch>
A dataset consists of data and an associated target (label) and can be iterated in mini-batches.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Dataset
    mnist(String path, boolean trainMode, int batch)
    MNIST contains 70,000 images of handwritten digits: 60,000 for training and 10,000 for testing.
    static Dataset
    of(double[][] data, double[] target, int batch)
    Creates a dataset of numeric arrays.
    static Dataset
    of(double[][] data, int[] target, int batch)
    Creates a dataset of numeric arrays.
    static Dataset
    of(float[][] data, float[] target, int batch)
    Creates a dataset of numeric arrays.
    static Dataset
    of(float[][] data, int[] target, int batch)
    Creates a dataset of numeric arrays.
    static Dataset
    of(Formula formula, DataFrame df, int batch)
    Returns a dataset.
    long
    Returns the size of dataset.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • size

      long size()
      Returns the size of dataset.
      Returns:
      the size of dataset.
    • of

      static Dataset of(float[][] data, int[] target, int batch)
      Creates a dataset of numeric arrays.
      Parameters:
      data - the data.
      target - the target.
      batch - the mini-batch size.
      Returns:
      the dataset.
    • of

      static Dataset of(float[][] data, float[] target, int batch)
      Creates a dataset of numeric arrays.
      Parameters:
      data - the data.
      target - the target.
      batch - the mini-batch size.
      Returns:
      the dataset.
    • of

      static Dataset of(double[][] data, int[] target, int batch)
      Creates a dataset of numeric arrays.
      Parameters:
      data - the data.
      target - the target.
      batch - the mini-batch size.
      Returns:
      the dataset.
    • of

      static Dataset of(double[][] data, double[] target, int batch)
      Creates a dataset of numeric arrays.
      Parameters:
      data - the data.
      target - the target.
      batch - the mini-batch size.
      Returns:
      the dataset.
    • of

      static Dataset of(Formula formula, DataFrame df, int batch)
      Returns a dataset.
      Parameters:
      formula - a symbolic description of the model to be fitted.
      df - the data frame of the explanatory and response variables.
      batch - the mini-batch size.
      Returns:
      the dataset.
    • mnist

      static Dataset mnist(String path, boolean trainMode, int batch)
      MNIST contains 70,000 images of handwritten digits: 60,000 for training and 10,000 for testing. The images are grayscale, 28x28 pixels, and centered.
      Parameters:
      path - the data folder path.
      trainMode - load training or test data.
      batch - the mini-batch size.
      Returns:
      the MNIST dataset.