index Introduction
Concepts, Techniques and Tools

Classification & Predictive Modelling

Which outcome is most likely?
Set 08 · Level 8 of the Analytics Ladder

Predicting Which Category Something Belongs To

From describing patterns to predicting outcomes — will this customer churn? Will this loan default? Which product will this customer buy?

8Analytics Ladder · Level 08 of 10

Sets 01–05 described, diagnosed, forecasted, and explained numerical outcomes. Set 08 tackles a different kind of question: predicting a category. Will this customer leave or stay? Is this transaction fraudulent or legitimate? Which of three products will this prospect choose? These are classification problems — and they demand different techniques.

Classification does not predict a number — it predicts a category. The methods are different, the evaluation metrics are different, and the business questions they answer are different.
8
Techniques
AUC
Key Metric
Area Under ROC Curve
XGB
Most Powerful
technique
3
Tools Covered
Technique 01

Logistic Regression (Binary)

Models the probability of a binary outcome (0 or 1) using a logistic curve. Produces probabilities and odds ratios — highly interpretable.

Technique 02

Logistic Regression (Multinomial)

Extension to three or more outcome categories. Each category is compared against a reference group. Common in market segmentation and product choice modelling.

Technique 03

Decision Trees (CART)

Builds a tree of if-then rules by recursively splitting data on the most informative variable. Highly interpretable — the rules can be presented directly to business stakeholders.

Technique 04

Random Forest

An ensemble of many decision trees, each trained on a random sample of data and features. The majority vote determines the prediction. More accurate and less prone to overfitting than a single tree.

Technique 05

Naïve Bayes

Probabilistic classifier based on Bayes' theorem. Assumes features are independent (the "naïve" assumption). Fast, effective for text classification and spam detection.

Technique 06

Support Vector Machine (SVM)

Finds the optimal boundary (hyperplane) between classes that maximises the margin between classes. Powerful in high-dimensional spaces like text or image data.

Technique 07

Gradient Boosting (XGBoost)

Builds trees sequentially — each new tree corrects the errors of the previous ones. Currently the highest-performing algorithm on most structured business datasets.

Technique 08

Model Evaluation

Confusion matrix, accuracy, precision, recall, F1-score, and ROC-AUC. The framework for understanding how well — and in what ways — a classifier performs.

Classification vs regression — the key difference

Regression (Sets 03–04) predicts a continuous number: "How much will revenue be?" Classification predicts a discrete category: "Will this customer churn — yes or no?" The same predictors can be used in both, but the algorithms, loss functions, and evaluation metrics are entirely different. Never use regression to predict a binary outcome — use logistic regression or a classification algorithm instead.

Techniques 01 & 02

Logistic Regression

The most interpretable classification technique. Produces probabilities, odds ratios, and clear coefficient tables that non-technical stakeholders can understand.

Logistic regression predicts the probability that an observation belongs to a category. Instead of fitting a straight line (which could predict probabilities below 0 or above 1), it fits a logistic (S-shaped) curve that always stays between 0 and 1.

P(Y=1) = 1 / (1 + e−(α + β₁X₁ + β₂X₂ + ...))
Output is always between 0 and 1 — a probability. Decision threshold (typically 0.5) converts probability to a predicted class.

Interpreting logistic regression output — odds ratios

Unlike linear regression where β is the change in Y per unit of X, in logistic regression the exponentiated coefficient (e^β) is the odds ratio — how much the odds of the outcome multiply per unit increase in X.

Odds Ratio (e^β)MeaningBusiness interpretation
OR = 1.0No effect — odds unchangedThis variable makes no difference to the probability of the outcome
OR = 1.5Odds 50% higherEach unit increase in X multiplies the odds of churning by 1.5 (50% more likely)
OR = 2.0Odds doubleThe outcome is twice as likely per unit increase in X — a strong positive predictor
OR = 0.7Odds 30% lowerEach unit increase in X reduces the probability of the outcome — a protective factor
OR = 0.3Odds 70% lowerStrong negative predictor — substantially reduces the likelihood of the outcome
Business Example
Customer Churn Prediction — Telecom

Binary logistic regression predicting churn (1=churned, 0=stayed) with three predictors:

PredictorβOdds Ratio (e^β)p-valueInterpretation
Contract Length (months)−0.080.920.001Each additional month of contract reduces churn odds by 8%
Support Tickets (last 3mo)0.411.510.003Each additional ticket increases churn odds by 51%
Price Sensitivity Score0.291.340.012Higher price sensitivity increases churn odds by 34%

Business action: Customers with short contracts, multiple recent support issues, and high price sensitivity are the highest-risk segment. Target them with proactive outreach before contract renewal.

Multinomial logistic regression

When the outcome has 3+ categories (e.g. "Premium," "Standard," "Budget" tier chosen), use multinomial logistic regression. SPSS: Analyze → Regression → Multinomial Logistic. Each category is compared against a reference group (e.g. "Standard" is the reference, and the model estimates the odds of choosing "Premium" vs Standard, and "Budget" vs Standard). Python: LogisticRegression(multi_class='multinomial').

Technique 03

Decision Trees

If-then rules that any stakeholder can understand. The most explainable classification technique.

A decision tree works by repeatedly splitting the data on the variable (and value) that best separates the classes. The result is a tree of if-then rules: "IF contract length < 12 months AND support tickets > 3 THEN predict churn." Each path from root to leaf is a complete classification rule.

Business Example
Decision Tree — Loan Default Prediction
Credit Score < 650? n = 1000 YES (420) Debt-to-Income > 40%? n = 420 YES (280) 🔴 DEFAULT 82% probability NO (140) 🟡 MONITOR 41% probability NO (580) Employment < 2 years? n = 580 YES (190) 🟡 REVIEW 28% probability NO (390) 🟢 APPROVE 6% probability

The tree produces four segments with very different default probabilities: 82% (high risk), 41% and 28% (medium risk), 6% (approve confidently). A credit officer can apply these rules manually — no software required for a decision.

Key decision tree concepts

ConceptPlain explanationWhy it matters
Gini ImpurityMeasures how mixed the classes are in a node. Gini=0 means perfectly pure (all one class). Gini=0.5 means maximum mixing.CART algorithm splits on the variable that most reduces Gini — creating purer child nodes
Information GainHow much a split reduces entropy (uncertainty about class membership). Higher gain = better split.Alternative to Gini — used in ID3/C4.5 algorithms
Max DepthMaximum number of levels in the tree. Shallow trees (depth 3–5) are interpretable. Deep trees overfit.The most important hyperparameter to control. Start with depth=3 and increase gradually
PruningRemoving branches that don't add predictive power. Prevents overfitting by simplifying the tree.A tree that perfectly fits training data will often fail on new data — pruning improves generalisation
OverfittingWhen the tree memorises training data rather than learning patterns. Produces high training accuracy but poor test accuracy.Always evaluate on a held-out test set. A large gap between train and test accuracy = overfitting
Technique 04

Random Forest

The wisdom of many trees. More accurate than a single decision tree — and more robust to noise and outliers.

A random forest builds hundreds (or thousands) of decision trees, each trained on a random sample of rows (with replacement — "bagging") and a random subset of features at each split. Every tree makes a prediction; the final prediction is the majority vote (classification) or average (regression) across all trees.

Tree 1CHURN Tree 2CHURN Tree 3STAY ··· Tree 99CHURN Tree 100STAY MAJORITYVOTE→ CHURN 100 trees, each with different data sample and feature subset → majority vote

Why random forests outperform single trees

