Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command line tools

Two binaries give access to the algorithms without Python. Build them with:

cargo build --release -p dtrees-cli -p contree-cli

Both read datasets as text files with one row per line, values separated by whitespace, and the class label (an integer from 0) in the first column. Lines starting with # are ignored.

1 1 0 0 1 0 1
0 0 1 0 1 1 0

dtrees

dtrees runs DL8.5, LGDT and the depth-2 solver on binary features (every value after the label must be 0 or 1). The common options come before the subcommand:

dtrees --input data.txt --print-tree --print-stats dl85 --depth 3 --support 5 --timeout 60
dtrees --input data.txt --print-tree lgdt --depth 6
dtrees --input data.txt --print-tree d2 --depth 2
OptionDescription
-i, --inputThe dataset file.
--print-tree, --print-statsPrint the tree and the search statistics.

dl85

OptionDefaultDescription
-d, --depthrequiredMaximum depth of the tree.
-s, --support1Minimum number of rows in each leaf.
-t, --timeoutnoneTime limit in seconds.
--heuristicno-heuristicFeature order: no-heuristic, gini-index, information-gain, weighted-entropy.
--depth2-policyenabledUse the depth-2 solver for the last two levels.
--lbdisabledsimilarity enables the similarity lower bound.
-b, --branching-policydefaultdynamic searches first the branch with the higher lower bound.
--always-sortSort the features by the heuristic at every node, not only at the root.
--max-errorinfInitial upper bound on the error.
--print-configPrint the configuration.

lgdt and d2

OptionDefaultDescription
-d, --depthrequired for lgdt, 2 for d2Maximum depth (1 or 2 for d2).
-s, --support1Minimum number of rows in each leaf.
-o, --objectiveerrorWhat the tree (d2) or the lookahead (lgdt) optimises: error (misclassifications) or information-gain.

dtrees <command> --help lists every option.

con-tree

con-tree runs ConTree on continuous features:

con-tree --input data.txt --depth 3 --sort-by-heuristic --print-tree --print-stats
con-tree --input data.txt --depth 5 --use-lds --sort-by-heuristic --time-limit 60 --print-stats
OptionDefaultDescription
-i, --inputrequiredThe dataset file.
-d, --depthrequiredMaximum depth of the tree.
-s, --support1Minimum number of rows in each leaf.
-t, --time-limit600Time limit in seconds.
--max-gap0Error gap to the optimum that is tolerated.
--max-errornoneInitial upper bound on the error.
--sort-by-heuristicExplore features and thresholds in Gini order.
--split-selection-strategymidmid, first or random; see ConTreeClassifier.
--no-fast-d2Disable the depth-2 solver.
--use-ldsUse the anytime search.
--budget-schedulediagonaldiagonal or square.
--print-tree, --print-statsPrint the tree, and the statistics with the reason the search stopped.