Handwritten Machine Learning Notes
These eight guides expand my six handwritten PDFs into worked explanations. Each begins with visible data, follows the calculation, and then connects it to the general formula. The original PDFs and selected page scans sit alongside the explanations.
Follow the ideas from estimation to prediction
Start with a coin to understand likelihood and Bayesian updating. Carry the same ideas into linear regression, then compare two ways to build a classifier. Then group observations with K-means, study PCA and LDA projections separately, and use LDA to classify a new point.
Five coin tosses take us from likelihood to a posterior distribution and the next-toss prediction.
Fit three students' scores, derive squared error, and see how Gaussian and Laplace priors give ridge and lasso penalties.
Follow the notes from probability estimation to feature models, smoothing, and the linear and sigmoid decision rules.
Turn scores into probabilities and work through cross-entropy, gradients, and one training update.
Group six points, move their centers, and calculate elbow, silhouette, and Dunn scores.
Calculate covariance, principal directions, explained variance, and reconstruction from four visible points.
Use the original ten-point dataset to calculate class means, within-class scatter, and a Fisher LDA projection.
Fit class means, a shared covariance, and priors from eight rows, then calculate class scores and a posterior prediction.
Keep the data beside the calculation
The first four guides build on likelihood, but each repeats the data needed for its own example. The clustering and projection guides can be read independently. Basic algebra is enough to start; derivatives and matrix notation are introduced where they explain a calculation.
Each guide has a section called “From the handwritten notes.” Open it to compare a selected original page with the expanded explanation. Where the handwritten derivation skips an intermediate step or uses a different convention, the surrounding text spells out the calculation. All essential formulas are also written as searchable text.
The six original PDFs
| Original notes | Pages | Expanded guide |
|---|---|---|
| MLE.pdf | 6 | MLE, MAP, and prediction |
| Linear Regression.pdf | 3 | Linear regression |
| Naïve bayes.pdf | 8 | Naïve Bayes |
| Logistic Regression.pdf | 4 | Logistic regression |
| Clustering.pdf | 5 | K-means clustering |
| PCA and LDA.pdf | 6 | PCA, LDA projection, and LDA classification |
Reproduce the worked numbers
The companion Python script recreates the numerical examples and explanatory figures. It checks the hand calculations against numerical solvers and scikit-learn, including the original LDA projection and the new classification example. The small tables printed in each guide contain all the observations used.
python -m pip install -r requirements.txt
python calculations.py
Run these commands from this notes folder. The script writes the figures and numerical results into its assets directory. The original PDFs and their page scans are preserved separately.
Continue into the topic guides
For broader coverage, continue with linear regression, logistic regression, or dimensionality reduction. To explain an individual fitted prediction, follow the linear model explainability series.
The earlier decision-tree handwritten notes remain available in the decision-tree section.