PropertySingle Decision TreeRandom Forest
AccuracyModerate — limited by depth/pruning trade-offHigher — averaging reduces variance
OverfittingHigh risk — especially deep treesLow risk — randomness in sampling prevents trees from memorising
InterpretabilityHigh — rules can be stated explicitlyLow — hundreds of trees cannot be summarised as rules
Feature importanceAvailable but unstable (changes with tree structure)Stable — averaged across all trees; highly reliable for driver identification
SpeedVery fastSlower — but parallelisable; modern hardware handles 1,000 trees easily
Feature importance — a bonus output

Random forests produce a feature importance ranking: which variables were most useful for reducing error across all trees. This is one of the most reliable driver-identification tools available. Unlike standardised regression coefficients, feature importance handles non-linear relationships and interactions automatically. Use it to identify the top 5–10 predictors before building a simpler, more interpretable model.

Key hyperparameters to tune

n_estimators — number of trees. More trees = more stable, diminishing returns after 200–500. max_depth — maximum depth of each tree. Shallow trees (3–7) reduce overfitting. max_features — number of features considered at each split. Typically √(total features) for classification. min_samples_leaf — minimum observations required in a leaf. Higher values produce simpler trees.

Techniques 05 · 06 · 07

Gradient Boosting & XGBoost

Sequential learning — each model corrects the mistakes of the previous one. Currently the highest-performing algorithm on most structured business datasets.

How boosting works

Unlike random forests (which build trees in parallel and average them), boosting builds trees sequentially. Each new tree focuses on the observations the previous trees got wrong — fitting the residuals (errors) rather than the original targets. The final prediction is the weighted sum of all trees.

01
Build the first tree
Start with a simple tree (often just a single node predicting the average). Calculate the residuals (prediction errors) for every observation.
02
Build the next tree on residuals
Fit a new tree that predicts the residuals from Step 1. Add a fraction of this tree (the learning rate, e.g. 0.1) to the previous predictions. Recalculate residuals.
03
Repeat hundreds of times
Each iteration reduces the remaining error. The learning rate controls how much each tree contributes — lower rates require more trees but generalise better.
04
Final prediction = sum of all trees
Each observation's prediction is the sum of contributions from every tree in the sequence, each weighted by the learning rate.

XGBoost — why it dominates

XGBoost (eXtreme Gradient Boosting) is an optimised implementation of gradient boosting with additional regularisation terms that prevent overfitting. It has won more Kaggle competitions and industrial prediction challenges than any other single algorithm.

AlgorithmTypeWhen to useInterpretability
Logistic RegressionSingle modelWhen interpretability is essential; regulatory environments; small datasetsVery high — odds ratios per variable
Decision TreeSingle modelWhen stakeholders need explicit rules; first-pass explorationHigh — rules stated directly
Random ForestEnsemble (parallel)Good default for most classification problems; feature importance neededLow — "black box" but feature importance available
XGBoostEnsemble (sequential)Maximum predictive accuracy; structured/tabular data; competition benchmarksLow — requires SHAP values for explanation
Naïve BayesProbabilisticText classification; spam detection; when features are genuinely independentModerate — probabilities per feature value
SVMGeometricHigh-dimensional data; text; image classificationLow — hyperplane in high-dimensional space
SHAP values — making XGBoost explainable

SHAP (SHapley Additive exPlanations) decomposes each individual prediction into contributions from each feature. For any single customer, you can say: "This customer was predicted to churn because: support tickets (+0.32), short contract (+0.21), high price sensitivity (+0.18), offset by long tenure (−0.15)." In Python: pip install shapshap.TreeExplainer(model). SHAP values make even XGBoost auditable for regulatory compliance.

Technique 08

Model Evaluation

Accuracy is rarely enough. The right metric depends on the business cost of different types of errors.

Classification models make two types of errors: predicting positive when it is actually negative (False Positive) and predicting negative when it is actually positive (False Negative). In most business problems these errors have very different costs — and the right metric reflects which error matters more.

The Confusion Matrix

The foundation of all classification metrics. A confusion matrix cross-tabulates actual vs predicted classes.

