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

  1. What Is Machine Learning?
  2. Data — Features, Labels & Splitting
  3. Linear Regression — Fitting a Line
  4. How Models Learn — Gradient Descent
  5. Classification — Predicting Categories
  6. Decision Trees
  7. Evaluating a Model Honestly
  8. Overfitting & the Bias-Variance Tradeoff
  9. The ML Workflow
  10. Mini-Project — A Spam Classifier
  11. Clustering — Finding Groups Without Labels
  12. Your First Real scikit-learn Model
  13. Words as Numbers — A Taste of NLP