series
Financial machine learning from zero
A beginner-friendly series on machine learning in finance, built around the problems banks actually run models on: credit scoring, fraud detection, and anti-money-laundering analytics, with market prediction as a supporting track. Every part with code comes with a runnable companion folder. No GPU needed.
- for
- People who know some Python and have never trained a model on financial data.
- published
- 2 parts · 49 min of reading
- planned
- 5 more
- code
- github.com/prashant-fintech/financial-ml-from-zero ↗
parts
- 01
The vocabulary, the traps, and the metrics that matter
The first post in a beginner-friendly series on machine learning in finance, built around the problems banks actually run models on: credit scoring, fraud detection, and anti-money-laundering analytics, with market prediction as a supporting track. No code yet. Instead, the things I wish every newcomer knew before training a model on financial data: why it breaks the textbook assumptions, the vocabulary in every model notebook, the mistakes that make models look brilliant in development and fail in production, and a reference table of the metrics that matter, with which direction is good for each.
22 min readcode ↗
- 02
Tensors, time-ordered batching, and why leakage hides in .shift()
The second post in the financial machine learning series, and the first with code. It turns a Freddie Mac-style mortgage panel into PyTorch tensors one named step at a time, then breaks the pipeline on purpose with eight one-line mistakes and measures each one. Some push validation PR-AUC from 0.31 to 0.96. Others barely move it, which is worse, because nothing looks wrong. It ends with the checks that catch every one of them before a reviewer does.
27 min readcode ↗
- 03
A first probability-of-default baselineplanned
Logistic regression in PyTorch on the same tensors, a naive benchmark to beat, a loss that handles class imbalance, and an honest report including calibration. The test split gets used, once.
- 04
Purged walk-forward validationplanned
The splitting scheme every later post uses, with the purge and embargo explained properly.
- ··
Fraud detection with late-arriving labelsplanned
Training and evaluating when a fraud label only exists once a customer notices and disputes.
- ··
The anomaly layer of an AML pipelineplanned
How to measure it when almost nothing is labelled.
- ··
A short market trackplanned
A return-prediction baseline, and the ranking and strategy metrics applied honestly.
Follow new parts via RSS.