Predicted: Positive
Predicted: Negative
Actual: Positive
TPTrue PositiveCorrectly predicted churners
FNFalse NegativeMissed churners
Actual: Negative
FPFalse PositiveWrongly flagged as churn
TNTrue NegativeCorrectly predicted stayers

Key metrics derived from the confusion matrix

MetricFormulaBusiness interpretationUse when
AccuracyTP+TN / Total% of all predictions that are correctClasses are balanced — misleading with rare events (1% fraud: predict all legitimate and get 99% accuracy)
PrecisionTP / (TP+FP)Of all customers flagged as churners, what % actually churn?False positives are costly — e.g. expensive retention outreach sent to customers who weren't going to leave
Recall (Sensitivity)TP / (TP+FN)Of all actual churners, what % did we catch?False negatives are costly — e.g. missing a fraudulent transaction that causes customer loss
F1 Score2 × (Prec×Recall) / (Prec+Recall)Harmonic mean of precision and recall — balances bothBoth types of error matter; want a single balanced metric
ROC-AUCArea under ROC curveProbability that the model ranks a random positive higher than a random negative. AUC=0.5 = random; AUC=1.0 = perfectOverall model discrimination quality — best for comparing models
The precision-recall trade-off

Lowering the decision threshold (e.g. from 0.5 to 0.3) means more customers are flagged as churners — recall increases (you catch more real churners) but precision decreases (more false alarms). Raising the threshold means fewer alarms — precision rises but recall falls. The optimal threshold depends on the relative cost of false positives and false negatives in your specific business context.

Business Example
Which metric matters most — by use case
Use caseCostly errorKey metricWhy
Cancer screeningMissing cancer (FN)Recall / SensitivityMissing a positive is far worse than a false alarm
Spam filterBlocking legitimate email (FP)PrecisionBlocking important emails annoys users; spam is tolerable
Fraud detectionMissing fraud (FN)Recall + AUCFraudulent transactions cause real financial loss
Retention campaignWasting budget on stayers (FP)PrecisionOutreach is expensive — target only likely churners
Loan approvalApproving defaulters (FP)PrecisionBad loans are costly; rejected good applicants go elsewhere
Tool Guide 🟡 Go Deeper

SPSS & RapidMiner

GUI-based classification — logistic regression in SPSS, full ML pipelines in RapidMiner. No code required.

🟡 Go DeeperSPSS — Binary Logistic Regression
01
Open logistic regression
Analyze → Regression → Binary Logistic
02
Add variables
Move your binary outcome (0/1) to Dependent. Move all predictors to Covariates. For categorical predictors: click Categorical → move to Categorical Covariates → choose Indicator coding → Continue.
03
Request output
Click Options → tick: Classification plots · Hosmer-Lemeshow goodness of fit · Casewise listing of residuals · CI for exp(B) at 95% → Continue → OK.
04
Read the output — key tables
Variables in Equation table: B (β coefficient) · S.E. · Wald statistic · Sig. (p-value) · Exp(B) = odds ratio · 95% CI for Exp(B). Classification Table: shows TP, FP, FN, TN and overall % correct. Hosmer-Lemeshow test: p>0.05 means model fits the data adequately.
Interpret Exp(B) as odds ratio
Exp(B) = 1.51 for support tickets: each additional ticket multiplies the odds of churn by 1.51 (51% more likely). Exp(B) < 1 = protective factor (reduces odds).
🟡 Go DeeperSPSS — Decision Tree
01
Open Decision Tree
Analyze → Classify → Tree
02
Configure
Move your outcome to Dependent Variable. Move predictors to Independent Variables. Choose method: CRT (CART equivalent — Classification and Regression Trees, most widely used).
03
Set tree growth criteria
Click Criteria → set Maximum tree depth (start with 5) · Minimum cases in parent node (50) · Minimum cases in child node (25). These prevent overly complex trees → Continue → OK.
04
Read and apply the rules
SPSS draws the tree visually. Right-click the tree → Export → Rules to produce IF-THEN rules that can be applied in any spreadsheet or system. The output also shows node-level classification accuracy and a Risk table.
🟢 Start Here (No Code)RapidMiner — ML Pipeline Builder

