ARBIMETRA LAB
Decision Tree
Builds a tree of simple rules, with readable output and feature importance.
What it does
Builds a tree of simple rules, with readable output and feature importance.
Use it when an explainable set of rules is useful.
Data you need
- Target
- Numeric features
Supported data: Numeric, Categorical. Level: Intermediate.
Formula and method
Gini = 1 − Σpₖ² · Entropy = −Σpₖ log₂ pₖ
The tree repeatedly picks the feature and threshold that most reduce Gini impurity, entropy or squared error, until it reaches your limits. The rules are printed so they can be read and checked.
Assumptions
- Future data resemble the training data
- Rows are independent
Input checks
- At least 30 complete rows
- Test set held back from training
- Fixed random seed
How to read the result
Follow the rules from the root to a leaf.
Worked example
Illustrative run on Fisher iris measurements. These figures are the actual output of this model on that example, and they say nothing about your own data.
- Test accuracy = 0.9211 against a majority-class baseline of 0.3421; F1 = 0.923.
- The model is better than always predicting the most common class on this test set.
Limitations
- Deep trees overfit
Numerical validation
Validated 14 of 14 automated checks passed, including numerical results, invalid input, missing values, small samples, constant variables, charts and the interpretation text.
| Check | Reference | Result | Abs. error | Tolerance | Source |
|---|---|---|---|---|---|
| Root split matches exhaustive Gini search | 0.33035714 | 0.33035714 | 0.0e+0 | 1e-10 | Independent NumPy calculation |
Computed with python 3.13.2, numpy 2.2.5, scipy 1.14.1, pandas 2.3.3, statsmodels 0.14.4, scikit-learn 1.7.0, in your browser. A passing check confirms the listed comparison only. It does not make any result suitable for your data, and it is not a claim of equivalence with other statistical software.
Questions
How deep should a tree be?
Deep enough to capture patterns, and shallow enough to generalize. Compare training and test performance.
ARBIMETRA LAB is an educational and research tool. Results should be checked by the researcher and are not professional advice.
