internalsGet Pro

Module 07 · Lesson 5 of 12Pro

Decision trees: learning rules by splitting data

Level
Beginner
Topic
Classical ML: regression and classification
Reading time
14 min

When you finish this page you can

  1. Work out the Gini impurity of a split by hand and say why the tree keeps the split with the lowest weighted impurity.
  2. Read a fitted tree as if-then rules with export_text, and explain why trees need no feature scaling.
  3. Stop a tree with max_depth or min_samples_leaf, and say what each one does to the chances in its leaves.
  4. Explain why a shallow tree ranks customers worse than logistic regression when the real pattern is a smooth slope.
  1. Entropy and cross-entropy: measuring surprise17 min
  2. Overfitting and underfitting13 min
  3. Train, validation and test sets13 min
  4. Logistic regression: predicting probabilities13 min

The same algorithm scored 0.343 and 7.571

is our example online store. Every Monday, Joseph’s growth team sends ₹100 vouchers to the 20,000 customers most likely to : to stop buying. Farah, an ML engineer, builds the model that ranks them, on a notebook sample of 200,000 customers.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan