Skip to main content

Module decision_tree_learner

Module decision_tree_learner 

Source
Expand description

DecisionTreeLearner — ID3/C4.5-style decision tree with training, prediction, feature importance, pruning, and rich statistics.

§Design

  • Recursive binary splitting on continuous features.
  • Configurable split criterion: Shannon Entropy (ID3), Gini impurity, or Misclassification rate.
  • Optional feature sub-sampling per split node (random forests style), driven by a pure-Rust xorshift64 PRNG — no external crate required.
  • Post-training leaf pruning (prune) to collapse subtrees where both descendant leaves are minority-dominated.
  • Bounded training-history ring-buffer (VecDeque capped at 100 records).
  • All operations are no_std-compatible except for HashMap/VecDeque.

Structs§

DecisionTreeLearner
ID3/C4.5-style decision tree learner.
DtlLearnerConfig
Hyper-parameters controlling tree growth and prediction.
DtlLearnerStats
Summary statistics produced by DecisionTreeLearner::learner_stats.
DtlPrediction
Prediction result from DecisionTreeLearner::predict.
DtlSample
One labeled training / prediction example.
DtlTrainingRecord
One entry in the training history ring-buffer.

Enums§

DtlCriterion
Split criterion for tree growing.
DtlError
Errors produced by DecisionTreeLearner.
DtlNode
Internal node of the decision tree.

Type Aliases§

DtlDecisionTreeLearner
Alias for DecisionTreeLearner.