RapidMiner uses a drag-and-drop workflow canvas. Each operator (Import, Model, Evaluate) is connected visually. No code required — ideal for non-programmers who need full ML capability.

01
Import your data
Drag Read Excel or Read CSV operator onto the canvas. Double-click → browse to your file → set the role of the outcome column to Label and set the type to binominal (binary).
02
Split into train and test
Drag Split Data operator → connect from Read → set ratio 70/30 (70% training, 30% test). This ensures evaluation on unseen data.
03
Add your model
For Random Forest: drag Random Forest from the Model operators panel → connect training data to its tra port → set number of trees (100), max depth (10).
04
Apply and evaluate
Drag Apply Model → connect model + test data → drag Performance (Binominal Classification) → connect predictions → Run (▶). Output shows: Accuracy · Precision · Recall · AUC · Confusion matrix.
05
Use Cross-Validation for more robust results
Replace the Split Data + Apply Model approach with a Cross Validation operator (10-fold). This uses all data for training and testing in rotation — much more reliable accuracy estimate for smaller datasets.
Tool Guide 🔵 Full Power

Python — scikit-learn & XGBoost

The complete classification pipeline — from preprocessing through model training, evaluation, and explanation.

🔵 Full PowerComplete Classification Pipeline
# pip install scikit-learn xgboost shap import pandas as pd import numpy as np from sklearn.model_selection import train_test_split, cross_val_score from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import (classification_report, confusion_matrix, roc_auc_score, roc_curve, ConfusionMatrixDisplay) import matplotlib.pyplot as plt # 1. Prepare data X = df.drop('churn', axis=1) y = df['churn'] X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.3, random_state=42, stratify=y) # 2. Logistic regression (with scaling pipeline) lr_pipe = Pipeline([ ('scaler', StandardScaler()), ('model', LogisticRegression(max_iter=1000)) ]) lr_pipe.fit(X_train, y_train) lr_pred = lr_pipe.predict(X_test) lr_prob = lr_pipe.predict_proba(X_test)[:,1] # Get odds ratios from logistic regression lr_model = lr_pipe.named_steps['model'] odds_ratios = pd.DataFrame({ 'Feature': X.columns, 'Odds_Ratio': np.exp(lr_model.coef_[0]) }).sort_values('Odds_Ratio', ascending=False) print(odds_ratios) # 3. Random Forest rf = RandomForestClassifier(n_estimators=100, max_depth=8, random_state=42, n_jobs=-1) rf.fit(X_train, y_train) rf_pred = rf.predict(X_test) rf_prob = rf.predict_proba(X_test)[:,1] # Feature importance feat_imp = pd.DataFrame({'feature': X.columns, 'importance': rf.feature_importances_}).\ sort_values('importance', ascending=False) print(feat_imp.head(10)) # 4. XGBoost from xgboost import XGBClassifier xgb = XGBClassifier(n_estimators=200, learning_rate=0.05, max_depth=5, random_state=42, use_label_encoder=False, eval_metric='logloss') xgb.fit(X_train, y_train) xgb_prob = xgb.predict_proba(X_test)[:,1]
🔵 Full PowerEvaluation & SHAP Explanation
# Classification report (precision, recall, F1) print(classification_report(y_test, rf_pred, target_names=['Stay', 'Churn'])) # Confusion matrix (visual) ConfusionMatrixDisplay.from_estimator(rf, X_test, y_test, display_labels=['Stay', 'Churn'], colorbar=False) plt.title('Random Forest Confusion Matrix') plt.show() # ROC curves — compare models fig, ax = plt.subplots() for name, prob in [('Logistic',lr_prob), ('RF',rf_prob), ('XGB',xgb_prob)]: fpr, tpr, _ = roc_curve(y_test, prob) auc = roc_auc_score(y_test, prob) ax.plot(fpr, tpr, label=f'{name} AUC={auc:.3f}') ax.plot([0,1],[0,1], 'k--', label='Random (AUC=0.50)') ax.set_xlabel('False Positive Rate') ax.set_ylabel('True Positive Rate') ax.set_title('ROC Curves — Model Comparison') ax.legend() plt.show() # SHAP — explain XGBoost predictions import shap explainer = shap.TreeExplainer(xgb) shap_vals = explainer.shap_values(X_test) shap.summary_plot(shap_vals, X_test) # global feature importance shap.force_plot(explainer.expected_value, # single prediction explanation shap_vals[0], X_test.iloc[0])
Interactive Practice

