Package com.jml.core

Class DataLoader

java.lang.Object
com.jml.core.DataLoader

public class DataLoader extends Object
The DataLoader class contains several methods to load data for models.
  • Method Details

    • loadFeaturesAndTargets

      public static List<String[][]> loadFeaturesAndTargets(String filePath)
      Loads targets and features from a csv file.

      The csv file is assumed to have one data sample per row. The last column is assumed to be the target column, while all other columns are feature columns. If you wish to specify what column indices contain targets vs features see loadFeaturesAndTargets(String, int[], int[]).
      Parameters:
      filePath - The path, including the extension, of the csv file containing the targets and features.
      Returns:
      An array list of length two containing the features and targets of the dataset in that order.
    • loadFeaturesAndTargets

      public static List<String[][]> loadFeaturesAndTargets(String filePath, int[] featureColumns, int[] targetColumns)
      Loads targets and features from a csv file.

      The csv file is assumed to have one data sample per row. Each column is either a feature or a target. Also see loadFeaturesAndTargets(String)
      Parameters:
      filePath - The path, including the extension, of the csv file containing the targets and features.
      featureColumns - Indices of columns containing features.
      targetColumns - Indices of columns containing targets.
      Returns:
      An array list of length two containing the features and targets of the dataset in that order.