Machine Learning, FoundationsLesson 62 of 92

Module 6 · Trees, ensembles, and the algorithms that win on tables

Explaining one prediction, and the shape of one feature

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 10 of 10 in this chapter

This chapter’s goalChoose between a linear model, a random forest and a gradient boosting library for a given tabular problem and defend the choice, tune the four hyperparameters that actually matter in each, and explain why impurity-based feature importance is biased and what permutation importance and SHAP replace it with.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmWatch1:59Not available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

Two different questions

“Which features does this model rely on overall?” was the last lesson. Two more specific questions come up constantly and need different tools.

**Why did this application get declined?** A local explanation, for one row.

**How does the prediction change as this feature changes?** A global shape, for one column.

SHAP: dividing the credit for one prediction

SHAP assigns each feature a number saying how much it pushed this particular prediction away from the average prediction. The numbers add up exactly:

Text
base value (average prediction)          0.12
+ income = 240,000                      -0.04
+ late_payments = 3                     +0.19
+ account_age_days = 45                 +0.08
+ everything else                       -0.02
= this prediction                        0.33

That is a readable answer to “why 0.33”, and it is the format regulators tend to accept for adverse action notices.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the How a Language Model Actually Works exam.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘Explaining one prediction, and the shape of one feature’, in Machine Learning, Foundations. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/machine-learning-foundations/shap-and-partial-dependence (Accessed: 29 November 2026).