Three Simulators

Build intuition for confusion matrices, classification thresholds, and feature importance through live interaction.

Simulator 1 · Confusion Matrix Builder

A churn model has been applied to 1,000 customers. Adjust the counts of TP, FP, FN, TN and watch how accuracy, precision, recall, and F1 change in real time.

Adjust the confusion matrix values and see how the metrics respond.

Simulator 2 · Decision Threshold Explorer

The model produces a probability for each customer. The threshold determines who is classified as "churn." Move the threshold and watch precision and recall trade off against each other.

0.10 (flag everyone)0.50 (default)0.90 (only flag high-risk)
Move the threshold slider. Low threshold = high recall, lower precision. High threshold = high precision, lower recall.

Simulator 3 · Feature Importance Interpreter

A random forest has been trained on telecom churn data. The feature importance scores are shown. Rank the business actions from most to least impactful based on which features drive churn.

Based on these importances, which intervention should be prioritised?
Review the feature importances above and select the most impactful business action.
Best Practice

Common Mistakes

Classification mistakes can cost organisations real money — through missed risks or wasted interventions.

Mistake 01

Using accuracy as the primary metric on imbalanced data

A model that predicts "no fraud" for every transaction achieves 99.5% accuracy on a dataset with 0.5% fraud — but catches zero fraudulent transactions. Always check class balance first. On imbalanced data, use AUC, precision, recall, and F1 instead.

Mistake 02

Evaluating on training data

A model evaluated on the same data it was trained on will always look better than it really is — it has memorised the answers. Always use a held-out test set or cross-validation. A large gap between train accuracy and test accuracy = overfitting.

Mistake 03

Ignoring the business cost of different error types

Defaulting to a 0.5 threshold without considering whether false positives or false negatives are more costly is an analytical failure. Always ask: what does it cost to flag a loyal customer as a churner? What does it cost to miss a churner?

Mistake 04

Data leakage

Including variables in the model that would not be available at prediction time — for example, using "number of days since last call" in a churn model when you would not know this for future customers. Leakage produces unrealistically high accuracy that collapses in production.

Mistake 05

Choosing complexity over interpretability without justification

XGBoost has marginally higher AUC than logistic regression — but logistic regression is explainable, auditable, and deployable in regulated environments. The most accurate model is not always the right model. Match complexity to the organisation's needs.

Mistake 06

Not re-training as the world changes

A churn model trained in 2022 may be unreliable in 2025 if customer behaviour has shifted. Classification models degrade as the real world drifts away from the training data. Monitor model performance on new data monthly and retrain when accuracy drops.

Set 06 · Key Takeaway
Accuracy is not enough. Match your evaluation metric to the business cost of each type of error — then choose the model that minimises the errors that matter most.
Assessment

Knowledge Check

Five questions across all techniques in Set 06.

