Ch 12 · Your First Real scikit-learn Model · Machine Learning & AI
Topic 12 of 13 in Machine Learning & AI — Foundations — 3 lessons.
The Iris Dataset
scikit-learn ships with classic datasets so you can practise instantly. Iris has 150 flowers, 4 measurements each (petal/sepal length & width), and 3 species. Our job: learn to name the species from the measurements.
Split, Fit, Score
This is Chapter 9's pipeline, for real: train_test_split hides 30% of the flowers, a DecisionTreeClassifier learns from the rest, and accuracy_score grades it on the held-out test set it never saw.
What Did It Learn?
A trained tree can tell you which features it leaned on. Here we plot each feature's importance — you'll see petal measurements dominate, exactly how a botanist tells these species apart.
All topics in Machine Learning & AI Beginner
- What Is Machine Learning?
- Data — Features, Labels & Splitting
- Linear Regression — Fitting a Line
- How Models Learn — Gradient Descent
- Classification — Predicting Categories
- Decision Trees
- Evaluating a Model Honestly
- Overfitting & the Bias-Variance Tradeoff
- The ML Workflow
- Mini-Project — A Spam Classifier
- Clustering — Finding Groups Without Labels
- Your First Real scikit-learn Model
- Words as Numbers — A Taste of NLP