mlpack_random_forest(1)
π¦ NAME π¦
mlpack_random_forest β random forests, bestie π
(and yes, you are reading the mlpack_random_forest(1) manual page, the user commands one, hi hello welcome, pull up a chair π«Ά)
β¨ SYNOPSIS β¨
mlpack_random_forest [-m unknown] [-l unknown] [-D int] [-g double] [-n int] [-N int] [-a bool] [-s int] [-d int] [-T unknown] [-L unknown] [-t unknown] [-V bool] [-w bool] [-M unknown] [-p unknown] [-P unknown] [-h -v]
π DESCRIPTION π
okay so. This program is literally an implementation of the standard random forest classification algorithm, and it's by Leo Breiman, an absolute icon, no cap π. A random forest can be trained and saved for later use, OR a random forest may be loaded and then it can generate predictions or class probabilities for points. Both things. It's giving versatility. π
The training set and its associated labels are specified with the --training_file (-t) and --labels_file (-l) parameters, respectively. The labels should be in the range [0, num_classes - 1]. And optionally, if --labels_file (-l) is not specified, the labels are assumed to be the last dimension of the training dataset. Sneaky but iconic.
When a model is trained, the --output_model_file (-M) output parameter may be used to save the trained model π. A model may be loaded for predictions with the --input_model_file (-m) parameter.
π¨ bestie listen. The--input_model_file (-m)parameter may not be specified when the--training_file (-t)parameter is specified. Pick a lane. Not both.
The --minimum_leaf_size (-n) parameter specifies the minimum number of training points that must fall into each leaf for it to be split. The --num_trees (-N) controls the number of trees in the random forest π³π³π³. The --minimum_gain_split (-g) parameter controls the minimum required gain for a decision tree node to split β larger values will force higher-confidence splits. The --maximum_depth (-D) parameter specifies the maximum depth of the tree. The --subspace_dim (-d) parameter is used to control the number of random dimensions chosen for an individual node's split. And if --print_training_accuracy (-a) is specified, the calculated accuracy on the training set will be printed. β¨
Test data may be specified with the --test_file (-T) parameter, and if performance measures are desired for that test set, labels for the test points may be specified with the --test_labels_file (-L) parameter. Predictions for each test point may be saved via the --predictions_file (-p) output parameter. Class probabilities for each prediction may be saved with the --probabilities_file (-P) output parameter π.
πΈ the example era πΈ
For example, to train a random forest with a minimum leaf size of 20 using 10 trees on the dataset contained in data.csv with labels labels.csv, saving the output random forest to rf_model.bin and printing the training error, one could call:
$ mlpack_random_forest --training_file data.csv --labels_file labels.csv --minimum_leaf_size 20 --num_trees 10 --output_model_file rf_model.bin --print_training_accuracy
Then, to use that model to classify points in test_set.csv and print the test error given the labels test_labels.csv using that model, while saving the predictions for each point to predictions.csv, one could call:
$ mlpack_random_forest --input_model_file rf_model.bin --test_file test_set.csv --test_labels_file test_labels.csv --predictions_file predictions.csv
ate. π
π OPTIONAL INPUT OPTIONS π
--help (-h) [bool]β Default help info. The classic. The moment. π--info [string]β Print help on a specific option. Default value''.--input_model_file (-m) [unknown]β Pre-trained random forest to use for classification. Your glowed-up, already-trained bestie π§--labels_file (-l) [unknown]β Labels for training dataset.--maximum_depth (-D) [int]β Maximum depth of the tree (0means no limit). Default value0.--minimum_gain_split (-g) [double]β Minimum gain needed to make a split when building a tree. Default value0.--minimum_leaf_size (-n) [int]β Minimum number of points in each leaf node. Default value1.--num_trees (-N) [int]β Number of trees in the random forest. Default value10.--print_training_accuracy (-a) [bool]β If set, then the accuracy of the model on the training set will be predicted (verbose must also be specified π).--seed (-s) [int]β Random seed. If0,std::time(NULL)is used. Default value0.--subspace_dim (-d) [int]β Dimensionality of random subspace to use for each split.0will autoselect the square root of data dimensionality. Default value0.--test_file (-T) [unknown]β Test dataset to produce predictions for.--test_labels_file (-L) [unknown]β Test dataset labels, if accuracy calculation is desired.--training_file (-t) [unknown]β Training dataset.--verbose (-v) [bool]β Display informational messages and the full list of parameters and timers at the end of execution. The receipts, fr fr π--version (-V) [bool]β Display the version of mlpack.--warm_start (-w) [bool]β If true and passed along withtrainingandinput_modelthen trains more trees on top of existing model. Growth mindset, literally π±
π OPTIONAL OUTPUT OPTIONS π
--output_model_file (-M) [unknown]β Model to save trained random forest to. Save your work bestie, please π--predictions_file (-p) [unknown]β Predicted classes for each point in the test set.--probabilities_file (-P) [unknown]β Predicted class probabilities for each point in the test set.
π 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. iykyk πβ¨
okay that's the whole page, you're welcome, go train a forest π³π«Ά. this was mlpack-4.8.0, dated 22 June 2026 β mwah, slay, bye bestie π ππ
π¦ where this page comes from
- ubuntu stonking: mlpack-bin 4.8.0-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms