Machine Learning Tutorial - Decision Trees
๐ณ Decision Trees - Yes/No Decisions
Real Life:
๐ง๏ธ Going Out?
Is it raining? โ Yes โ Take umbrella
โ No โ Is it sunny? โ Yes โ Go out
Flowchart ki tarah decisions!
Example: Play Cricket?
Weather?
โโ Sunny โ Play โ
โโ Rainy โ No Play โ
โโ Cloudy
โโ Windy? Yes โ No Play
โโ Windy? No โ Play
Advantages
- Easy to understand
- Visual flowchart
- No complex math
- Fast predictions
Example
from sklearn.tree import DecisionTreeClassifier
clf = DecisionTreeClassifier()
clf.fit([[1,0], [0,1]], [0, 1])