Skip to main content

Crate ternary_trees

Crate ternary_trees 

Source
Expand description

Decision trees and forests for ternary classification on {-1, 0, +1}.

Provides TernaryDecisionTree with ternary splits, RandomForest with ternary voting, feature importance, and pruning with ternary entropy.

Structs§

RandomForest
Random forest for ternary classification.
TernaryDecisionTree
Ternary decision tree.

Enums§

Ternary
A ternary value.
TreeNode
A decision tree node.

Functions§

count_labels
Count ternary labels in a slice.
gini_impurity
Compute Gini impurity for ternary labels.
information_gain
Compute information gain for a split.
majority
Majority vote label.
ternary_entropy
Compute ternary entropy.

Type Aliases§

Feature
Feature value type for ternary features.
Sample
A training sample: features + label.