run la-soglia.bas
MDN-119:44
DEMO by Michele di Nuzzo

The threshold

MDN · LAB THE THRESHOLD classification and threshold · 1958
soglia
threshold: moves the cut between those flagged and those not
soglia 0,5
the default threshold, 0.5
soglia 0,2
a threshold of 0.2, close to the true share of churners
i 3.000 della campagna
the 3,000 of the campaign: the threshold that lets through the customers most at risk, as many as the budget allows

▶ Run ⬇ Download (.html)

Logistic regression gives each loyalty-card customer a churn probability, but a probability is not a decision: between the two there is the threshold. Move it over 3,000 customers from the test set and watch the confusion matrix, precision, recall and lift change, while the point slides along the ROC curve. The lab’s interface is in Italian.

Things to try

  • The default threshold. With 0.5 the model flags few customers, the ones it is almost sure about.
  • Lowering the threshold. With 0.2 recall rises and precision falls.
  • The budget decides. With 3,000 discount vouchers the threshold is the one that lets through the most at risk: look at the lift.

The article: The threshold.

The demo is a single HTML file: download it and use it offline, even without an internet connection. Licence: CC BY-NC 4.0 — you may share it, crediting the author and this page, but not for commercial purposes.