Crate tangram_tree[][src]

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

Structs

BinaryClassifiers predict binary target values, for example whether a patient has heart disease or not.

This struct is returned by BinaryClassifier::train.

A BranchNode is a branch in a tree.

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.

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.

The parameters in this struct control how to determine whether training should stop early after each round or epoch.

The leaves in a tree hold the values to output for examples that get sent to them.

MulticlasClassifiers predict multiclass target values, for example which of several species a flower is.

This struct is returned by MulticlassClassifier::train.

Regressors predict continuous target values, for example the selling price of a home.

This struct is returned by Regressor::train.

These are the options passed to Regressor::train, BinaryClassifier::train, and MulticlassClassifier::train.

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

This enum defines whether binned features will be layed out in row major or column major order.

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.

A node is either a branch or a leaf.

This struct describes the training progress.