This PDF is a library, not a tutorial — minimal, runnable code for every major model across supervised, unsupervised, and reinforcement learning. That's exactly why it's easy to misuse: it's tempting to just read through it like an article. Here's how to actually use it so the models become something you understand, not just something you've seen.
What it's for (and what it isn't)
It isn't meant to teach you the theory behind each model — pair it with proper notes or a course for that. What it's built for is closing the gap between "I understand the concept" and "I can actually write the code from a mostly-blank file." That gap is where most self-taught learners quietly get stuck.
The right way to work through it
- Pick one model at a time, never the whole PDF in one sitting. Start wherever your current project needs — if you're doing the credit risk project, start with Logistic Regression, Random Forest, and XGBoost, not Q-Learning.
- Get a small public dataset before opening the code. The guide assumes you plug in your own
X,y, ordf. Use something small and known — Iris, Titanic, Wine, or MNIST — so you can sanity-check the output against something you already understand. - Type the code by hand the first time, don't copy-paste. This feels slow and is exactly the point — copy-pasting lets your eyes skip details your fingers would have caught, like why
stratify=ymatters in a classification split. - Break it on purpose. Change
test_size, removeStandardScaler, swap the metric. Watch what changes. This is how you learn what each line is actually doing instead of memorizing it. - Write one sentence per model in your own words — "Random Forest reduces variance by averaging many trees trained on random subsets of data and features." If you can't write that sentence after running the code, re-read the theory before moving to the next model.
- Re-run each model on a second, different dataset a week later without looking at the PDF. This is the actual test of whether it stuck.
Run each one end-to-end on a small public dataset first — that's the fastest way to actually internalize how each model behaves.
A suggested order if you're starting from zero
- Week 1 — Regression: Linear → Polynomial → Ridge/Lasso → Decision Tree Regressor.
- Week 2 — Classification: Logistic Regression → Decision Tree → Random Forest → XGBoost. These four alone cover most real-world tabular ML interview and project questions.
- Week 3 — Unsupervised: K-Means → PCA → DBSCAN. Good preparation for customer segmentation and anomaly detection case studies.
- Week 4 — Reinforcement Learning (optional): Q-Learning first — it's the simplest to reason about before moving to DQN or Actor-Critic.
Setup, once, before you start
Install everything from the setup notes section up front — scikit-learn, pandas, numpy, matplotlib, and whichever of xgboost, tensorflow, torch, or gymnasium you'll actually need for that week — so you're not fighting installs mid-session.
Get the full code library across all four learning types.
Download the PDF →