Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Cheat sheet · AI & Machine LearningFree

Sefism Machine Learning Cheat Sheet

A quick-revision companion to the Machine learning roadmap: Python for data, the maths you need, data cleaning and features, classical models, evaluation and tuning, neural networks, deep learning architectures and production ML, with NumPy, pandas, scikit-learn and PyTorch snippets. General, Computer vision and NLP editions match your roadmap focus, the last two adding a practical chapter each. Use it after each stage and before an exam, a project or a technical conversation.

Chapters

8 (9 in vision and NLP)

Sefism · Oct 2026

Concepts

69 to 79 per edition

Sefism · Oct 2026

Code snippets

45

Sefism · Oct 2026

Editions

3 (General, vision, NLP)

Sefism · Oct 2026

Rules of thumb

9 to 10 per edition

Sefism · Oct 2026

Format

Cheat sheet

Topic

AI & Machine Learning

Provider

Sefism

Time needed

Reference

Level

Beginner

Access

Free

What this cheat sheet is

The Machine learning cheat sheet is the quick-revision companion to Sefism's Machine learning roadmap. It covers Python for data, the maths you need, data preparation, classical models, evaluation, neural networks, deep learning architectures and production ML, with short NumPy, pandas, scikit-learn and PyTorch snippets.

It leans on code: 45 of its concepts include a snippet. Every concept says what it is and why it matters, and most add the classic mistake. Skim a chapter before an exam, a project or a technical conversation, and follow the linked resources when you need depth.

Three editions

The sheet follows the focus you chose on the roadmap:

  • General machine learning: 8 chapters and 69 concepts, from Python for data to production ML.
  • Computer vision: adds a Computer vision in practice chapter, for 9 chapters and 79 concepts.
  • NLP: adds an NLP in practice chapter, for 9 chapters and 79 concepts.

Each edition is public at its own address.

Chapter by chapter

1. Python for data (8 concepts)

NumPy arrays, vectorisation and broadcasting, pandas DataFrames, groupby, merge and reshaping, Jupyter notebooks, Matplotlib charts, CSV, JSON and Parquet, and plain Python for data work. Nearly every concept has a snippet.

2. The maths you need (9 concepts)

Vectors, matrices and the dot product, matrix multiplication and shapes, derivatives and gradients, gradient descent (with code), the chain rule, probability and Bayes' theorem, probability distributions, descriptive statistics, and hypothesis tests and p-values. Just enough to understand what models compute, how they learn and whether a result is real.

3. Data cleaning and feature engineering (9 concepts)

Exploratory data analysis, missing values, outliers, encoding categorical data, scaling and normalisation, pipelines and ColumnTransformer, feature creation, feature selection and class imbalance.

4. Classical machine learning (10 concepts)

Supervised versus unsupervised learning, linear and logistic regression, bias, variance and overfitting, L1 and L2 regularisation, decision trees, random forests, gradient boosting, k-means clustering and principal component analysis, most with a scikit-learn snippet.

5. Evaluating and tuning models (9 concepts)

Train, validation and test splits, cross-validation, data leakage, precision, recall and F1, ROC-AUC and PR-AUC, regression metrics, baselines, hyperparameter search and feature importance.

6. Neural networks and training (9 concepts)

Neural networks and activations, tensors and autograd, loss functions, backpropagation, SGD and AdamW, the PyTorch training loop, dropout, weight decay and early stopping, diagnosing training with loss curves, and batch and layer normalisation.

7. Deep learning architectures (7 concepts)

Embeddings, convolutional neural networks, recurrent networks, attention, transformers, transfer learning and fine-tuning, and parameter-efficient fine-tuning.

Computer vision in practice (10 concepts, vision edition)

Images as arrays, OpenCV image processing, image labelling and annotation formats, data augmentation, object detection, IoU and non-maximum suppression, mean average precision, image segmentation, vision transformers, and exporting vision models for devices.

NLP in practice (10 concepts, NLP edition)

Text in Python and normalisation, subword tokenisation, bag of words and TF-IDF, labelling text data, sentence embeddings and semantic search, Hugging Face pipelines and Auto classes, fine-tuning a text classifier, named entity recognition, evaluating NLP models, and prompting an LLM versus fine-tuning.

Production ML and MLOps (8 concepts)

Experiment tracking, data and model versioning, batch versus real-time serving, training-serving skew, CI/CD for ML, data and concept drift, retraining strategy, and ML system design.

Rules of thumb and glossary

Nine shared rules of thumb come with every edition, and the vision and NLP editions add one each. They include: start with a baseline and a clean split; fit every preprocessing step on training data only; if a score looks too good, hunt for leakage; choose the metric from what each mistake costs; try gradient boosting first on tabular data and a pretrained model for images, text and audio; print shapes at every step; overfit one small batch before a long run; and log the data version, commit, parameters and metrics of every run.

The A to Z glossary adds 144 to 148 smaller terms, depending on the edition, to the sheet's concepts.

How to use it with the roadmap

  • After each stage: read the matching chapter and explain each concept without notes. The roadmap's deep learning stage maps to chapters 6 and 7.
  • Before an exam or viva: chapters 2, 4 and 5 hold the core definitions, such as bias and variance, regularisation and precision versus recall.
  • While training: keep chapter 6 open for loss curves and regularisation, and chapter 5 for leakage, which is the first thing to suspect when validation looks too good.
  • Before a technical conversation: the production chapter covers serving, drift and retraining, which is where many ML roles test whether your model would survive outside a notebook.

How it works on Sefism

The public page at /cheatsheets/machine-learning/ shows every chapter's title and introduction, with the first chapters open to read in full. Everything on Sefism is free to learn from. Keeping a cheat sheet uses credits; new members get starting credits, and if you are learning seriously and run out you can ask for more. Keeping it opens every chapter in the member area.

Following the Machine learning roadmap also unlocks this sheet, and your first roadmap is free. Topics in the roadmap link to the concepts here that cover them.

Related on Sefism

Frequently asked questions

Which edition should I read? The one matching your roadmap focus. If you have not chosen, the general edition covers everything except the vision and NLP practice chapters.

Is the code for TensorFlow or PyTorch? PyTorch for neural networks, with NumPy, pandas and scikit-learn for the rest, matching the roadmap.

Can I use it without following the roadmap? Yes. Each chapter stands on its own as a revision aid, and the links point to the resources that teach each area properly.

machine learningaipython

Ready to start?

Opens on Sefism in a new tab.

Open the cheat sheet
Link broken or out of date?

Report a problem

With "Sefism Machine Learning Cheat Sheet". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.