DOKK / manpages / debian 10 / mlpack-bin / mlpack_preprocess_split.1.en
mlpack_preprocess_split(1) User Commands mlpack_preprocess_split(1)

mlpack_preprocess_split - split data


mlpack_preprocess_split -i string [-I string] [-s int] [-r double] [-V bool] [-T string] [-L string] [-t string] [-l string] [-h -v]

This utility takes a dataset and optionally labels and splits them into a training set and a test set. Before the split, the points in the dataset are randomly reordered. The percentage of the dataset to be used as the test set can be specified with the '--test_ratio (-r)' parameter; the default is 0.2 (20%).

The output training and test matrices may be saved with the '--training_file (-t)' and '--test_file (-T)' output parameters.

Optionally, labels can be also be split along with the data by specifying the ’--input_labels_file (-I)' parameter. Splitting labels works the same way as splitting the data. The output training and test labels may be saved with the ’--training_labels_file (-l)' and '--test_labels_file (-L)' output parameters, respectively.

So, a simple example where we want to split the dataset 'X.csv' into ’X_train.csv' and 'X_test.csv' with 60% of the data in the training set and 40% of the dataset in the test set, we could run

$ preprocess_split --input_file X.csv --training_file X_train.csv --test_file X_test.csv --test_ratio 0.4

If we had a dataset 'X.csv' and associated labels 'y.csv', and we wanted to split these into 'X_train.csv', 'y_train.csv', 'X_test.csv', and 'y_test.csv', with 30% of the data in the test set, we could run

$ preprocess_split --input_file X.csv --input_labels_file y.csv --test_ratio 0.3 --training_file X_train.csv --training_labels_file y_train.csv --test_file X_test.csv --test_labels_file y_test.csv

Matrix containing data.

Default help info.
Get help on a specific module or option. Default value ''.
Matrix containing labels. Default value ''.
Random seed (0 for std::time(NULL)). Default value 0.
Ratio of test set; if not set,the ratio defaults to 0.2 Default value 0.2.
Display informational messages and the full list of parameters and timers at the end of execution.
Display the version of mlpack.

Matrix to save test data to. Default value ''.
Matrix to save test labels to. Default value ''.
Matrix to save training data to. Default value ''.
Matrix to save train labels to. Default value ''.

For further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack.

18 November 2018 mlpack-3.0.4