Q1 — A logistic regression model for customer churn shows Exp(B) = 0.88 for "contract length (months)." What does this mean?
A
Longer contracts increase churn probability by 88%
B
Each additional month of contract reduces the odds of churning by 12% — contract length is a protective factor
C
The model explains 88% of churn variance
D
Contract length is not a significant predictor
Exp(B) = 0.88 is an odds ratio below 1.0, meaning the odds of churning are multiplied by 0.88 per unit increase in contract length. In other words, each additional month reduces churn odds by 12% (1 − 0.88 = 0.12). Contract length is a protective factor — longer contracts reduce churn risk. Exp(B) above 1.0 would indicate increased risk; below 1.0 indicates decreased risk.
Q2 — A fraud detection model has: Precision = 0.95, Recall = 0.42, Accuracy = 0.99. The business team celebrates the 99% accuracy. What is the critical problem?
A
Precision of 0.95 is too high — the model is over-flagging legitimate transactions
B
Recall of 0.42 means the model misses 58% of all fraudulent transactions — the high accuracy is misleading because fraud is rare (most predictions are "not fraud" by default)
C
Nothing — 99% accuracy is excellent for any business use case
D
The model should use a decision tree instead of this approach
Recall = 0.42 means the model only catches 42% of actual fraud cases — it misses 58%. On a dataset where 1% of transactions are fraudulent, a model predicting "legitimate" for everything gets 99% accuracy. The 99% accuracy is entirely driven by the majority class. In fraud detection, missing fraud (false negatives) is the catastrophic error. The team should optimise for Recall and AUC, not accuracy.
Q3 — A decision tree trained on 10,000 records achieves 97% accuracy on training data but only 68% on test data. What does this indicate and what should be done?
A
The test data is too different from the training data — collect more similar test data
B
Severe overfitting — the tree has memorised the training data. Reduce max_depth, increase min_samples_leaf, or use pruning to simplify the tree
C
68% test accuracy is acceptable — better than random chance
D
The model needs more training data
A 29-percentage-point gap between training (97%) and test accuracy (68%) is a textbook sign of overfitting. The tree is too deep and has memorised specific patterns in the training data that do not generalise. Fix: constrain the tree (max_depth=5, min_samples_leaf=30) or switch to Random Forest which is resistant to overfitting. Always evaluate on test data — training accuracy is not a meaningful measure of model quality.
Q4 — For a customer retention campaign with a budget of $50 per outreach, which metric should drive the decision threshold — and why?
A
Recall — catch as many potential churners as possible
B
Precision — the outreach is expensive, so the model should only flag customers who are genuinely likely to churn to avoid wasting budget on loyal customers
C
Accuracy — the overall % correct is what matters for campaign ROI
D
F1 score — always use F1 when both errors are present
When outreach is expensive ($50 per contact), false positives (flagging loyal customers as churners) waste budget. High precision means most customers flagged are genuinely at risk — minimising wasted spend. Raise the threshold above 0.5 to improve precision at the cost of recall. Compare: at threshold=0.7, you flag 200 customers with 85% precision = 170 real churners contacted. At threshold=0.3, you flag 600 customers at 50% precision = still 300 real churners but $20,000 more spent on loyal customers.
Q5 — A Random Forest and XGBoost are both trained on the same churn dataset. XGBoost achieves AUC = 0.89 vs Random Forest AUC = 0.86. The organisation's compliance team requires all models to be fully auditable with plain-language explanations. Which model should be deployed?
A
XGBoost — higher AUC always means better business outcome
B
Random Forest — it is slightly less accurate but well known
C
Neither automatically — first consider whether a logistic regression meets the AUC requirement. If ensemble models are required, XGBoost with SHAP values can be auditable. But if compliance requires coefficient-level transparency, logistic regression is the right choice regardless of AUC difference.
D
Random Forest — SHAP values make it more explainable than XGBoost
A 3-point AUC advantage for XGBoost is real but modest. In regulated environments (banking, insurance, healthcare), auditability often overrides marginal accuracy gains. The decision sequence: (1) Can logistic regression achieve acceptable AUC? If yes, deploy it — it's fully interpretable. (2) If ensemble methods are needed, XGBoost + SHAP values provide explanation at the individual prediction level, satisfying most audit requirements. Random Forest is also explainable via SHAP. The question assumes XGBoost cannot be explained — but with SHAP, it can be.