internalsGet Pro

Module 12 · Lesson 9 of 12Pro

Explaining predictions: SHAP and feature importance

Level
Intermediate
Topic
Model evaluation and experimentation
Reading time
18 min

When you finish this page you can

  1. Tell a global question (what does the model rely on?) from a local one (why did this customer get this score?) and pick a method that answers it.
  2. Compute exact Shapley values for one prediction by hand and in code, and check that the base value plus the contributions equals the prediction.
  3. Explain why TreeSHAP makes Shapley values practical for tree models, and what background data and output scale you must choose.
  4. Name what an explanation cannot tell you, including the effect of changing a feature.
  1. Correlation is not causation13 min
  2. Random forests: many trees voting together17 min
  3. Gradient boosting: XGBoost, LightGBM and CatBoost18 min

Video lesson · coming soon

A customer who ordered 9 days ago

is our example online store. Its ML team works on a notebook sample of about 1 million orders from 200,000 customers. Every Monday, Farah’s model scores all 200,000 customers, and Joseph’s growth team sends a ₹100 voucher to the 20,000 most likely to leave.

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