A decision tree predicts by asking one question after another, like a flowchart 🌳 Here's how it…
#decisiontree #machinelearning #datascience
A decision tree predicts by asking one question after another, like a flowchart 🌳 Here's how it learns.
The structure: a root node, decision nodes that each test one feature, branches for the answers, and leaves that hold the predictions.
• Classification trees predict a category (order or don't order)
• Regression trees predict a number (the average value in each leaf)
How it learns: training is greedy. Each node takes the split that leaves the purest groups, measured with Gini impurity or entropy (squared error for regression). In the example, splitting 16 evenings on "food at home?" cuts Gini from 0.50 to 0.30, the largest drop.
🎯 Why limits matter: grown until every leaf is pure, the tree scored 100% on training data but only 77% on test data. Pruned back to 4 leaves, it reached 89% on test data.
⚠️ Watch out for:
• Instability: moving one point can change the root split
• Overfitting: deep trees memorize noise
Random forests and gradient boosting fix this by combining many trees. Which one should we break down next? 👇
💾 Save this for later, and follow @statsmaniaofficial for more.
Data science, made simple.
#decisiontree #machinelearning #datascience #randomforest #statistics
Comments
Comments from the original post on Instagram
No comments yet
