8.2 Machine-Learning Methods

Key Takeaways

  • Machine learning emphasizes predictive performance and flexible function approximation; classical econometrics emphasizes identification, inference, and causal/parameter interpretation under explicit assumptions
  • Feature rescaling (standardization or min–max) prevents high-range variables from dominating distance- and gradient-based methods
  • Train / validation / test splits separate fitting, hyperparameter selection, and unbiased final evaluation—never tune on the test set
  • Underfitting misses signal (high bias); overfitting memorizes noise (high variance); regularization and validation curb overfitting
  • PCA compresses correlated features; K-means partitions unlabeled data; NLP turns text into features; learning paradigms include unsupervised, supervised, and reinforcement learning with Q-values for action values
Last updated: August 2026

Machine-Learning Methods

GARP’s QA–14 reading introduces machine learning (ML) as a family of algorithms that learn patterns from data to predict, classify, compress, or cluster—often with weaker structural assumptions than classical regression proofs, and with heavier emphasis on out-of-sample performance. For FRM, you need the vocabulary, the validation discipline, and the standard unsupervised tools (PCA, K-means), plus a clear map of learning paradigms including reinforcement learning and Q-values.

Machine Learning Versus Classical Econometrics

DimensionClassical econometricsTypical ML focus
Primary goalEstimate parameters β with interpretable meaning; test theoriesMinimize predictive loss on unseen data
Model classOften linear / low-dimensional parametricFlexible: trees, kernels, neural nets, ensembles
Success metricUnbiasedness, consistency, t/F tests, identificationCross-validated error, AUC, precision/recall
Overfitting controlParsimony, theory-driven specificationRegularization, validation, early stopping
CausalityCentral when designed for itNot automatic—predictive fit ≠ causal effect

Econometrics asks: “Is β the causal effect of X on Y under these assumptions?” ML asks: “Given features x, how well can we predict y tomorrow?” A gradient-boosted default model may beat logistic regression on AUC yet offer messier coefficient stories. Risk governance still needs interpretability, stability, and challenge frameworks—even when the champion model is an ensemble.

Worked contrast

Predicting next-month credit rating downgrades: a logistic regression with five CAMELS-style ratios yields odds ratios a committee can debate. A random forest with 200 engineered features may lift recall by 8 percentage points. FRM stance: know both the predictive gain and the governance cost; do not confuse variable importance plots with identified causal effects.

Rescaling Features

Many algorithms are sensitive to feature scale. Distance-based methods (KNN, K-means) and regularized linear models treat a variable measured in dollars (range in millions) as “larger” than a ratio on [0, 1] unless you rescale.

Common transforms:

  1. Standardization (z-score): x′ = (x − x̄) / s. Mean 0, SD 1 in the training sample.
  2. Min–max scaling: x′ = (x − xmin) / (xmax − xmin) maps to [0, 1] (or another band).
  3. Robust scaling: center at median, scale by IQR—less wrecked by outliers.

Critical rule: fit scalers on the training set only; apply the same centers/scales to validation and test. Using test-set means leaks information and flatters metrics.

Tree-based methods (CART, random forests, plain gradient boosting on trees) are largely invariant to monotone rescaling of individual features because splits threshold a single variable at a time. Still, rescaling remains good hygiene when mixing model classes in one pipeline.

Worked scaling example

Features: income (mean 80,000, SD 20,000) and leverage ratio (mean 0.30, SD 0.10). Raw Euclidean distance is dominated by income. After z-scoring, a 1-SD move in either feature contributes comparably—so K-means clusters reflect both dimensions.

Train, Validation, and Test Sets

Split data into three roles:

  • Training set: estimate parameters / split rules / weights.
  • Validation set: choose hyperparameters (depth, penalty λ, number of clusters to report, embedding dimension) and pick among model families.
  • Test set: final, untouched estimate of generalization performance.

If you only have enough data for two piles, use cross-validation on the train+valid portion (e.g., K-fold), then a locked test set. In time series and trading signals, use purged or walk-forward splits so future information does not leak into past training windows.

SplitUsed forMay you tune on it?
TrainFit modelYes (parameters)
ValidationHyperparameters / model choiceYes
TestFinal reportNo

Worked split sketch

n = 10,000 loans. Train 70% / valid 15% / test 15%. Try λ ∈ {0.01, 0.1, 1} on train, score AUC on valid, pick λ = 0.1. Only once, score the chosen model on test AUC = 0.74. That 0.74 is the honest headline—not the best validation AUC among dozens of silent retries on the test set.

Underfitting and Overfitting

Underfitting (high bias): model too rigid—e.g., linear classifier on a clearly nonlinear boundary. Train and validation errors both high.

Overfitting (high variance): model too flexible—e.g., a deep tree that isolates every training default. Train error near zero; validation/test error high.

The bias–variance trade-off: as flexibility rises, bias tends to fall and variance tends to rise. Optimal complexity minimizes validation error, not training error.

Remedies for overfitting: fewer features, stronger ridge/LASSO penalties, shallower trees, dropout/early stopping in nets, more data, and ensembling. Remedies for underfitting: richer features, more flexible models, weaker penalties.

