Classification · Beginner

Decision Tree

Watch candidate thresholds compete, then follow a sample from root to leaf.

A Decision Tree recursively selects feature thresholds that reduce impurity. ModelOrigen exposes candidate splits, the selected gain, growing nodes, the final tree, and a real prediction path.

Step by step

  1. Start with samples at the root node.
  2. Generate candidate feature thresholds.
  3. Measure impurity before and after each candidate split.
  4. Choose the best valid gain.
  5. Repeat on child nodes until a stopping rule creates leaves.
  6. Route the query through the learned thresholds to a leaf prediction.

Core formulas

Gini impurity

Gini = 1 − Σ pₖ²

Low when a node is dominated by one class.

Entropy

H = −Σ pₖ log₂ pₖ

Alternative uncertainty measure.

Split gain

Gain = I(parent) − weighted I(children)

Positive gain means a split reduces impurity.

When to use Decision Tree

  • Rule-like nonlinear interactions are plausible.
  • You want human-readable threshold decisions.
  • Little feature scaling should be required.

Related interactive lessons

Primary references

scikit-learn Decision Trees