Day 2 | WISE Workshop — Addis Ababa 2026
2026-02-03
For supply chain forecasting: We’ll focus on LASSO, Random Forests, and Gradient Boosting
Every model class has its own form of regularization:
| Function Class | Regularization Parameters |
|---|---|
| Linear | LASSO (L1), Ridge (L2), Elastic Net |
| Decision Trees | Depth, leaves, leaf size, info gain |
| Random Forest | # trees, features per split, sample sizes |
| Gradient Boosting | # trees, learning rate, depth, regularization |
Cross-cutting insight: Regularization always restricts model capacity to prevent memorizing training data and encourage generalization.
\[\hat{y} = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + ... + \beta_p x_p\]
Problem with OLS in high dimensions:
Solution: Add a penalty to constrain coefficients
\[\min_\beta \sum_{i=1}^n (y_i - X_i\beta)^2 + \lambda \sum_{j=1}^p \beta_j^2\]
\[\min_\beta \sum_{i=1}^n (y_i - X_i\beta)^2 + \lambda \sum_{j=1}^p |\beta_j|\]
λ increasing →
Feature 1: ═══════════════════════════■──────────▶ 0
Feature 2: ═════════════════■──────────────────────▶ 0
Feature 3: ═══════■────────────────────────────────▶ 0
Feature 4: ═══════════════════════════════════■────▶ 0
■ = coefficient becomes exactly zero
Advantages:
Limitations:
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, find the split that best separates the data:
For regression (predicting demand): - Minimize within-node variance (MSE)
For classification (predicting stockout: yes/no): - Maximize information gain (reduce entropy) - Or: minimize Gini impurity
Trees automatically capture non-linearities and interactions!
| Parameter | What it controls |
|---|---|
| Max depth | How deep the tree can grow |
| Min samples per leaf | Minimum observations in each leaf |
| Min samples to split | Minimum observations to create a split |
| Max features | How many features to consider at each split |
Shallow trees: High bias, low variance (underfit)
Deep trees: Low bias, high variance (overfit)
Solution: Combine many trees! (Ensembles)
Key idea: Combine many diverse trees to reduce variance
Algorithm:
Tree 1: 650 Tree 2: 620 Tree 3: 680 ... Tree B: 640
↘ ↓ ↙
Final Prediction: 648
Two sources of randomness:
Result:
Key idea: Build trees sequentially, each correcting previous errors
Algorithm:
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
| Parameter | What it controls | Typical values |
|---|---|---|
| n_estimators | Number of trees | 100-1000 |
| learning_rate | Step size for updates | 0.01-0.3 |
| max_depth | Depth of each tree | 3-10 |
| min_samples_leaf | Min observations per leaf | 1-20 |
| subsample | Fraction of data per tree | 0.5-1.0 |
Trade-off: More trees + lower learning rate = better but slower
| 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 |
Popular implementations:
┌─────────────────────────────┐
│ What's your data like? │
└─────────────────────────────┘
│
┌──────────────────┼──────────────────┐
│ │ │
Linear? Non-linear? High-dimensional?
│ │ │
▼ ▼ ▼
Linear/LASSO Tree methods LASSO/Elastic Net
│
┌─────────┴─────────┐
│ │
Need speed? Need accuracy?
│ │
▼ ▼
Random Forest Gradient Boosting
Start simple, add complexity only if needed!
Time for hands-on: Forecasting demand with these algorithms.
WISE Workshop | Data Sciences for Modeling & HTA