Worked error pattern

ModelTrain MSEValid MSEDiagnosis
Degree-1 polynomial12.012.5Underfit
Degree-34.04.4Good sweet spot
Degree-200.29.8Overfit

Principal Component Analysis (PCA)

PCA finds orthogonal directions (principal components) that capture maximal variance in a feature matrix. Often features are first centered (and scaled). The first PC is the linear combination with largest variance; each next PC maximizes remaining variance subject to orthogonality.

Uses in risk and quant work:

  • Compress many correlated yield-curve or equity-factor moves into a few PCs (level, slope, curvature stories).
  • Reduce dimension before clustering or regression when p is large.
  • Noise filtering: keep components that explain, say, 90% of variance; discard the rest (judgment required).

PCA is unsupervised: it does not use a Y label. High variance ≠ predictive of default. A PC that explains volatility of irrelevant features can be useless for the prediction task.

Worked variance sketch

Five standardized macro features; eigenvalues (variances of PCs): 2.4, 1.3, 0.7, 0.4, 0.2 (sum = 5). First two PCs explain (2.4+1.3)/5 = 74% of total variance. A risk dashboard might track scores on PC1 and PC2 instead of five raw series—if those directions are stable and interpretable.

K-Means Clustering

K-means partitions unlabeled observations into K clusters by iteratively:

  1. Assign each point to the nearest centroid (usually Euclidean distance).
  2. Recompute each centroid as the mean of assigned points.

Until assignments stabilize (or iteration cap). Objective: minimize within-cluster sum of squared distances.

Practical issues: choose K (elbow plot, silhouette, business constraint); sensitive to scale (rescale first); sensitive to outliers; finds spherical-ish clusters; random init can yield different local minima (run multi-start).

Risk examples: cluster counterparties by risk-factor exposures; cluster branches by operational-loss profiles; segment clients for differentiated monitoring—not automatic causal groups.

NLP Basics for Risk and Finance

Natural language processing (NLP) converts text (filings, news, complaints, chat logs) into features models can use.

Building blocks FRM-level readings emphasize:

  • Tokenization: split text into words/subwords.
  • Cleaning: lowercasing, handling punctuation; domain-specific tickers and negation (“not breached”).
  • Bag-of-words / TF–IDF: counts or weighted counts of terms; simple, strong baselines.
  • Sentiment and topic features: lexicon scores or topic-model loadings as inputs to credit/market models.
  • Embeddings: dense vectors (word2vec-style or modern encoders) capturing semantic similarity.

Governance note: NLP labels and scraped news are noisy; leakage and look-ahead in timestamp alignment are common failure modes in backtests.

Unsupervised, Supervised, and Reinforcement Learning

Unsupervised learning: only X, no labels Y. Goals: compress (PCA), cluster (K-means), density estimate, anomaly flags. “Find structure.”

Supervised learning: data pairs (xᵢ, yᵢ). Goals: regression (continuous y) or classification (categorical y). “Predict labels.”

Reinforcement learning (RL): an agent interacts with an environment, observes states, takes actions, and receives rewards. The goal is to learn a policy that maximizes expected cumulative reward (possibly discounted).

ParadigmDataTypical output
UnsupervisedX onlyClusters, PCs, anomalies
Supervised(X, Y)Predictor ŷ(x)
ReinforcementStates, actions, rewardsPolicy π(a

Q-values

In RL, an action-value function (Q-function) assigns to each state–action pair the expected return from taking action a in state s, then following a policy thereafter:

Q(s, a) = E[ cumulative reward | S₀ = s, A₀ = a ]

(with discounting as specified). Q-learning is a model-free method that updates Q-estimates from observed transitions without requiring a full environment model. A greedy policy picks a = argmax_a Q(s, a).

Finance analogies (conceptual, not a claim that desks “solve” markets with textbook Q-learning): order-routing or inventory agents receive rewards tied to shortfall and risk limits; the Q-value ranks actions (aggressive vs passive) in a market-state description. Exam focus: Q(s,a) is the value of an action in a state, not a supervised class probability and not a PCA loading.

Putting QA–14 Together

Start with the goal (predict, cluster, compress, or control via rewards). Rescale when distances or penalties care about units. Split data so tuning never touches the final test. Watch the train-versus-valid gap for overfit. Use PCA and K-means when labels are absent; use supervised models when labels exist; reserve RL language for sequential decisions with rewards—and define Q-values as state–action values. That taxonomy is what FRM items probe more than any single library call.

Loading diagram...
Learning Paradigms and Validation Flow
Illustrative Validation MSE vs Polynomial Degree
Test Your Knowledge

Relative to classical econometrics, machine learning applications in risk most characteristically prioritize:

A
B
C
D
Test Your Knowledge

A team standardizes features using means and SDs computed from the test set before training. This practice is problematic because it:

A
B
C
D
Test Your Knowledge

Which pattern most clearly indicates overfitting?

A
B
C
D
Test Your Knowledge

In reinforcement learning, the Q-value Q(s, a) represents:

A
B
C
D