[reference] — the Python stack every ML engineer works in. roadmap.sh lists these across both the machine-learning and mlops roadmaps; they’re also the shared foundation the Data Scientist path needs (noted as a gap in 00-foundations).

Why Python

ML runs on Python — not because it’s fast (it isn’t), but because the heavy numeric work happens in optimized C/CUDA underneath (NumPy, PyTorch), and Python is the glue. The ecosystem, not the language, is the reason.

The core stack

LibraryRole
NumPythe foundation — n-dimensional arrays and vectorized math (linear algebra in code); nearly everything else is built on it
pandastabular data — the DataFrame, for loading, cleaning, and manipulating structured data (working with data)
Matplotlib / Seabornvisualization — plotting distributions, relationships, results (Seaborn is a higher-level layer on Matplotlib)
scikit-learnclassical ML — a consistent API for regression, trees, SVMs, clustering, PCA, plus preprocessing, metrics, and model selection. The workhorse for everything that isn’t deep learning
PyTorchdeep learning — the research-and-increasingly-production standard; dynamic, Pythonic (training loop)
TensorFlow / Kerasdeep learning — Google’s framework; Keras is its high-level API. Still common, especially in production/mobile (edge)

The scikit-learn API — learn one, know them all

scikit-learn’s real value is a uniform interface: every model is a class with .fit() (train) and .predict() (infer), so swapping algorithms is a one-line change. This is why it’s the fastest way to try many models:

from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
 
model = RandomForestClassifier()      # swap to LogisticRegression() — same interface
model.fit(X_train, y_train)           # train
preds = model.predict(X_test)         # infer

That .fit()/.predict() contract, plus .transform() for preprocessing, runs through the entire library — pipelines, cross-validation, and grid search (validation & tuning) all compose on top of it.

PyTorch vs TensorFlow — the short version

Both do deep learning; the practical differences have narrowed. PyTorch dominates research and is increasingly the production default (dynamic graphs, more Pythonic); TensorFlow retains strengths in mobile/edge deployment (TFLite) and some production tooling. For learning, PyTorch is the pragmatic pick, and this track uses it. Higher-level wrappers (PyTorch Lightning, Keras) cut boilerplate once you understand the raw loop.

The environment

Real ML work lives in Jupyter notebooks for exploration (interactive, inline plots) and moves to plain .py modules for anything production-bound. conda/venv + pip manage dependencies; GPU work needs matching CUDA versions (a common setup headache). The MLOps section covers taking this from a notebook to a reproducible pipeline.

↑ Back to 01 — Foundations of ML