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 Data Science Cheat Sheet

The revision companion to Sefism's data science roadmap: ten chapters on code for data, statistics and probability, SQL, cleaning and EDA, visualisation, machine learning, A/B testing, features and evaluation, messy real data and the first role. It comes in business, ML engineering and statistics-and-R editions with snippets in the matching language. Use it to pick the right test or metric and catch leakage or bias before it spoils a result.

Chapters

10

Sefism · Oct 2026

Concepts

76 (business edition)

Sefism · Oct 2026

Editions

3 (business, ML, R)

Sefism · Oct 2026

Rules of thumb

9 to 10 per edition

Sefism · Oct 2026

Glossary terms

58 plus every concept

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 data science cheat sheet is the revision companion to Sefism's Data science roadmap. It takes students and early-career engineers from the first DataFrame through statistics, SQL, experiments, models and a portfolio, one short entry at a time. Use it to revise an idea in a line or two, pick the right test or metric, and spot the leakage or bias trap before it spoils your result.

Each concept says what it is in plain words and why it matters, and many carry an example, a snippet or the common mistake. It is a reference for people already learning, not a course.

Three editions, one per focus

The sheet follows the roadmap's focus choice:

  • Business data science (the default): every snippet is Python with pandas, SciPy, statsmodels and scikit-learn. 76 concepts.
  • Towards ML engineering: the same Python stack with extra depth on pipelines, validation and metrics, including hyperparameter search and the move from data science into ML engineering. 78 concepts.
  • Statistics and R: the tidyverse, inference, experiments, tidymodels and reproducible reports, with R snippets wherever the code differs from Python, plus the pipe and dplyr verbs, regression for inference, survey weights and research outputs. 80 concepts.

All three have the same ten chapters.

Chapter by chapter

1. Code for data: Python or R

The everyday working set: the notebook workflow, arrays and vectors, vectorised operations, the DataFrame and tibble, selecting and filtering, group by and aggregate, merging tables, long and wide format, and a reproducible environment. Most entries have a snippet.

2. Statistics and probability you use

Mean, median, standard deviation and IQR, common distributions, conditional probability and Bayes' rule, the sampling distribution and the CLT, standard error, confidence intervals, hypothesis tests and p-values, type I and type II errors and power, which test to use when, and correlation versus causation. The "which test when" entry is the one most people come back to.

3. SQL for data work

Aggregate queries, joins and grain, window functions, common table expressions, running SQL from Python or R, and SQL on local files with DuckDB, all with snippets.

4. Data cleaning and EDA

Tidy data, missing data, duplicates and keys, types, dates and categories, outliers, exploratory data analysis and the cleaning log: the parts of the job that courses skip and employers notice.

5. Visualisation and storytelling

Choosing a chart, plotting in code, distribution plots, showing uncertainty, the action title and the analysis write-up.

6. Machine learning with scikit-learn or tidymodels

Supervised learning, the train and test split, baseline models, linear and logistic regression, random forests and gradient boosting, pipelines and workflows, cross-validation, and overfitting and underfitting, with hyperparameter search (ML focus) or regression for inference (R focus) added.

7. Experiments and A/B testing

A/B test design, the unit of randomisation, sample size and minimum detectable effect, comparing two conversion rates, peeking and early stopping, sample ratio mismatch, guardrail metrics, multiple testing, and practical versus statistical significance.

8. Features and model evaluation

Feature engineering, encoding and scaling, data leakage, the confusion matrix, precision, recall and F1, the ROC curve and AUC, regression metrics, thresholds and calibration, and class imbalance.

9. Working with messy real data

Collecting data from an API, web scraping ethics, public and government datasets, data documentation, and sampling and selection bias, with survey weights on the R edition.

10. Portfolio and first role

Question-driven portfolio projects, the project README, using Kaggle well, reproducible analysis, data roles compared, the take-home analysis task and routes into a first role, plus an edition-specific entry on moving into ML engineering or on research outputs.

Each chapter lists up to three library resources for going deeper, including StatQuest with Josh Starmer, OpenIntro Statistics, R for Data Science, Storytelling with Data and Trustworthy Online Controlled Experiments.

Rules of thumb and glossary

Nine rules of thumb are shared by every edition, with one more added on the ML and R editions. They include: write the question and the decision before you open the data; look at a plot before trusting any summary number; report an effect with its interval, not a p-value alone; fix an experiment's sample size before launch; split first, then preprocess; beat a simple baseline first; and a score that looks too good usually means leakage. A glossary of 58 short terms sits alongside, and every concept joins it automatically.

How to use it with the roadmap

  • After each stage, read its chapter and try to explain each concept to someone without jargon, as the roadmap's statistics stage recommends.
  • While building, keep chapters 6 to 8 open when you model: the pitfalls on leakage, splits and thresholds are where most projects go wrong.
  • Before a technical round or a take-home task, reread statistics, experiments and evaluation. Data roles often test SQL first, so revise chapter 3 as well.

Topics in the roadmap link straight to the concepts in your edition.

How it works on Sefism

Everything on Sefism is free to learn from. The public page shows all ten chapters with their introductions and opens the first two in full. Keeping the sheet uses credits and opens every chapter in the member area; new members get starting credits when they join. If you add the Data science roadmap to your dashboard (your first roadmap is free), this sheet comes with it.

Related on Sefism

FAQ

What should a data science cheat sheet include? This one covers code for data, statistics, SQL, cleaning, visualisation, modelling, experiments, evaluation, data collection and the first role, in the roadmap's order.

Is there an R version? Yes. The Statistics and R edition uses R snippets wherever the code differs from Python and adds R-specific concepts.

Can it replace a statistics course? No. It helps you remember and choose; the roadmap's stages and resources are where you learn.

Which edition suits a first data job? Business data science, the default, matches most analyst and data scientist postings. Pick the ML edition if you are heading into ML engineering.

pythonmachine learningsqlcareer

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 Data Science 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.