Decision tree splits
Pick a feature and a threshold. Minimise Gini impurity to find the best split.
Pick a feature and a threshold. Minimise Gini impurity to find the best split.
A decision tree asks yes/no questions like “Study hours < 4.5?”. Each question splits the data into two groups, and each group predicts its majority label. A good question makes each group as pure as possible (mostly Pass or mostly Fail).
Gini impurity measures that mix: 0 means pure, 0.5 means a 50/50 jumble. The tree tries every feature and threshold and keeps the split with the lowest weighted Gini, then repeats on each side. That greedy search is fast, but each step only looks one move ahead.
Best single split: sleep hours < 5.85 (weighted Gini 0.328).
A decision tree asks yes/no questions like “Study hours < 4.5?”. Each question splits the data into two groups, and each group predicts its majority label. A good question makes each group as pure as possible (mostly Pass or mostly Fail).
Gini impurity measures that mix: 0 means pure, 0.5 means a 50/50 jumble. The tree tries every feature and threshold and keeps the split with the lowest weighted Gini, then repeats on each side. That greedy search is fast, but each step only looks one move ahead.
Things to try