Build it yourself
ML Models: How They Work and How to Implement Them
Pick a model to see the idea in one picture, the questions interviewers ask about it, and coding problems that have you write it from scratch.
Classic machine learning
- Linear regressionFit a straight line that predicts a number.6 to implement, project
- Ridge and lassoShrink weights so the model stops chasing noise.3 to implement
- Logistic regressionTurn a weighted score into a probability.4 to implement, project
- Decision treeAsk a chain of yes or no questions about the data.6 to implement, project
- Random forestLet many slightly different trees vote.3 to implement, project
- Gradient boostingAdd small trees that fix the last round of mistakes.4 to implement
- K-meansGroup points around a few moving centers.9 to implement
- K-nearest neighborsPredict from the examples that look most similar.2 to implement
- Naive BayesCombine simple word or feature odds with Bayes rule.3 to implement
- Support vector machineFind the boundary with the widest margin.5 to implement, project
- PCAKeep the directions that carry the most variation.6 to implement
- Mixture models and EMExplain the data as several overlapping groups.3 to implement
Neural networks
- Multilayer perceptronStack layers of simple units and train them together.4 to implement, project
- OptimizersChoose how each training step moves the weights.5 to implement
- Dropout and normalizationKeep deep training stable and honest.5 to implement
- Convolutional networkSlide small filters across an image.9 to implement
- Recurrent networkRead a sequence one step at a time with memory.2 to implement
- LSTM and GRUAdd gates so the memory lasts longer.3 to implement
- Autoencoder and VAECompress data, then learn to rebuild it.7 to implement
- GANTrain a maker against a critic.1 to implement
- Graph neural networkPass messages between connected nodes.4 to implement
- Diffusion modelLearn to remove noise a little at a time.12 to implement
Language models
- Word embeddingsPlace words so similar meanings sit close together.1 to implement
- TokenizerSplit text into the pieces a model reads.6 to implement
- AttentionLet each word look at the words that matter.12 to implement
- TransformerStack attention blocks to read a whole sequence.12 to implement
- GPTBuild a small model that writes the next token.8 to implement
- Fast inferenceMake a trained model answer quickly and cheaply.12 to implement
- Retrieval and RAGFind the right text, then let the model use it.2 to implement
Decisions and ranking
- BanditsBalance trying new options with using the best one.6 to implement, project
- Q-learning and DQNLearn the value of each action from experience.9 to implement
- Policy gradientDirectly nudge the chance of better actions.11 to implement
- RecommendersFind what each person is likely to want next.1 to implement