mlpack_preprocess_split(1)

πŸ’– mlpack_preprocess_split β€” the manual page, bestie edition πŸ’–

okay so. you opened the manual for mlpack_preprocess_split(1) and honestly? you're about to have the best time splitting datasets. no cap. this little utility is giving main character energy in the mlpack lineup, and I'm gonna walk you through every single flag like we're texting at 2am. 🫢

✨ NAME ✨

mlpack_preprocess_split β€” split data 🌸

✨ SYNOPSIS ✨

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

✨ DESCRIPTION ✨

bestie. listen. this utility takes a dataset, and optionally some labels, and splits them into a training set and a test set. obsessed. 😌

before the split happens, the points in the dataset get randomly reordered. the percentage of the dataset that becomes the test set is yours to choose with the --test_ratio (-r) parameter β€” and if you don't say anything, the default is 0.2 (that's 20%, periodt).

the output training and test matrices can be saved with the --training_file (-t) and --test_file (-T) output parameters. iconic.

optionally, labels can get split right along with the data β€” just specify the --input_labels_file (-I) parameter. splitting labels works the exact same way as splitting the data, no extra drama. the output training and test labels get saved with the --training_labels_file (-l) and --test_labels_file (-L) output parameters, respectively. slay. πŸ’…

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:

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

also, by default the dataset is shuffled and split. but if shuffling is not the vibe, you can hand over the --no_shuffle (-S) option to avoid shuffling the data. an example to avoid shuffling of data is:

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

and 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:

$ mlpack_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

to maintain the ratio of each class in the train and test sets, the --stratify_data (-z) option can be used. she's organized. she's balanced. she's everything. ✨

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

πŸ”₯ REQUIRED INPUT OPTIONS πŸ”₯

these are non-negotiable, bestie. can't skip.

  • --input_file (-i) [unknown] β€” Matrix containing data. that's the whole dataset you're splitting, the star of the show. πŸ‘‘

πŸŽ€ OPTIONAL INPUT OPTIONS πŸŽ€

here's where you get to customize the vibe:

  • --help (-h) [bool] β€” Default help info.
  • --info [string] β€” Print help on a specific option. Default value ''.
  • --input_labels_file (-I) [unknown] β€” Matrix containing labels.
  • --no_shuffle (-S) [bool] β€” Avoid shuffling the data before splitting. for when you want things to stay exactly where they are.
  • --seed (-s) [int] β€” Random seed (0 for std::time(NULL)). Default value 0.
  • --stratify_data (-z) [bool] β€” Stratify the data according to labels
  • --test_ratio (-r) [double] β€” Ratio of test set; if not set,the ratio defaults to 0.2 Default value 0.2.
  • --verbose (-v) [bool] β€” Display informational messages and the full list of parameters and timers at the end of execution.
  • --version (-V) [bool] β€” Display the version of mlpack.

🌈 OPTIONAL OUTPUT OPTIONS 🌈

where your beautiful new datasets go to live:

  • --test_file (-T) [unknown] β€” Matrix to save test data to.
  • --test_labels_file (-L) [unknown] β€” Matrix to save test labels to.
  • --training_file (-t) [unknown] β€” Matrix to save training data to.
  • --training_labels_file (-l) [unknown] β€” Matrix to save train labels to.

πŸ’œ 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. go read it, it's giving academic excellence. πŸ“š


and that's the whole page, bestie. this was mlpack-4.8.0, dated 22 June 2026 β€” written down in the manual as mlpack_preprocess_split(1). go forth and split your data immaculately. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from