Cheat sheet · Specialise
Machine learning cheat sheet (General machine learning)
Opens with creditsA quick-revision companion to the Machine learning roadmap: Python for data, the maths you need, data preparation, classical models, evaluation, neural networks, deep learning and MLOps, with short NumPy, pandas, scikit-learn and PyTorch snippets. Skim a chapter before an exam, a project or a technical conversation, and follow the links for depth.
Chapters
8 chapters · 69 concepts
1Python for dataThe everyday toolkit: NumPy arrays and vectorised maths, pandas for tables, notebooks for exploration, charts, and the file formats data arrives in.8 concepts
- 1NumPy arraysN-dimensional arrays holding one data type, with a
shapeand adtype, stored in contiguous memory and operated on by fast compiled code. - 2Vectorisation and broadcastingVectorisation applies an operation to whole arrays at once instead of looping in Python.
- 3pandas DataFramesA table of labelled columns, each a typed Series, with a row index.
- 4groupby, merge and reshaping
groupbysplits rows into groups and aggregates each one;mergejoins tables on keys like SQL;pivot_tableandmeltswitch between wide and long formats. - 5Jupyter notebooksInteractive documents that mix code cells, output, charts and notes, run by a kernel that keeps variables alive between cells.
- 6Matplotlib chartsThe base plotting library for Python; seaborn adds statistical charts on top.
- 7CSV, JSON and ParquetCSV is plain-text rows with no types; JSON holds nested records, often one per line (JSON Lines); Parquet is a compressed, columnar binary format that stores…
- 8Plain Python for data workBefore NumPy and pandas come lists, dicts, comprehensions, functions, f-strings and reading files with
with open(...).
8 in this chapterOpen this chapter- 1NumPy arraysN-dimensional arrays holding one data type, with a
2The maths you needJust enough linear algebra, calculus, probability and statistics to understand what models compute, how they learn and whether a result is real.9 concepts
- 1Vectors, matrices and the dot productA vector is an ordered list of numbers, such as one row of features; a matrix is a grid, such as a dataset with n rows and d columns.
- 2Matrix multiplication and shapesMultiplying an (n, k) matrix by a (k, m) matrix gives an (n, m) matrix, where each entry is the dot product of a row and a column.
- 3Derivatives and gradientsA derivative is the rate at which a function changes as its input changes.
- 4Gradient descentRepeatedly moving the parameters a small step against the gradient:
w = w - lr * grad. - 5The chain ruleThe derivative of a function of a function is the product of their derivatives: if y = f(g(x)), then dy/dx = f'(g(x)) times g'(x).
- 6Probability and Bayes' theoremConditional probability P(A|B) is the chance of A given that B happened.
- 7Probability distributionsDescriptions of how likely each value is: normal (the bell curve, set by mean and standard deviation), Bernoulli and binomial (yes or no outcomes), Poisson…
- 8Descriptive statisticsNumbers that summarise data: mean and median for the centre, variance and standard deviation for spread, percentiles for shape, and correlation for the linear…
- 9Hypothesis tests and p-valuesA test asks how surprising the data would be if there were no real effect (the null hypothesis); the p-value is that probability.
9 in this chapterOpen this chapter- Data cleaning and feature engineeringTurning raw data into model-ready features without fooling yourself: exploration, missing values, outliers, encoding, scaling, pipelines and imbalanced classes.9 conceptsOpens with credits
- Classical machine learningThe models that still win on most tabular problems: linear and logistic regression, regularisation, trees, forests and boosting, plus clustering and PCA for data without labels.10 conceptsOpens with credits
- Evaluating and tuning modelsGetting an honest estimate of how a model will do on new data: splits, cross-validation, leakage, the right metrics, baselines, tuning and explaining what the model relies on.9 conceptsOpens with credits
- Neural networks and trainingHow neural networks compute and learn: layers and activations, tensors and autograd, losses, backpropagation, optimisers, the PyTorch training loop and how to read loss curves.9 conceptsOpens with credits
- Deep learning architecturesThe architectures behind modern vision and language models: embeddings, CNNs, recurrent networks, attention and transformers, and how to adapt pretrained models to your task.7 conceptsOpens with credits
- Production ML and MLOpsTaking a model from notebook to a reliable service: tracking and versioning, serving, avoiding training-serving skew, CI/CD, monitoring for drift and deciding when to retrain.8 conceptsOpens with credits
- 9Glossary, A to ZEvery concept in the sheet and the smaller terms it uses, in one list.213 terms
About this sheet
Data, models, deep learning.
Related on Sefism
Picked from the other libraries by shared topics.
Roadmaps
See allBest practices
See allChecklists
See allProject structures
See all- Machine learning project project structureFor students and analysts whose model works in a notebook and now needs to be reproducible, reviewable, served and watched. It starts from the Cookiecutter Data Science v2 layout (immutable raw data, numbered notebooks, a real Python package) and grows into versioned data with DVC, typed parameters, data validation with pandera, experiment tracking and a model registry with MLflow, a FastAPI prediction service, drift monitoring and, for a team, scheduled retraining, model cards, fairness checks and shadow deployment.
- MLOps pipeline project structureFor engineers who can train a model and now need the training to be a pipeline anyone can rerun, review and release. A uv workspace holds the pipeline package (prepare, validate, featurize, train, evaluate, register steps run by DVC), a small shared feature package, and a separate FastAPI prediction service that loads models from the MLflow registry by alias. It grows into CI that reproduces the pipeline on pull requests, scheduled retraining, approved promotion and monitoring.
Career questions
See all- My machine learning projects never leave a Jupyter notebook. How do I learn to deploy a model?Move the notebook code into a small Python package, save the whole preprocessing and model pipeline, put it behind a FastAPI endpoint in a Docker container and deploy it. Then add what makes it production: tracked runs, a registry, a test in CI, prediction logging and a drift check. Start with batch predictions if you can.
- Should I learn AI and machine learning, or become a strong software engineer first?For most people, become a solid software engineer first, then add AI on top. Most AI jobs today are engineering jobs: building products around models, data pipelines and APIs. Research-heavy machine learning is a different path that needs strong maths and usually a postgraduate degree.
- How do I move into AI engineering, data science or DevOps?Pick the field by the work you want to do every day, not by the hype. Use what you already know as a bridge: developers usually reach AI engineering or DevOps fastest, analysts reach data science fastest, and a portfolio of one or two serious projects matters more than certificates.
Cheat sheets
See all- MLOps and LLMOps cheat sheetShip, serve and monitor models.
- PyTorch cheat sheetTensors, autograd, nn.Module, training loops, data loading, GPUs, mixed precision, torch.compile, DDP and export in PyTorch.
- Hugging Face cheat sheetThe Hub, transformers, tokenisers, datasets, fine-tuning, LoRA, quantisation, inference and embeddings with the Hugging Face libraries.
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.
- 1:1 Mentorship
- Fresh Graduate Mentorship
- Career Guidance
Brand deals, promos and partnerships: tauseeffayyaz@gmail.com