.\" Text automatically generated by txt2man .TH mlpack_preprocess_split 1 "18 November 2018" "mlpack-3.0.4" "User Commands" .SH NAME \fBmlpack_preprocess_split \fP- split data .SH SYNOPSIS .nf .fam C \fBmlpack_preprocess_split\fP \fB-i\fP \fIstring\fP [\fB-I\fP \fIstring\fP] [\fB-s\fP \fIint\fP] [\fB-r\fP \fIdouble\fP] [\fB-V\fP \fIbool\fP] [\fB-T\fP \fIstring\fP] [\fB-L\fP \fIstring\fP] [\fB-t\fP \fIstring\fP] [\fB-l\fP \fIstring\fP] [\fB-h\fP \fB-v\fP] .fam T .fi .fam T .fi .SH DESCRIPTION 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 '\fB--test_ratio\fP (\fB-r\fP)' parameter; the default is 0.2 (20%). .PP The output training and test matrices may be saved with the '\fB--training_file\fP (\fB-t\fP)' and '\fB--test_file\fP (\fB-T\fP)' output parameters. .PP Optionally, labels can be also be split along with the data by specifying the \(cq\fB--input_labels_file\fP (\fB-I\fP)' parameter. Splitting labels works the same way as splitting the data. The output training and test labels may be saved with the \(cq\fB--training_labels_file\fP (\fB-l\fP)' and '\fB--test_labels_file\fP (\fB-L\fP)' output parameters, respectively. .PP So, a simple example where we want to split the dataset 'X.csv' into \(cqX_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 .PP $ preprocess_split \fB--input_file\fP X.csv \fB--training_file\fP X_train.csv \fB--test_file\fP X_test.csv \fB--test_ratio\fP 0.4 .PP 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 .PP $ preprocess_split \fB--input_file\fP X.csv \fB--input_labels_file\fP y.csv \fB--test_ratio\fP 0.3 \fB--training_file\fP X_train.csv \fB--training_labels_file\fP y_train.csv \fB--test_file\fP X_test.csv \fB--test_labels_file\fP y_test.csv .RE .PP .SH REQUIRED INPUT OPTIONS .TP .B \fB--input_file\fP (\fB-i\fP) [\fIstring\fP] Matrix containing data. .SH OPTIONAL INPUT OPTIONS .TP .B \fB--help\fP (\fB-h\fP) [\fIbool\fP] Default help info. .TP .B \fB--info\fP [\fIstring\fP] Get help on a specific module or option. Default value ''. .TP .B \fB--input_labels_file\fP (\fB-I\fP) [\fIstring\fP] Matrix containing labels. Default value ''. .TP .B \fB--seed\fP (\fB-s\fP) [\fIint\fP] Random seed (0 for \fBstd::time\fP(NULL)). Default value 0. .TP .B \fB--test_ratio\fP (\fB-r\fP) [\fIdouble\fP] Ratio of test set; if not set,the ratio defaults to 0.2 Default value 0.2. .TP .B \fB--verbose\fP (\fB-v\fP) [\fIbool\fP] Display informational messages and the full list of parameters and timers at the end of execution. .TP .B \fB--version\fP (\fB-V\fP) [\fIbool\fP] Display the version of mlpack. .SH OPTIONAL OUTPUT OPTIONS .TP .B \fB--test_file\fP (\fB-T\fP) [\fIstring\fP] Matrix to save test data to. Default value ''. .TP .B \fB--test_labels_file\fP (\fB-L\fP) [\fIstring\fP] Matrix to save test labels to. Default value ''. .TP .B \fB--training_file\fP (\fB-t\fP) [\fIstring\fP] Matrix to save training data to. Default value ''. .TP .B \fB--training_labels_file\fP (\fB-l\fP) [\fIstring\fP] Matrix to save train labels to. Default value ''. .SH ADDITIONAL INFORMATION 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.