Package com.jml.core
Class DataLoader
java.lang.Object
com.jml.core.DataLoader
The DataLoader class contains several methods to load data for models.
-
Method Summary
Modifier and TypeMethodDescriptionloadFeaturesAndTargets(String filePath)
Loads targets and features from a csv file.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.
-
Method Details
-
loadFeaturesAndTargets
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 seeloadFeaturesAndTargets(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 seeloadFeaturesAndTargets(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.
-