Day 2 Afternoon | WISE Workshop — Addis Ababa 2026
2026-02-03
Regularized linear models (LASSO, Ridge):
This afternoon:
Consider predicting demand:
\[\text{Demand} = \beta_0 + \beta_1 \cdot \text{Season} + \beta_2 \cdot \text{Facility\_Size} + ...\]
Problems:
Trees discover nonlinearities and interactions automatically
How a tree makes predictions:
[Month Demand < 500?]
/ \
Yes No
| |
[Rainy Season?] [Facility Size?]
/ \ / \
Yes No Small Large
| | | |
Predict: Predict: Predict: Predict:
650 420 550 720
At each node:
For regression (predicting demand):
For classification (stockout: yes/no):
Classic tree example:
Trees capture interactions naturally: being female AND in first class → high survival
Control complexity with hyperparameters:
| Parameter | What it controls | Trade-off |
|---|---|---|
| max_depth | How deep tree can grow | Deeper = more complex |
| min_samples_leaf | Min observations per leaf | Higher = simpler |
| min_samples_split | Min observations to split | Higher = simpler |
| max_features | Features considered per split | Fewer = more randomness |
Shallow trees: High bias, low variance (underfit)
Deep trees: Low bias, high variance (overfit)
Run on different random subsets → very different trees
Subset 1: Subset 2:
[Season < Summer?] [Facility Size > Large?]
/ \ / \
[...] [...] [...] [...]
Solution: Combine many trees into an ensemble
“The wisdom of crowds”
Two main approaches:
Tree 1: 650 Tree 2: 620 Tree 3: 680 ... Tree B: 640
↘ ↓ ↙
Final Prediction: 648
Two sources of randomness:
| Randomness | How | Effect |
|---|---|---|
| Bootstrap sampling | Each tree sees ~63% of data | Different data perspectives |
| Feature subsampling | Random m features per split | Decorrelated trees |
Result:
| Parameter | What it controls | Typical values |
|---|---|---|
| n_estimators | Number of trees | 100-500 |
| max_depth | Depth of each tree | None (full) or limited |
| max_features | Features per split | sqrt(p) for classification, p/3 for regression |
| min_samples_leaf | Min samples in leaf | 1-5 |
Good news: Random Forests work well out-of-the-box with defaults!
Built-in validation:
Learn sequentially, each tree corrects previous errors
Iteration 1: Predict mean Error: Large
Iteration 2: Predict mean + tree₁ Error: Medium
Iteration 3: Predict mean + tree₁ + tree₂ Error: Smaller
...
Iteration B: Σ trees Error: Small
Each new tree focuses on the residuals (mistakes) of the current model
Learning rate (η): How much each tree contributes
| Parameter | What it controls | Typical values |
|---|---|---|
| n_estimators | Number of boosting rounds | 100-1000 |
| learning_rate | Step size (η) | 0.01-0.3 |
| max_depth | Depth of each tree | 3-10 (shallow) |
| min_samples_leaf | Min samples in leaf | 1-20 |
| subsample | Fraction of data per tree | 0.5-1.0 |
Trade-off: More trees + lower learning rate = better but slower
| Library | Strengths | When to use |
|---|---|---|
| XGBoost | Fast, regularization built-in | Production, competitions |
| LightGBM | Very fast, handles large data | Big datasets |
| CatBoost | Handles categorical features | Mixed data types |
| sklearn GradientBoosting | Simple, educational | Learning, small data |
XGBoost and LightGBM are current state-of-the-art for tabular data
| Aspect | Random Forest | Gradient Boosting |
|---|---|---|
| Training | Parallel (fast) | Sequential (slower) |
| Trees | Independent | Build on each other |
| Overfitting risk | Lower | Higher (needs tuning) |
| Out-of-the-box | Often good | Needs more tuning |
| State-of-art | Good | Often best |
| Interpretability | Feature importance | Feature importance |
Practical advice: Start with Random Forest, try Gradient Boosting if you need better
Both ensembles provide feature importance scores:
Methods:
| Method | How it works |
|---|---|
| Mean Decrease in Impurity | Average reduction in node impurity across trees |
| Permutation Importance | Drop in accuracy when feature is shuffled |
| Feature | Importance |
|---|---|
| Lag-1 Demand | 0.35 |
| Facility Size | 0.18 |
| Season | 0.12 |
| Distance to Warehouse | 0.08 |
| … | … |
┌─────────────────────────────┐
│ What's your data like? │
└─────────────────────────────┘
│
┌──────────────────┼──────────────────┐
│ │ │
Linear? Non-linear? High-dimensional?
│ │ │
▼ ▼ ▼
LASSO/Ridge Tree methods LASSO/Elastic Net
│
┌─────────┴─────────┐
│ │
Need speed? Need accuracy?
│ │
▼ ▼
Random Forest Gradient Boosting
Start simple, add complexity only if needed
Your ML models will:
Days 3-4 ABM will use these as inputs:
ML Predictions → ABM Simulation
↓ ↓
Demand forecasts → Inventory decisions
Risk scores → Prioritization
Feature importance → What-if scenarios
Roe et al. (2025) applied ML to predict drug shortages in South Korea:
| Task | Performance |
|---|---|
| Duration prediction | 62% accuracy |
| Cause classification | >70% F1 |
Top features: Shortage frequency, import status, alternatives
Similar approach to our supply chain forecasting
Decision trees capture nonlinearities and interactions automatically
Trees alone are unstable and prone to overfitting
Random Forest: Average many independent trees → stable predictions
Gradient Boosting: Sequential trees that learn from mistakes → often best accuracy
Feature importance helps understand what drives predictions
Start with RF, try Gradient Boosting if you need more
What nonlinear patterns might exist in medication demand?
Which features might interact in ways linear models miss?
How could feature importance inform supply chain decisions?
Apply everything to demand forecasting:
WISE Workshop | Data Sciences for Modeling & HTA