Machine Learning with Equity Research Projects

Click here to start the web book.



I built Machine Learning A to Z because most ML courses teach the calling of libraries, not the craft of machine learning. This is the course I wanted when I was learning: every algorithm taught the way a professional actually needs it — definition, intuition, mathematics, assumptions, a worked example computed by hand, a real Python implementation, and an honest evaluation of the result. It is a complete, self-contained web book: 10 parts, 33 chapters, 29 algorithms, 1,000 quiz questions, and a growing track of applied equity-research projects — all running in the browser from a static site, dark-mode first.

📖 Read the full book

Click here to start the web book.
No sign-up, no install. Start at Chapter 1 and read in order, or jump to any algorithm.

What makes it different

  1. Theory before code, always. Each chapter follows the same anatomy: what the method is, the intuition, the full mathematics with every symbol annotated, the assumptions and what breaks without them — and only then the implementation.
  2. Every example is worked by hand first. OLS by normal equations, a logistic posterior from a 9.2:1 odds ratio, entropy and information gain on a real split, backpropagation on a 2-2-1 network with exact gradients, Fisher’s discriminant on eight points, a convolution slid across a 5×5 grid, boosting rounds on four data points. If you can’t compute a small case by hand, you don’t understand it.
  3. Every number is real. Nothing on any page is invented. Each chapter’s dataset is actually loaded and run (scikit-learn, TensorFlow/Keras, statsmodels, XGBoost, NLTK), and the printed confusion matrices, learning curves and benchmark tables are the genuine outputs — including the unflattering ones.
  4. Honest evaluation is a theme, not a footnote. A dedicated chapter proves that the same model scores anywhere from 88% to 95% across ten random splits — then teaches cross-validation, grid search and the discipline of touching the test set exactly once. Simple baselines are allowed to win when they win.
  5. It ends like the job ends. The capstone runs one full professional pipeline — raw data to deployed model — and prices the business decision ($200 retention offers, $2,000 customers, a threshold sweep worth $610,800). Applied project lessons then carry the methods into equity research.

The course map

Part I — Foundations (Ch 1–3)

Machine-learning literacy and the train/validation/test contract; a statistics primer (distributions, sampling, correlation, the inference mindset); and the complete preprocessing toolbox — missing data, encoding, scaling, splitting, and the data-leakage rules that everything later depends on.

Part II — Regression (Ch 4–10)

Simple and multiple linear regression with the full assumption suite (linearity, multicollinearity via VIF, residual diagnostics); polynomial regression and the bias–variance trade-off; support vector, decision-tree and random-forest regression; closed by a dedicated evaluation chapter where six regressors compete on one benchmark — and the simple model wins.

Part III — Classification (Ch 11–18)

Logistic regression from log-odds to thresholds; K-nearest neighbours and the curse of dimensionality; SVMs and the kernel trick; Naive Bayes with a hand-computed posterior; tree and forest classifiers — then a metrics chapter that owns the hard questions: precision vs recall, ROC-AUC, class imbalance, cost-based thresholds and calibration, with an eight-model scoreboard on shared data.

Part IV — Clustering (Ch 19–20)

K-Means with elbow and silhouette on real mall-customer segmentation (five business-ready segments); hierarchical clustering and the dendrogram that reproduces them.

Part V — Association Rules (Ch 21–22)

Apriori and Eclat: support, confidence and lift derived numerically from real market baskets — including why lift, not confidence, finds the actionable rules.

Part VI — Reinforcement Learning (Ch 23–24)

The multi-armed bandit: exploration vs exploitation formalised, Upper Confidence Bound, and Thompson Sampling with Beta posteriors — the mathematics of “when should I stop gathering information?”

Part VII — Natural Language Processing (Ch 25)

Text as data: cleaning and stemming by hand, the bag-of-words matrix, TF-IDF with verified arithmetic, and Naive Bayes sentiment classification on 1,000 real reviews — plus an honest look at what transformers changed.

Part VIII — Deep Learning (Ch 26–27)

Neural networks from the single neuron (it is logistic regression) through backpropagation computed entirely by hand, to a real churn network on 10,000 customers; then CNNs — convolution and pooling by exact arithmetic, a real 813,217-parameter cat-dog classifier, and its genuinely overfit learning curve as the teaching moment.

Part IX — Dimensionality Reduction (Ch 28–30)

PCA with the eigendecomposition computed by hand (discarded eigenvalues are the compression error — proven); LDA as the supervised twin (Fisher’s criterion by hand, a perfect 36/36 on the wines); Kernel PCA bending the axes where the rings no linear method can separate — with the gamma dial turned until they snap apart.

Part X — Model Selection, Boosting & the Capstone (Ch 31–33)

k-fold cross-validation fold by fold (the same SVM swings 88–95% across splits; the fix is averaging 271/300 honest predictions); grid search and its six-way-tie lesson; XGBoost from residuals up (hand-boosted MSE 2.5 → 0.29, early stopping at round 107 of 1,000); and the capstone — one end-to-end pipeline from raw bank data to a deployed model with a money-denominated business case.

Applied Projects — ML in Equity Research (new track)

Full project lessons that weld the chapters into professional workflows on real market data. Project 1 (live): a decision tree that classifies stock momentum — every technical indicator taught as finance (RSI computed by hand, MACD, golden crosses, ATR), three genuine bugs found and fixed in the original template, and an honest 46%-vs-34% scoreboard that becomes a lesson in market efficiency. Random Forest and SVR projects are in production.

By the numbers

Parts / Chapters10 / 33 (+ applied projects)
Algorithms implemented29
Quiz questions1,000 (30 per chapter, answer keys verified)
Hand-worked examplesin every single chapter
Real datasetssalaries, startups, cancers, wines, social ads, mall customers, market baskets, restaurant reviews, bank churn, cat–dog photos, 8-stock market snapshot…
Stack100% static HTML/CSS/JS — dark-mode first, works offline, no tracking

Who it’s for

Students who want the why behind the API call; analysts and engineers moving from tutorials to practice; and instructors who want a reference where every claim can be checked against a run. Prerequisites: comfort with basic Python and high-school algebra — the statistics you need is Chapter 2.


The full book — all 33 chapters, the capstone and the applied projects — is free to read here: Click here to start the web book. . Start with Chapter 1, or skip straight to your algorithm.

Leave a Comment