Crate tangram_tree

Source
Expand description

This crate implements machine learning models for regression and classification using ensembles of decision trees. It has many similarities to LightGBM, XGBoost, and others, but is written in pure Rust.

For an example of regression, see benchmarks/boston.rs.rs. For an example of binary classification, see benchmarks/heart_disease.rs. For an example of multiclass classification, see benchmarks/iris.rs`.

Modules§

serialize

Structs§

BinaryClassifier
BinaryClassifiers predict binary target values, for example whether a patient has heart disease or not.
BinaryClassifierTrainOutput
This struct is returned by BinaryClassifier::train.
BranchNode
A BranchNode is a branch in a tree.
BranchSplitContinuous
A continuous branch split takes the value of a single number feature, compares it with a split_value, and if the value is <= split_value, the example is sent left, and if it is > split_value, it is sent right.
BranchSplitDiscrete
A discrete branch split takes the value of a single enum feature and looks up in a bitset which way the example should be sent.
EarlyStoppingOptions
The parameters in this struct control how to determine whether training should stop early after each round or epoch.
LeafNode
The leaves in a tree hold the values to output for examples that get sent to them.
MulticlassClassifier
MulticlasClassifiers predict multiclass target values, for example which of several species a flower is.
MulticlassClassifierTrainOutput
This struct is returned by MulticlassClassifier::train.
Progress
Regressor
Regressors predict continuous target values, for example the selling price of a home.
RegressorTrainOutput
This struct is returned by Regressor::train.
TrainOptions
These are the options passed to Regressor::train, BinaryClassifier::train, and MulticlassClassifier::train.
Tree
Trees are stored as a Vec of Nodes. Each branch in the tree has two indexes into the Vec, one for each of its children.

Enums§

BinnedFeaturesLayout
This enum defines whether binned features will be layed out in row major or column major order.
BranchSplit
A BranchSplit describes how examples are sent to the left or right child given their feature values. A Continous split is used for number features, and Discrete is used for enum features.
Node
A node is either a branch or a leaf.
SplitDirection
TrainProgressEvent
This struct describes the training progress.