mlpack_decision_tree(1)
π mlpack_decision_tree β bestie, it's giving decision tree π
okay so mlpack_decision_tree(1) is a User Commands situation and honestly? she ate. we're training and evaluating with a decision tree, no cap. come sit with me.
β¨ SYNOPSIS β¨
mlpack_decision_tree [-m unknown] [-l unknown] [-D int] [-g double] [-n int] [-a bool] [-T string] [-L unknown] [-t string] [-V bool] [-w unknown] [-M unknown] [-p unknown] [-P unknown] [-h -v]
πΈ DESCRIPTION πΈ
Train and evaluate using a decision tree. Picture it: you've got a dataset full of numeric or categorical features, plus labels for every point in it, and this program will literally train a decision tree on that data. iconic behavior.
π the training setup
Your training set and its labels go in through the --training_file (-t) and --labels_file (-l) parameters, respectively. The labels need to be in the range [0, num_classes - 1]. And optionally, if you don't specify --labels_file (-l), the labels are assumed to be the last dimension of the training dataset. sneaky but valid.
π the model stuff
Once a model is trained, the --output_model_file (-M) output parameter may be used to save that trained model. Wanna load a model instead and just do predictions? That's the --input_model_file (-m) parameter. BUT β and this is the important part, bestie β --input_model_file (-m) may not be specified when the --training_file (-t) parameter is specified. pick a lane.
Now the tuning knobs, let's go:
--minimum_leaf_size (-n)specifies the minimum number of training points that must fall into each leaf for it to be split.--minimum_gain_split (-g)specifies the minimum gain that is needed for the node to split.--maximum_depth (-D)specifies the maximum depth of the tree.- If
--print_training_accuracy (-a)is specified, the training accuracy will be printed. π
π§ test data era
Test data may be specified with the --test_file (-T) parameter, and if you want performance numbers for that test set, labels 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, and class probabilities for each prediction may be saved with the --probabilities_file (-P) output parameter. so many outputs, we love options.
π the examples (these are real, copy them)
For example, to train a decision tree with a minimum leaf size of 20 on the dataset contained in data.csv with labels labels.csv, saving the output model to tree.bin and printing the training error, one could call
$ mlpack_decision_tree --training_file data.arff --labels_file labels.csv --output_model_file tree.bin --minimum_leaf_size 20 --minimum_gain_split 0.001 --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_decision_tree --input_model_file tree.bin --test_file test_set.arff --test_labels_file test_labels.csv --predictions_file predictions.csv
π«Ά OPTIONAL INPUT OPTIONS π«Ά
--help(-h) [bool] β Default help info. the classic cry for help, but make it documentation.--info[string] β Print help on a specific option. Default value''.--input_model_file(-m) [unknown] β Pre-trained decision tree, to be used with test points.--labels_file(-l) [unknown] β Training labels.--maximum_depth(-D) [int] β Maximum depth of the tree (0 means no limit). Default value0.--minimum_gain_split(-g) [double] β Minimum gain for node splitting. Default value1e-07.--minimum_leaf_size(-n) [int] β Minimum number of points in a leaf. Default value20.--print_training_accuracy(-a) [bool] β Print the training accuracy.--test_file(-T) [string] β Testing dataset (may be categorical).--test_labels_file(-L) [unknown] β Test point labels, if accuracy calculation is desired.--training_file(-t) [string] β Training dataset (may be categorical).--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.--weights_file(-w) [unknown] β The weight of labels
π OPTIONAL OUTPUT OPTIONS π
--output_model_file(-M) [unknown] β Output for trained decision tree.--predictions_file(-p) [unknown] β Class predictions for each test point.--probabilities_file(-P) [unknown] β Class probabilities for each test point.
β 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. fr fr, go read it, it's lowkey fascinating.
okay that's the whole page bestie, you're officially a decision tree girlie now β¨
this was brought to you by mlpack-4.8.0, dated 22 June 2026 β mwah, bye! πππ¦
π¦ 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