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 value 0.
  • --minimum_gain_split (-g) [double] β€” Minimum gain for node splitting. Default value 1e-07.
  • --minimum_leaf_size (-n) [int] β€” Minimum number of points in a leaf. Default value 20.
  • --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