Skip to content

Glossary

Every term the course defines, in one place. Each entry links to the module that teaches it. Use your browser’s find (Ctrl+F or Cmd+F) or the site search to jump to a term.

2200 terms.

#

__enter__
The method the with statement calls at the start of the block; its return value is bound to the name after as. (11. Decorators and context managers)
__exit__
The method the with statement calls when the block ends, with the exception type, value and traceback (or three None values); a true return value suppresses the exception. (11. Decorators and context managers)
__init__.py
The file that makes a folder a regular package; Python runs it when you import the package. (08. Modules, packages and environments)
__init_subclass__
A class method that Python calls on a parent class each time a subclass is created; used to register plugins. (19. Inheritance and polymorphism)
__main__.py
The file of a package that python -m package runs. (08. Modules, packages and environments)
__match_args__
A class attribute that lists the attribute names a class pattern in match may take as positional arguments; @dataclass generates it. (21. Dataclasses, enums and slots)
__name__
A variable that every module has: "__main__" when the file runs as a program, the module name when it is imported. (08. Modules, packages and environments)
__post_init__
A method that the generated __init__ of a data class calls as its last step; used to validate values and compute derived fields. (21. Dataclasses, enums and slots)
__pycache__
The folder where Python saves compiled copies (.pyc files) of imported modules so later imports start faster; Python manages it by itself. (08. Modules, packages and environments)
__slots__
A class attribute that lists the only attribute names instances may have; Python then reserves a slot for each and creates no __dict__. (21. Dataclasses, enums and slots)
__wrapped__
The attribute that functools.wraps adds to a wrapper; it points to the original, undecorated function. (11. Decorators and context managers)
.env file
A git-ignored text file of NAME=value lines that tools such as python-dotenv load into environment variables. (16. APIs and web data)
**kwargs
A parameter that collects any extra keyword arguments of a call into a dict. (05. Functions)
*args
A parameter that collects any extra positional arguments of a call into a tuple. (05. Functions)
0/1 knapsack
A dynamic programming optimization problem that picks a subset of indivisible items (each taken 0 or 1 times) to maximize value without exceeding a fixed budget or capacity. (45. Algorithms and data structures II)
422 Unprocessable Content
The HTTP status that FastAPI returns when a request body is well-formed JSON but fails validation; its detail lists every error. (44. ML in production basics)
500 Internal Server Error
The HTTP status for an unexpected failure on the server; the response should carry a short, generic message, not internal details. (44. ML in production basics)
503 Service Unavailable
The HTTP status for a service that is not ready, for example because its model is not loaded; the client may retry later. (44. ML in production basics)
68–95–99.7 rule
In a normal distribution, about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations of the mean. (29. Statistics and probability)

A

A/A test
An experiment in which both groups get the same version, used to check the false-positive rate and the setup. (29. Statistics and probability)
A/B test
A randomized experiment that compares two versions of a product, page or message. (29. Statistics and probability)
Ablation study
Removing one part of a model or pipeline at a time and measuring the change in score, to see which parts earn their place. (34. The scikit-learn workflow)
Absolute import
An import that uses the full dotted name from the top of a package, such as from salesreport.loader import load_sales. (08. Modules, packages and environments)
Absolute path
A path that starts at the root of the disk, such as /Users/ana/project/data/sales.csv; it differs between machines. (07. Files and data formats)
Absolute tolerance
An allowed difference expressed as a fixed amount, such as abs=1e-12; it matters for values near zero. (14. Testing with pytest)
Abstract base class (ABC)
A class that cannot be instantiated and declares methods that every concrete subclass must implement; built with abc.ABC. (19. Inheritance and polymorphism)
Abstract collection type
A type from collections.abc, such as Iterable, Sequence or Mapping, that describes what a value can do instead of which class it is. (12. Type hints)
Abstract method
A method marked with @abstractmethod; a subclass must implement it before the subclass can be instantiated. (19. Inheritance and polymorphism)
Abstraction
A description of what is needed, such as a Protocol or a Callable type, without the details of how it is done. (22. Design principles and patterns)
Accessor
An attribute that groups methods for one kind of data, such as .str for text and .dt for dates. (25. pandas advanced)
Accumulated local effects (ALE)
An alternative to partial dependence that averages small changes around observed values, which avoids most impossible rows with correlated features. (43. Interpretability)
Accumulator
A variable set before a loop and updated in each iteration, such as a running total or a count. (03. Control flow)
Accuracy
The share of predictions that equal the true label; 0.80 means 80 of 100 predictions are correct. (19. Inheritance and polymorphism)
Activate
To tell the current terminal to use the Python and packages of a virtual environment. (Start here)
Activation function
A fixed non-linear function applied element-wise between layers, such as ReLU, so that a network can learn non-linear patterns. (42. Deep learning with PyTorch)
Active window
The period during which a customer could place the orders you count, used to turn order counts into fair rates such as orders per year. (Capstone 5. Customer segmentation)
AdaBoost
Adaptive boosting: a boosting method that raises the sample weights of misclassified rows after each round and combines the models with a weighted vote. (38. Ensembles)
Adam
An optimizer that combines momentum with a separate, adaptive step size for every parameter; lr=0.001 is a robust default. (42. Deep learning with PyTorch)
AdamW
Adam with decoupled weight decay: each step shrinks the weights directly instead of adding a penalty to the gradient. (42. Deep learning with PyTorch)
Additive decomposition
A decomposition where the series is trend plus seasonal part plus remainder; the seasonal swing has a constant size. (40. Time series)
Additivity (SHAP)
The property that the base value plus all SHAP values of a row equals the model's output for that row; also called local accuracy. (43. Interpretability)
Adjacency list
A way to store a tree or graph as a dict that maps each node to the list of its neighbors or children. (17. Algorithms and data structures)
Adjusted R²
R² with a penalty for each extra predictor, so it rises only when a predictor helps more than chance. (29. Statistics and probability)
Adjusted Rand index (ARI)
A score that compares two labelings of the same rows, ignoring label names: 1 means perfect agreement and about 0 means random agreement. (39. Unsupervised learning)
Agg
Matplotlib's non-interactive backend that draws into an image in memory, used on servers and in scheduled jobs. (28. Visualization)
Agglomerative clustering
Bottom-up hierarchical clustering: start with one cluster per row and repeatedly merge the two closest clusters. (39. Unsupervised learning)
Aggregate function
A SQL function that turns many rows into one value, such as COUNT, SUM, AVG, MIN or MAX. (30. SQL for data analysis)
Aggregation
An operation that reduces many values to one, such as a sum, mean or maximum; also called a reduction. (23. NumPy)
Akaike information criterion (AIC)
A model score that rewards a good fit and penalizes extra parameters; lower is better when models use the same data. (40. Time series)
Alert
An automatic message to a person when a monitored measure crosses its threshold. (44. ML in production basics)
Alert run
A sequence of consecutive alert readings of one sensor. (09. Standard library power tools)
Algorithm
A precise list of steps that solves a problem, such as finding the first sensor reading after a given time. (17. Algorithms and data structures)
Alias
A second name that refers to the same object as another name. (04. Data structures)
Alignment
Where a value sits in its field width: left (<), right (>), center (^), or sign first then padding (=). (02. Strings and text)
Allowlist
A fixed set of permitted values, such as column names, that input is checked against before use. (30. SQL for data analysis)
Alternative constructor
A class method that builds an instance from another kind of input, such as a CSV row or a file, and returns cls(...). (18. Classes and objects)
Alternative hypothesis (H1)
The claim that you suspect is true if the null hypothesis is rejected, such as "the rates differ". (29. Statistics and probability)
Amortized
Averaged over many calls: list.append is O(1) amortized, because the rare costly resize spreads over many cheap appends. (04. Data structures)
Amortized complexity
The average cost per operation over a worst-case sequence of operations, where occasional expensive steps (such as resizing a dynamic array) are spread across many cheap ones. (45. Algorithms and data structures II)
Analytic derivative
A derivative worked out with the rules of calculus as an exact formula, rather than estimated from function values. (32. Math for ML)
Annotation
Text, an arrow or a reference line on a chart that points the reader to what matters. (28. Visualization)
Anomaly
A value far from the usual values of its source, such as a temperature spike. (18. Classes and objects)
Anomaly detection
Scoring each row by how unusual it is, to find rare rows such as faulty readings or fraud. (39. Unsupervised learning)
Anscombe's quartet
Four small datasets with almost the same means, variances and correlation that look completely different when plotted. (28. Visualization)
Anti-join
The rows of one table that have no match in another table. (25. pandas advanced)
Any
The special type that switches type checking off: a value of type Any is accepted everywhere and allows every operation. (12. Type hints)
Apache Arrow
A standard in-memory format for columns of data, provided in Python by the pyarrow package; when pyarrow is installed, pandas 3 stores text columns in it. (24. pandas fundamentals)
API
An application programming interface: a defined way for one program to ask another program for data or for an action. (16. APIs and web data)
API fixture
A saved API response used as test input, so that code runs offline with the same data every time. (16. APIs and web data)
API key
A secret string that an API issues to identify and authorize a client. (16. APIs and web data)
App factory
A function such as create_app(settings) that builds and returns a new web application object, so tests and production can build apps with different settings. (Capstone 8. Deployment)
apply
The pandas method that calls a Python function per value, per row (`axis=1`) or per column; flexible but much slower than vectorized code. (24. pandas fundamentals)
argparse
The standard library module that reads command-line arguments, converts and checks them and writes the --help text. (08. Modules, packages and environments)
argparse Namespace
The object that parse_args() returns, with one attribute per argument, such as args.top. (08. Modules, packages and environments)
Argument
A value that you pass to a function inside its parentheses. (01. Python basics)
Argument unpacking
Using * or ** in a call to spread a sequence into positional arguments or a dict into keyword arguments, as in f(*values) or f(**options). (05. Functions)
ARIMA
AutoRegressive Integrated Moving Average: a model with order (p, d, q) that combines AR terms, d differences and MA terms. (40. Time series)
Arrange-Act-Assert (AAA)
The three-part shape of a test: build the input, call the code under test once, check the result. (14. Testing with pytest)
Artifact (MLflow)
A file saved with an MLflow run, such as a model, a chart or a report. (44. ML in production basics)
Artist (Matplotlib)
Any object that Matplotlib draws, such as a line, a bar, a text or the legend. (28. Visualization)
As-pattern
A pattern followed by as and a name, such as ("ok" | "warn") as status; it matches the sub-pattern and stores the matched value. (03. Control flow)
ASCII
A 7-bit encoding of 128 characters: English letters, digits, punctuation and control characters; a subset of UTF-8 and latin-1. (02. Strings and text)
asfreq
A pandas method that sets a regular frequency on a time series and adds NaN rows for missing time points. (40. Time series)
ASGI server
A program that listens on the network and passes requests to a Python web app through the ASGI standard. (44. ML in production basics)
Aspect-based sentiment analysis
Rating the sentiment of each aspect of a product separately, for example battery negative and delivery positive. (41. NLP fundamentals)
Assert
A statement that checks a condition and stops the program with an AssertionError when the condition is False. (01. Python basics)
assert_frame_equal
A function in polars.testing that raises an AssertionError when two DataFrames differ in names, dtypes or values. (31. Polars)
Assertion rewriting
pytest's rewriting of assert statements in test files so that a failure report shows the value of each part of the expression. (14. Testing with pytest)
AssertionError
The exception that an assert statement raises when its condition is False. (01. Python basics)
assign
A DataFrame method that returns a copy with new or replaced columns; a lambda argument sees the current frame. (25. pandas advanced)
Assignment
A statement that makes a name refer to a value, written name = value. (01. Python basics)
asyncio
The standard-library framework that runs many I/O-bound tasks in one thread with async and await. (15. Performance and concurrency)
Atomic operation
An operation that completes fully or not at all; other code never sees a half-finished state. (11. Decorators and context managers)
ATTACH
A SQL statement that adds another database file to a connection under a name, such as a SQLite file in DuckDB. (30. SQL for data analysis)
Attribute
A value stored on an object and read with a dot, such as err.column. (06. Errors and debugging)
Attribute lookup
The search Python runs for obj.name: data descriptors such as properties, then the instance namespace, then the class and its base classes. (18. Classes and objects)
Attribute shadowing
An instance attribute with the same name as a class attribute hides the class value for that one instance. (18. Classes and objects)
Augmented assignment
A short form that updates a variable with an operator, such as total += 5 for total = total + 5. (01. Python basics)
Augmented Dickey-Fuller (ADF) test
A hypothesis test whose null hypothesis is that a series has a unit root; a small p-value is evidence that the series is stationary. (40. Time series)
auto()
A placeholder value in an enum class body; Enum and IntEnum turn it into 1, 2, 3, and StrEnum into the lowercase member name. (21. Dataclasses, enums and slots)
Autocommit
A connection setting that controls when changes are committed; sqlite3.connect(path, autocommit=False) puts every statement, DDL included, in a transaction. (30. SQL for data analysis)
Autocorrelation
The correlation of a series with its own past values; today's visits being close to yesterday's is autocorrelation. (40. Time series)
Autocorrelation function (ACF)
The correlation of a series with each of its lags, usually shown as a bar chart with a confidence band. (40. Time series)
Autograd
PyTorch's automatic differentiation engine: it records operations on tensors with requires_grad=True and computes their gradients with backward(). (42. Deep learning with PyTorch)
Automated test
Code that runs a piece of a program on a known input and checks the result without a person; usually just called a test. (14. Testing with pytest)
Automated valuation model (AVM)
A model that estimates the market value of a property from its features, such as size, location and condition, without a human appraiser. (Capstone 3. House price regression)
Autoregressive (AR) model
A model that predicts a value as a weighted sum of the previous p values of the series. (40. Time series)
Average case
The typical amount of work an algorithm does on ordinary inputs of a given size. (15. Performance and concurrency)
Average order value
A customer's total order amount divided by the number of orders. (04. Data structures)
Average order value (AOV)
Total revenue of a customer divided by the number of orders; a monetary measure that does not grow with frequency. (Capstone 5. Customer segmentation)
Average precision (PR-AUC)
A summary of the precision-recall curve: precision averaged over all recall levels; a random model scores the share of positives. (36. Classification)
Average Treatment Effect (ATE)
The mean causal effect of a treatment across the entire target population, E[Y(1) - Y(0)]. (49. Causal inference, GLMs and advanced experimentation)
Average Treatment Effect on the Treated (ATT)
The mean causal effect of a treatment specifically among the units that actually received it, E[Y(1) - Y(0) | T = 1]. (49. Causal inference, GLMs and advanced experimentation)
await
The keyword that pauses a coroutine until an awaitable is done, so the event loop can run other tasks. (15. Performance and concurrency)
Awaitable
An object you can use with await: a coroutine, a task or a future. (15. Performance and concurrency)
Aware datetime
A datetime with a tzinfo that fixes its offset from UTC, so it names one exact moment. (09. Standard library power tools)
Axes (Matplotlib)
One plot area inside a Figure, with its own data, title and x and y axes. (28. Visualization)
Axes-level function
A Seaborn function that draws into one Axes, accepts ax= and returns that Axes, such as histplot. (28. Visualization)
Axis
One dimension of an array; axis 0 runs down the rows and axis 1 across the columns. (23. NumPy)
Axis (Matplotlib)
The x-axis or y-axis object of an Axes; it owns the ticks, the tick labels and the axis label. (28. Visualization)

B

B-tree
A shallow, multi-way balanced search tree whose nodes hold many keys per disk page, making it the standard index structure in SQL databases. (45. Algorithms and data structures II)
Back-transform
Converting a prediction made on a transformed scale back to the original unit, for example applying exp to a predicted log price. (35. Regression)
Backend (Matplotlib)
The part of Matplotlib that turns a figure into pixels, either in a window or in an image file. (28. Visualization)
Backoff
A wait between retries that grows after each failure, such as 1, 2, then 4 seconds. (03. Control flow)
Backpropagation
The algorithm that trains neural networks by applying the chain rule from the loss back to every weight. (32. Math for ML)
Backtesting
Testing a forecasting method on several past forecast origins, each time training only on the data before the origin. (40. Time series)
Backward pass
Computing the gradient of the loss with respect to every parameter, by calling loss.backward(). (42. Deep learning with PyTorch)
Bag of words
A text representation that counts how often each vocabulary word appears in a document and ignores word order. (41. NLP fundamentals)
Bagging
Bootstrap aggregating: training many models on bootstrap samples and averaging their predictions to reduce variance. (35. Regression)
Balanced search tree
A search tree (such as an AVL tree or red-black tree) that automatically rebalances on updates so its height stays O(log n) even on sorted input. (45. Algorithms and data structures II)
Bandwidth
The width of each bell curve in a KDE; a smaller bandwidth gives a more detailed curve. (28. Visualization)
Bare except
An except clause with no exception type; it catches everything, including Ctrl+C, and hides bugs. (06. Errors and debugging)
Base case
The input that a recursive function handles directly, without calling itself; it stops the recursion. (05. Functions)
Base class
The more general type that another type is built on; Exception is the base class of ValueError. (06. Errors and debugging)
Base learner
One of the models inside an ensemble, such as one tree of a random forest or one member of a voting ensemble. (38. Ensembles)
Base Python
The Python installation that created a virtual environment; the environment uses its interpreter and standard library. (08. Modules, packages and environments)
Base rate
The overall rate of an outcome in the whole data, for example the overall churn rate, used as the reference for every group rate. (27. Exploratory data analysis)
Base value (SHAP)
The model's average output over the background data; SHAP values explain the difference between a prediction and this value. (43. Interpretability)
Base-rate fallacy
The mistake of ignoring how rare an event is (the prior) when you judge evidence, which overestimates rare events. (32. Math for ML)
Baseline
A simple reference model, such as always predicting the mean, that a real model must beat. (18. Classes and objects)
Basis
A set of linearly independent vectors that spans a vector space or subspace, giving every point in that space unique coordinates. (46. Linear algebra in depth)
Batch (training)
The group of rows used to compute one gradient step. (32. Math for ML)
Batch dimension
The first dimension of a data tensor, with one entry per sample; a batch of 64 customers with 22 features has shape (64, 22). (42. Deep learning with PyTorch)
Batch gradient descent
Gradient descent that computes each gradient from all training rows. (32. Math for ML)
Batch inference
Scoring many rows on a schedule, for example every customer each night, and writing the scores to a table or file. (44. ML in production basics)
Bayes' rule
The formula P(A | B) = P(B | A) P(A) / P(B), which updates a prior belief with evidence. (32. Math for ML)
Bayes' theorem
The formula that updates a prior probability into a posterior probability by combining it with the likelihood of observed evidence. (48. Probability, Bayesian statistics and information theory)
Bayesian information criterion (BIC)
A model score that rewards a high likelihood and penalizes the number of parameters; lower is better. (39. Unsupervised learning)
Bayesian optimization
Tuning that models the score as a function of the hyperparameters and uses past trials to pick promising candidates. (37. Model evaluation and tuning)
BCa bootstrap
A bootstrap confidence interval that corrects the percentile interval for bias and skewness; the default of scipy.stats.bootstrap. (29. Statistics and probability)
BCEWithLogitsLoss
PyTorch's binary cross-entropy (log loss) computed from logits, with the sigmoid applied inside in a numerically stable way. (42. Deep learning with PyTorch)
Bearer token
A credential sent as Authorization: Bearer <token>; whoever holds it gets access. (16. APIs and web data)
BeautifulSoup
A Python library (package beautifulsoup4, module bs4) that parses HTML into a searchable tree. (16. APIs and web data)
Beeswarm plot
A SHAP plot with one dot per row and feature, placed by its SHAP value and colored by the feature value, for a global view. (43. Interpretability)
Behavioral test
A test of expected model behavior that survives retraining, such as "a risky customer scores higher than a loyal one". (44. ML in production basics)
Benchmark
A repeatable measurement of how long a piece of code takes. (15. Performance and concurrency)
Benjamini–Hochberg procedure
A multiple-testing correction that controls the false discovery rate and keeps more power than Bonferroni. (29. Statistics and probability)
Bernoulli trial
A random experiment with exactly two outcomes, success or failure. (29. Statistics and probability)
Best case
The input of a given size that makes an algorithm do the least work, such as a search target that is the first element. (17. Algorithms and data structures)
Bias (neural network)
A learned number that a layer adds to each output, like the intercept of a linear model. (42. Deep learning with PyTorch)
Bias (of a model)
The systematic error of a model: the distance between its average prediction over many training sets and the true value. (37. Model evaluation and tuning)
Bias–variance trade-off
Making a model more flexible lowers its bias and raises its variance, so the best model balances the two. (37. Model evaluation and tuning)
Big-O notation
A way to describe how the work of an operation grows with the number of elements n, such as O(1) or O(n). (04. Data structures)
Bigram
An n-gram of two consecutive tokens, such as not worth, which lets a bag-of-words model see short phrases. (41. NLP fundamentals)
Bin
One interval of a value range, used to count values in a histogram or to group a number with pd.cut. (27. Exploratory data analysis)
Binary classification
Classification with exactly two classes, coded 0 and 1. (36. Classification)
Binary file
A file whose bytes follow a layout for a specific program, such as .xlsx, .parquet, .db or .pkl. (07. Files and data formats)
Binary mode
Opening a file with b in the mode (rb, wb) so that Python reads and writes raw bytes with no encoding. (07. Files and data formats)
A search on sorted data that compares the target with the middle element and halves the remaining range at each step: O(log n). (17. Algorithms and data structures)
Binary search tree (BST)
A binary tree in which every node's left subtree holds smaller keys and its right subtree holds larger keys, supporting O(log n) lookup when balanced. (45. Algorithms and data structures II)
Binning
Turning a numeric feature into intervals (bins), such as age bands; also called discretization. (33. Feature engineering)
Binomial distribution
The distribution of the number of successes in n independent trials with the same success probability p. (29. Statistics and probability)
Bivariate analysis
Analysis of how two variables relate, for example with a scatter plot, a correlation, grouped statistics or a crosstab. (27. Exploratory data analysis)
Black-box model
A model too large or complex to read directly, such as a random forest or gradient boosting, which needs separate tools to explain it. (43. Interpretability)
Block
A group of indented statements that a header line ending in a colon controls. (03. Control flow)
Bloom filter
A compact probabilistic bit array that tests set membership with zero false negatives and a small, tunable false-positive rate. (45. Algorithms and data structures II)
Body
The data part of a request or response, for example a JSON document. (16. APIs and web data)
Boilerplate
Code that you must write again and again with only small changes, such as an __init__ that copies each argument to an attribute. (21. Dataclasses, enums and slots)
Bonferroni correction
Testing each of m hypotheses at alpha / m to control the family-wise error rate. (29. Statistics and probability)
Boolean (bool)
A truth value: True or False. (01. Python basics)
Boolean mask
A sequence of True and False values, one per element, used to keep the elements where it is True, as in df[df["sqft"] > 2000]. (20. The Python data model)
Boosting
An ensemble method that trains small models in sequence, each one focusing on the mistakes of the models before it, and adds them up with weights. (38. Ensembles)
Bootstrap
Estimating the uncertainty of a statistic by recomputing it on many resamples drawn with replacement from the data. (09. Standard library power tools)
Bootstrap sample
A sample of the same size as the data, drawn at random with replacement, so some rows appear several times and others not at all. (35. Regression)
Bootstrap stability
How much a clustering changes when you refit it on samples drawn with replacement, measured for example with the mean adjusted Rand index. (Capstone 5. Customer segmentation)
Border point
In DBSCAN, a point with too few neighbors to be a core point that lies within eps of a core point and joins its cluster. (39. Unsupervised learning)
Bound
A limit on a type parameter: in def largest[N: float], N must be float or a subtype of float. (12. Type hints)
Bound method
A method looked up on an instance: the function together with the instance it will receive as self. (18. Classes and objects)
Boundary validation
Checking untrusted data once, where it enters the program, so the typed code inside can trust it. (12. Type hints)
Box plot
A chart that shows the median, the quartiles (the box), whiskers to the furthest values within 1.5 IQR, and single points beyond them. (27. Exploratory data analysis)
Branch
A piece of code that runs only when a condition is true, written with if, elif, else or match. (03. Control flow)
Branch coverage
Coverage that also checks that each if statement went both ways, true and false. (14. Testing with pytest)
Breadth-first search (BFS)
A walk of a tree or graph that visits all nodes at distance 1, then 2 and so on, using a queue; it finds the fewest steps on an unweighted graph. (17. Algorithms and data structures)
break
A statement that ends the innermost loop at once. (03. Control flow)
Break-even threshold
The probability above which acting on a prediction pays off: the cost of the action divided by the value of a caught positive. (37. Model evaluation and tuning)
Breakpoint
A place in the code where the debugger pauses the program. (06. Errors and debugging)
Brier score
The mean squared difference between predicted probabilities and the 0/1 outcomes; 0 is perfect and lower is better. (36. Classification)
Broadcasting
NumPy's rules for combining arrays of different shapes by stretching length-1 or missing axes, without copying data. (23. NumPy)
Buffer
A fixed-size block of a file, a few KB, that Python reads ahead at once so that each line need not be read from disk separately. (10. Iterators and generators)
Build backend
The tool that turns a project folder into an installable package, such as hatchling, setuptools or uv_build. (08. Modules, packages and environments)
Builder pattern
A design that uses a separate object to assemble a complex object step by step and to check it before it is used. (22. Design principles and patterns)
Built-in fixture
A fixture that pytest provides, such as tmp_path, capsys or monkeypatch. (14. Testing with pytest)
Built-in function
A function that Python always provides without an import, such as print(), type() or round(). (01. Python basics)
Built-in scope
The scope that holds the names Python always provides, such as len, sum, print and ValueError. (05. Functions)
Business intelligence (BI) tool
An application such as Tableau or Power BI that builds dashboards and reports from SQL tables. (30. SQL for data analysis)
Byte
A number from 0 to 255 (8 bits), the unit in which files and networks store data. (02. Strings and text)
Byte order mark (BOM)
The invisible character U+FEFF at the start of some files; the utf-8-sig encoding removes it. (02. Strings and text)
bytes
The Python type for raw binary data: an immutable sequence of numbers from 0 to 255, written like b'K\xc3\xb6ln'. (02. Strings and text)

C

C3 linearization
The algorithm that computes the MRO: children before parents, parents in the listed order, each class once. (19. Inheritance and polymorphism)
Cache
A store of computed results that lets a program reuse them instead of computing them again. (09. Standard library power tools)
Cache hit
A call that a cache answers from its stored results. (09. Standard library power tools)
Cache miss
A call that a cache cannot answer, so the real function runs and its result is stored. (09. Standard library power tools)
Calendar feature
A model feature taken from the date itself, such as the day of the week or the month. (40. Time series)
Calibration (probabilities)
The agreement between predicted probabilities and observed frequencies: among rows predicted at 0.3, about 30% are positive. (36. Classification)
Calibration curve
A plot of the mean predicted probability per bin against the observed positive rate in that bin; a calibrated model lies on the diagonal. (36. Classification)
Calibration drift
A slow, steady error that builds up in a sensor's readings over time, such as +0.35 °C per day. (23. NumPy)
Call
To run a function by writing its name followed by parentheses and any arguments. (01. Python basics)
Call budget (capacity constraint)
The largest number of customers a team can contact in a period; a model then ranks customers and the team acts on the top ones only, up to that number. (Capstone 4. Customer churn classification)
Call stack
The list of function calls that have started but not yet returned; each recursive call adds one entry. (05. Functions)
Call time
The moment a decorated function is called; the wrapper's code runs then, at every call. (11. Decorators and context managers)
Callable
Any object you can call with parentheses, such as a function, a class or an object with a __call__ method. (11. Decorators and context managers)
Callable (type hint)
The hint for a function used as a value, written Callable[[ArgType, ...], ReturnType] and imported from collections.abc. (12. Type hints)
Callback
A function passed to another function so that it can be called later, such as a key function for sorted(). (05. Functions)
Canary release
Sending a small share of the traffic to a new version first and watching it before the new version replaces the old one. (Capstone 8. Deployment)
Cannibalization
Sales that a new product or channel takes from existing ones instead of adding new demand. (Capstone 2. Sales analysis)
Canonical form
The one agreed spelling of a value, such as North for north, NORTH and " North ", to which every variant is mapped. (02. Strings and text)
Cap
A maximum value that a system records for everything at or above it, which shows up as a pile-up at the maximum. (27. Exploratory data analysis)
Capping
Replacing values beyond a limit with the limit itself, for example with clip(); also called winsorizing. (26. Data cleaning)
Capstone
A large final project that uses the skills of many modules. (Start here)
capsys
A built-in pytest fixture that captures what the code prints; readouterr() returns the out and err text. (14. Testing with pytest)
Capture pattern
A bare name in a pattern; it matches any value and stores it in that variable. (03. Control flow)
Capturing group
A part of a regex in parentheses whose matched text can be read back with group(n). (09. Standard library power tools)
CapWords
The PEP 8 naming style for classes: each word starts with a capital letter and no underscores are used, as in SensorReading. (18. Classes and objects)
Cardinality
The number of distinct values in a column; `region` has a low cardinality (4), `customer_id` a high one (5,000). (24. pandas fundamentals)
Cartesian product
Every way to pick one value from each of several lists; itertools.product builds it. (09. Standard library power tools)
CASE expression
A SQL expression that returns the value of the first WHEN condition that is true, or the ELSE value. (30. SQL for data analysis)
Case folding
Converting text to a form for case-insensitive comparison; str.casefold() is lower() plus extra rules, such as ß to ss. (02. Strings and text)
cast()
typing.cast(T, value): tells the checker to treat value as type T; at runtime it returns the value unchanged and checks nothing. (12. Type hints)
Categorical
A pandas dtype (`category`) that stores each distinct value once and every row as a small integer code into that list. (24. pandas fundamentals)
Categories
The list of allowed distinct values of a categorical column, available as `s.cat.categories`. (24. pandas fundamentals)
Category code
The small integer that a categorical stores per row: the position of the row's value in the list of categories. (24. pandas fundamentals)
Causation
A relationship in which changing one variable changes another; correlation alone does not show it. (27. Exploratory data analysis)
Caveat
A stated limit on a finding: what the evidence does not show, such as a confounder, a small group or a short time window. (27. Exploratory data analysis)
Ceiling division
Division that rounds up to a whole number; for positive whole numbers, (a + b - 1) // b. (01. Python basics)
Cell
The small object in which a closure stores one free variable; func.__closure__ holds the cells. (05. Functions)
Centered ICE plot
An ICE plot in which every curve is shifted to start at 0, so that slopes are easy to compare. (43. Interpretability)
Central difference
The numerical derivative (f(w + h) - f(w - h)) / (2h); it is more accurate than the one-sided version. (32. Math for ML)
Central limit theorem (CLT)
The result that the mean of a large sample of independent values is approximately normal, whatever the shape of the data. (29. Statistics and probability)
Centroid
The mean point of a group of vectors: their sum divided by their count. (20. The Python data model)
Chain rule
The rule that the derivative of a function inside a function is the product of the slopes along the chain: dL/dw = dL/du · du/dw. (32. Math for ML)
Chained assignment
An assignment through two selections in a row, such as `df["a"][mask] = 0`; under copy-on-write it changes nothing and pandas warns. (24. pandas fundamentals)
Chained comparison
Two comparisons written as one, such as 19.0 <= t <= 23.0, which means 19.0 <= t and t <= 23.0. (01. Python basics)
ChainedAssignmentError
The warning that pandas 3 shows when code uses chained assignment; fix it with a single `df.loc[mask, col] = value`. (24. pandas fundamentals)
Chaining
The tendency of single linkage to join two groups through a thin bridge of points. (39. Unsupervised learning)
Channel
One of the stacked grids of an image tensor: 1 for grayscale, 3 for RGB, and one per kernel after a convolution layer. (42. Deep learning with PyTorch)
Character
One letter, digit, space or symbol in a string, such as P, 7 or €. (02. Strings and text)
Character encoding
A rule that turns code points into bytes and back, such as UTF-8 or latin-1. (02. Strings and text)
Character n-gram
A sequence of n consecutive characters, such as qua or ual; features built from them keep misspelled words similar to the right spelling. (41. NLP fundamentals)
Characterization test
A check that records what existing code does now, right or wrong, so that a refactor can prove it did not change the behavior. (13. Pythonic code)
Chart pack
A small set of saved charts, each answering one business question, prepared for a report or a meeting. (28. Visualization)
Chebyshev distance
The largest absolute difference between two rows over all features. (21. Dataclasses, enums and slots)
check_is_fitted
The scikit-learn helper that raises NotFittedError when an estimator has no learned attributes yet. (34. The scikit-learn workflow)
Checkpoint
A set of mixed exercises at the end of a Part that checks whether you are ready for the next Part. (Start here)
Checksum
A short value computed from a file's bytes, such as a SHA-256 hash, that changes when any byte changes; used to verify copies. (09. Standard library power tools)
Chi-square goodness-of-fit test
A test of whether observed counts match expected shares, such as a planned 50/50 split. (29. Statistics and probability)
Chi-square test of independence
A test of whether two categorical variables are related, comparing observed counts with expected counts. (29. Statistics and probability)
Child class
A class that inherits from another class; also called a subclass. (19. Inheritance and polymorphism)
Chunk
A group of up to N consecutive items of a stream, processed together; also called a batch. (10. Iterators and generators)
Churn
When a customer cancels a subscription or stops buying. (01. Python basics)
Circular import
Two modules that import each other at the top level; one of them then sees a half-finished module. (08. Modules, packages and environments)
Class
A blueprint for objects that bundles data and the methods that work on it; module 18 teaches classes in depth. (10. Iterators and generators)
Class (classification)
One possible value of a classification target, such as 'churned' or a wine cultivar. (36. Classification)
Class attribute
An attribute assigned in the class body; it lives in the class namespace and is shared by all instances. (18. Classes and objects)
Class balance
The share of each value of a classification target; a rare class makes accuracy misleading. (27. Exploratory data analysis)
Class body
The indented block under a class statement, where methods and class attributes are defined. (18. Classes and objects)
Class decorator
A decorator applied to a class instead of a function, such as @dataclass. (11. Decorators and context managers)
Class imbalance
A dataset in which one class is much rarer than another, such as 19% churners. (37. Model evaluation and tuning)
Class method
A method decorated with @classmethod that receives the class (cls) instead of an instance. (18. Classes and objects)
Class namespace
The dict that holds a class's methods and class attributes; vars(Cls) shows it. (18. Classes and objects)
Class pattern
A pattern such as int(x) or float(x) that matches only a value of that type. (03. Control flow)
Class weight
A multiplier on the loss of each row of a class, used to make errors on a rare class cost more during training. (37. Model evaluation and tuning)
Classification
Predicting a category, such as churn or stay, instead of a number. (36. Classification)
Classification report
A table of precision, recall, F1 score and support for each class, plus accuracy and averages over the classes. (21. Dataclasses, enums and slots)
Classifier
A model that predicts a class for each row, usually from a score or probability per class. (36. Classification)
ClassVar
A typing hint that marks an annotated name in a class body as a class attribute, not a per-instance field. (18. Classes and objects)
Clause
One part of a SQL statement that starts with a keyword, such as WHERE, GROUP BY or ORDER BY. (30. SQL for data analysis)
Cleaning log
A table with one record per cleaning step that counts the rows and cells the step changed. (26. Data cleaning)
Cleaning pipeline
A script that turns a raw file into a clean file in fixed, small, repeatable steps. (26. Data cleaning)
Client
The program that sends a request, such as a Python script that downloads data. (16. APIs and web data)
Client object
An httpx.Client or requests.Session that shares settings such as base URL, headers and timeout across requests and reuses connections. (16. APIs and web data)
Clone (estimator)
A new, unfitted estimator built from another one's hyperparameters, as type(est)(**est.get_params()). (19. Inheritance and polymorphism)
Clopper–Pearson interval
An exact confidence interval for a proportion that guarantees at least the nominal coverage, at the cost of width. (29. Statistics and probability)
Closed-form solution
A formula that gives the answer in one step without iterations, such as the normal equations for linear regression. (32. Math for ML)
Closure
An inner function together with the variables of its enclosing function that it remembers, even after the outer function has returned. (05. Functions)
cls
The conventional name of a class method's first parameter, which receives the class the method was called on. (18. Classes and objects)
Cluster
One group of similar rows found by a clustering algorithm. (39. Unsupervised learning)
Cluster profile
A table with one row per cluster that shows the mean or median of each feature in original units, plus the cluster size. (39. Unsupervised learning)
Clustering
Splitting rows into groups so that rows in the same group are similar and rows in different groups are not. (39. Unsupervised learning)
COALESCE
A SQL function that returns its first argument that is not NULL, used to replace missing values with a default. (30. SQL for data analysis)
Code coverage
A measure of which parts of the code ran during the tests. (14. Testing with pytest)
Code point
The number that Unicode gives a character, written like U+00E9; ord() returns it and chr() turns it back into a character. (02. Strings and text)
Code smell
A sign that code is more complex or fragile than it needs to be, such as an abstract base class with one subclass. (22. Design principles and patterns)
Coefficient
In a regression, the expected change of the outcome for a one-unit change of a predictor, with the other predictors fixed. (29. Statistics and probability)
Coefficient of determination (R²)
1 minus the residual sum of squares divided by the total sum of squares: 1 for perfect predictions, 0 for always predicting the mean. (18. Classes and objects)
Coerce
To force values into a target type and accept a missing value for those that cannot convert, as `pd.to_numeric(s, errors="coerce")` does. (24. pandas fundamentals)
Cohen's d
The difference between two means divided by the pooled standard deviation. (29. Statistics and probability)
Cohen's h
An effect size for two proportions based on their arcsine transform; used by power functions. (29. Statistics and probability)
Cohesion
How closely the contents of one class, function or module belong together; high cohesion means one clear job. (22. Design principles and patterns)
Cohort
A group of customers who share a start date, such as the signup month. (25. pandas advanced)
collect()
The LazyFrame method that optimizes and runs the query plan and returns a DataFrame. (31. Polars)
collections.abc
The standard library module with abstract base classes for containers, such as Iterable, Sequence and Mapping. (19. Inheritance and polymorphism)
Collider
A common effect of two variables; conditioning on it opens a spurious association between its causes. (49. Causal inference, GLMs and advanced experimentation)
Color cycle
The list of colors that Matplotlib gives to each new line or bar series in turn, named C0, C1 and so on. (28. Visualization)
Color quantization
Reducing an image to a few colors, for example by replacing each pixel with the color of its k-means centroid. (39. Unsupervised learning)
Color vision deficiency
Color blindness: the inability to tell some colors apart, most often red and green. (28. Visualization)
Color-blind-friendly palette
A set of colors that stay distinct for people with a color vision deficiency, such as Seaborn's colorblind palette. (28. Visualization)
Colormap
A mapping from numbers to colors, used for heatmaps and colored scatter plots. (28. Visualization)
Column alias
A new name for a result column, given with AS in the SELECT list. (30. SQL for data analysis)
Column selector
An object made by make_column_selector() that returns the column names matching a dtype or a name pattern when it is called with a DataFrame. (34. The scikit-learn workflow)
Column space
The span of a matrix's columns: the set of all possible predictions Xw a linear model can produce. (46. Linear algebra in depth)
Columnar format
A file or memory layout that stores data column by column, so a reader can load single columns fast and compress similar values well; Parquet is one. (24. pandas fundamentals)
Columnar storage
A storage layout that keeps each column together, so a query reads only the columns it needs. (30. SQL for data analysis)
Columnar table
A table stored as one list per column, such as a dict of equal-length lists, instead of one record per row. (11. Decorators and context managers)
Columns
A table stored as a dict of lists, one list per column. (04. Data structures)
ColumnTransformer
A scikit-learn transformer that applies a different transformer to each group of columns and joins the results side by side. (34. The scikit-learn workflow)
Combination
An unordered selection of items in which each item appears at most once; (A, B) and (B, A) are the same combination. (09. Standard library power tools)
Combining character
A code point that adds a mark, such as an accent, to the character before it. (02. Strings and text)
Command Palette
The VS Code search box for every command, opened with Cmd or Ctrl + Shift + P. (Start here)
Command-line argument
A word typed after the program name in a terminal command; Python receives it as a string in sys.argv. (08. Modules, packages and environments)
Command-line interface (CLI)
A way to control a program by typing a command with arguments in a terminal. (08. Modules, packages and environments)
Comment
Text after # that Python ignores; it explains the code to people. (01. Python basics)
Commit
Saving the changes of a transaction permanently to the database. (30. SQL for data analysis)
Common table expression (CTE)
A named subquery defined with WITH before the main query; several CTEs form a readable chain of steps. (30. SQL for data analysis)
Comparison operator
An operator that compares two values and gives a bool, such as ==, < or >=. (01. Python basics)
Compatible release (~=)
A version specifier that allows later releases of the same series: ~=3.1 means >=3.1 and ==3.*, ~=3.1.1 means >=3.1.1 and ==3.1.*. (08. Modules, packages and environments)
Compensated summation
An addition algorithm that tracks and corrects the rounding error of each step; the built-in sum() uses it for floats since Python 3.12. (13. Pythonic code)
Complement
In two-sum, the value that completes the current one: target minus value. (17. Algorithms and data structures)
Composition
Building an object from other objects that it holds and delegates work to, such as a detector that owns one RunningStats per sensor. (18. Classes and objects)
Composition root
The one place, usually main(), where a program creates its real dependencies and connects them. (22. Design principles and patterns)
Comprehension
An expression that builds a new list, set or dict from another collection, such as [x * 2 for x in values if x > 0]. (04. Data structures)
Computation graph
A directed acyclic graph of elementary operations whose nodes record forward values and local derivatives for automatic differentiation. (47. Calculus and optimization for ML)
Computational graph
The record of operations that produced a tensor; autograd walks it backward to apply the chain rule. (42. Deep learning with PyTorch)
Concatenate
To join strings end to end, as "S" + "01" gives "S01". (01. Python basics)
Concept drift
A change in the relation between the inputs and the target, so the same inputs now mean a different outcome. (44. ML in production basics)
Concrete class
A class that implements all abstract methods of its parents, so that it can be instantiated. (19. Inheritance and polymorphism)
Concurrency
Several tasks in progress during the same period, taking turns, for example while others wait. (15. Performance and concurrency)
Condition
An expression that Python treats as true or false to decide which code runs. (03. Control flow)
Condition number
A measure of how much rounding errors can grow when you solve a linear system; large values mean an unstable solve. (23. NumPy)
Conditional aggregation
An aggregate over a CASE expression or with FILTER, which computes several filtered totals in one pass. (30. SQL for data analysis)
Conditional expression
An expression that chooses between two values: value_if_true if condition else value_if_false. (03. Control flow)
Conditional probability
The probability of an event given that another event happened, P(A | B) = P(A and B) / P(B). (32. Math for ML)
Conditional request
A request with If-None-Match or If-Modified-Since that the server answers with 304 Not Modified when the client's copy is current. (16. APIs and web data)
Confidence band (ACF)
The shaded area in an ACF or PACF plot; bars outside it are significant. The PACF band is about plus or minus 1.96 / sqrt(n); the statsmodels ACF band uses Bartlett's formula and widens with the lag. (40. Time series)
Confidence interval
A range computed from data that, built the same way in many experiments, contains the true value in a stated share of them, such as 95%. (09. Standard library power tools)
Configuration file
A file, such as a TOML file, that holds the settings that change between runs: paths, seeds and hyperparameters. (44. ML in production basics)
Confirmatory analysis
Analysis that tests a hypothesis stated in advance with a planned method, as opposed to exploring for patterns. (27. Exploratory data analysis)
Confounder
A variable linked to both a supposed cause and its effect, so the two correlate more (or less) than any direct link explains. (27. Exploratory data analysis)
conftest.py
A file that pytest loads automatically; its fixtures are available to every test in its folder and below. (14. Testing with pytest)
Confusion matrix
A table of a classifier's predictions that counts each pair of true class and predicted class. (04. Data structures)
Conjugate prior
A prior family that yields a posterior in the exact same distribution family after updating with a matching likelihood, such as Beta with Binomial. (48. Probability, Bayesian statistics and information theory)
Connection
An open link from a program to one database, through which it sends queries and receives results. (30. SQL for data analysis)
Connection pool
A set of open network connections that a client reuses for later requests, which saves time. (16. APIs and web data)
Constant
A module-level name whose value the program never changes, written in UPPER_SNAKE_CASE, such as MAX_QUANTITY = 50. (13. Pythonic code)
Constant time
Work that does not grow with the size of the data, written O(1). (04. Data structures)
Constrained layout
A Matplotlib layout mode (layout="constrained") that moves titles, labels and legends so that they do not overlap. (28. Visualization)
Constraints file
A requirements-style file passed with -c that limits the versions of packages that get installed, without installing anything by itself. (08. Modules, packages and environments)
Constructor
The call of a class that creates an instance; informally, the __init__ method that it runs. (18. Classes and objects)
Consumer
The code that asks an iterator for items, directly with next() or through a for loop, sum(), list() and similar. (10. Iterators and generators)
Container
An object that holds other objects, such as a list, a dict or a string. (03. Control flow)
Container image
A packaged file system with an application and everything it needs to run, which a tool such as Docker starts in the same way on any machine. (Capstone 8. Deployment)
Contamination
The expected share of anomalies that Isolation Forest and LOF use to set their threshold; it does not change the scores. (39. Unsupervised learning)
Context (Polars)
A DataFrame or LazyFrame method that runs expressions on data: select, with_columns, filter or group_by().agg(). (31. Polars)
Context (strategy pattern)
The object or function that holds a strategy and calls it, such as a KNN model that calls its distance function. (22. Design principles and patterns)
Context manager
An object that defines what happens at the start and the end of a with block, such as a file object that closes itself. (07. Files and data formats)
Context manager protocol
The two methods __enter__ and __exit__ that an object needs to work with the with statement. (11. Decorators and context managers)
ContextDecorator
A contextlib base class that lets one context manager also be used as a decorator, so that each call runs inside the with block. (11. Decorators and context managers)
contextlib
The standard library module of tools for writing and combining context managers. (11. Decorators and context managers)
contextlib.chdir
A context manager (Python 3.11+) that changes the working directory for a block and changes it back afterwards. (11. Decorators and context managers)
contextlib.contextmanager
A decorator that turns a generator function with one yield into a context manager: code before yield is the setup, code after it the cleanup. (11. Decorators and context managers)
contextlib.redirect_stdout
A context manager that sends everything print() writes to another file object, such as an io.StringIO buffer. (11. Decorators and context managers)
contextlib.suppress
A context manager that silently ends its block when one of the listed exception types is raised. (11. Decorators and context managers)
Contiguous memory
One unbroken block of memory in which the values are stored one after the other, with no pointers between them. (23. NumPy)
Contingency table
A table of counts for every combination of two categorical variables, built with pd.crosstab. (25. pandas advanced)
Continuation byte
In UTF-8, a byte from 0x80 to 0xbf that follows the first byte of a multi-byte character and completes it. (07. Files and data formats)
continue
A statement that ends the current iteration and goes on with the next one. (03. Control flow)
Continuous integration (CI)
A server that builds a fresh environment and runs the tests for every change to a project. (08. Modules, packages and environments)
Continuous random variable
A random variable that can take any value in a range. (29. Statistics and probability)
Control flow
The order in which Python runs the statements of a program; branches and loops change it. (03. Control flow)
Convergence
The state in which an iterative algorithm's steps are so small that more iterations would not change the answer. (03. Control flow)
ConvergenceWarning
A warning that an optimizer stopped before it found the best parameters; fix the model, the scale or the number of iterations. (40. Time series)
Conversion flag
A suffix in an f-string replacement field that picks the text form: !r calls repr(), !s calls str() and !a calls ascii(). (20. The Python data model)
Conversion rate
The share of users who complete a goal, such as a purchase. (09. Standard library power tools)
Convex function
A function whose graph lies on or below every chord joining two points (equivalently, positive semidefinite Hessian everywhere), ensuring every local minimum is global. (47. Calculus and optimization for ML)
Convolution
An operation that slides a small grid of weights over an input and computes, at each position, the sum of the products plus a bias. (42. Deep learning with PyTorch)
Convolution kernel
The small grid of learned weights, for example 3×3, that a convolution slides over its input. Also called a filter. (42. Deep learning with PyTorch)
Convolutional neural network (CNN)
A network that uses convolution layers with small shared kernels, usually followed by pooling, to learn local patterns in images or signals. (42. Deep learning with PyTorch)
Cooperative multiple inheritance
A design in which every method of a chain calls super() once, so that each class in the MRO runs exactly once. (19. Inheritance and polymorphism)
Cooperative multitasking
Task switching in which each task gives control back voluntarily, as asyncio tasks do at await. (15. Performance and concurrency)
Cophenetic correlation
The correlation between the original pairwise distances and the tree heights at which each pair first joins; it measures how well a dendrogram keeps the distances. (39. Unsupervised learning)
Copy (array)
A NumPy array with its own memory, as returned by .copy(), boolean masks and fancy indexing. (23. NumPy)
Copy-on-write
The pandas 3 rule that every selection or method result behaves as a separate object; data is copied only when one of them is modified. (24. pandas fundamentals)
Core point
In DBSCAN, a point with at least min_samples points within eps; core points start and grow clusters. (39. Unsupervised learning)
Coroutine
An object created by a coroutine function that can run, pause at await and resume. (15. Performance and concurrency)
Coroutine function
A function defined with async def; calling it returns a coroutine instead of running the body. (15. Performance and concurrency)
Corpus
The whole collection of texts that you analyze, such as the 3,000 reviews in data/reviews.csv. (41. NLP fundamentals)
Correlated subquery
A subquery that refers to a column of the outer query, so it runs once per outer row. (30. SQL for data analysis)
Correlation coefficient
A number from -1 to +1 that says how strongly two variables move together; 0 means no association of the measured kind. (27. Exploratory data analysis)
Correlation matrix
The table of correlations between every pair of columns of a dataset; symmetric, with 1 on the diagonal. (23. NumPy)
Cosine similarity
The dot product of two vectors divided by both of their lengths: the cosine of the angle between them, from -1 to 1, independent of length. (32. Math for ML)
Cost matrix
A table that assigns a cost to each cell of the confusion matrix, used to choose the decision threshold. (36. Classification)
Cost-complexity pruning
Cutting back a grown decision tree by removing splits whose gain is below a penalty per leaf, set by ccp_alpha in scikit-learn. (36. Classification)
Counter
A dict subclass from collections that maps each item to its count; missing keys count as 0. (09. Standard library power tools)
Counterfactual explanation
The smallest change to an input that changes a model's decision, such as the smallest drop in support tickets that moves a customer below the call threshold. (43. Interpretability)
Coupling
How much one part of the code depends on the details of another part; low coupling lets you change one part alone. (22. Design principles and patterns)
Covariance matrix
A square table of the variances of the features and the covariances between each pair of features; it describes how the features spread and move together. (39. Unsupervised learning)
Covariant (typing)
A generic type that accepts a subtype in its type argument: Sequence[int] is accepted as Sequence[float]. (12. Type hints)
Covariate shift
Another name for data drift: the distribution of the inputs changes while the relation to the target may stay the same. (44. ML in production basics)
Coverage
The long-run share of confidence intervals from a method that contain the true parameter. (29. Statistics and probability)
cp1252
The Windows variant of latin-1 that adds characters such as € and curly quotes; common in old exports. (02. Strings and text)
cProfile
The standard-library profiler: python -m cProfile script.py, or a with cProfile.Profile() block. (15. Performance and concurrency)
CPU build
A version of a library such as PyTorch that runs on the main processor and needs no graphics card. (Start here)
CPU core
One independent processing unit of a CPU; a laptop has about 4 to 16. (15. Performance and concurrency)
CPU time
The time the processor spends running a process; waiting does not count. (15. Performance and concurrency)
CPU-bound
Describes code that spends most of its time computing, so a faster or second CPU core helps. (15. Performance and concurrency)
CPython
The standard Python interpreter, written in C, that python.org distributes. (15. Performance and concurrency)
Cramér's V
An effect size for a chi-square test, from 0 (no association) to 1 (perfect association). (29. Statistics and probability)
CRC32
A fast 32-bit checksum that always gives the same number for the same bytes; used here to assign ids to stable buckets. (44. ML in production basics)
Credible interval
A Bayesian interval that contains an unknown parameter with a specified posterior probability given the model and observed data. (48. Probability, Bayesian statistics and information theory)
Critical value
The cutoff from a distribution that sets the width of an interval or the rejection threshold of a test, such as 1.96. (29. Statistics and probability)
CRM
Customer relationship management: software that stores customer records and contact history. (02. Strings and text)
Cross join
A join without a condition that pairs every row of one table with every row of the other. (30. SQL for data analysis)
cross_validate
The scikit-learn function that cross-validates an estimator with one or more metrics and returns fold scores, fit times and, optionally, training scores. (34. The scikit-learn workflow)
Cross-entropy
The expected negative log-probability of true outcomes under a predicted distribution, used as the standard loss function in classification. (48. Probability, Bayesian statistics and information theory)
Cross-entropy loss
The multiclass log loss: the negative log of the softmax probability of the true class; nn.CrossEntropyLoss takes logits and int64 class indices. (42. Deep learning with PyTorch)
Cross-fitting
Encoding each fold of the training data with statistics learned on the other folds, so that no row sees its own target. (33. Feature engineering)
Cross-section (xs)
A selection of all rows with one value in a chosen MultiIndex level, which drops that level. (25. pandas advanced)
Cross-validation
An evaluation method that splits the data into k folds, trains on k-1 folds, scores on the remaining fold and repeats for every fold. (33. Feature engineering)
CSR (compressed sparse row)
A sparse matrix format that stores the non-zero values row by row with their column indices; fast for row slicing and matrix products. (41. NLP fundamentals)
CSS selector
A pattern such as table#products tbody tr that matches HTML elements by tag, class, id and attributes. (16. APIs and web data)
CSV
Comma-separated values: a plain text table with one row per line and commas between the columns. (Start here)
Cumulative distribution function (CDF)
The function that gives the probability of a value at most x. (29. Statistics and probability)
Cumulative time (cumtime)
In a profile, the time spent in a function and in every function it calls. (15. Performance and concurrency)
CUPED
Controlled-experiment Using Pre-Experiment Data, a variance-reduction technique that subtracts a scaled pre-experiment covariate from the outcome. (49. Causal inference, GLMs and advanced experimentation)
curl
A command-line HTTP client, used to send test requests to a running API. (44. ML in production basics)
Cursor
An object that runs a query and walks through its result rows with fetchone, fetchmany or fetchall. (30. SQL for data analysis)
Cursor pagination
Pagination where each response gives an opaque cursor that the client sends to get the next page. (16. APIs and web data)
Custom exception
An exception type that you define as a subclass of Exception, to name a problem of your own domain. (06. Errors and debugging)
Cyclical encoding
Mapping a repeating value such as month or hour onto a circle with a sine and a cosine, so that the end of the cycle sits next to the start. (33. Feature engineering)

D

Data audit
A check of a dataset's consistency and completeness before anyone analyzes or models it. (04. Data structures)
Data class
A class whose main job is to hold data; the @dataclass decorator generates its __init__, __repr__ and __eq__ from the annotated fields. (21. Dataclasses, enums and slots)
Data cleaning
The process that measures the quality problems of a dataset, fixes or labels them and records every change. (26. Data cleaning)
Data contract
A written, testable agreement on the columns, types and rules that a table must satisfy. (26. Data cleaning)
Data drift
A change over time in the distribution of the input data, which can make a fitted model or segmentation out of date. (39. Unsupervised learning)
Data fingerprint
A short value, such as a SHA-256 hash, that identifies the exact content of a dataset. (44. ML in production basics)
Data leakage
Information from the test set reaching a model during training, which makes the test score look better than real performance. (14. Testing with pytest)
Data matrix
The 2-D array X of shape (n, p) that stacks the feature vectors of all n rows; row i is one example, column j one feature. (32. Math for ML)
Data quality
How well a dataset fits the job it is used for, measured along dimensions such as completeness, validity, uniqueness, consistency and accuracy. (26. Data cleaning)
Data structure
A way to organize many values so that you can store, find and change them; Python's built-in ones are list, tuple, dict and set. (04. Data structures)
Data visualization
The drawing of data as marks such as points, lines, bars and colors, so that a person can see patterns, trends and outliers. (28. Visualization)
Database
An organized store of data that a program, the database engine, manages and answers questions about. (30. SQL for data analysis)
Database engine
The program or library that stores a database and runs the queries sent to it, such as SQLite or DuckDB. (30. SQL for data analysis)
Database index
A sorted lookup structure on one or more columns that lets the engine find matching rows without scanning the table. (30. SQL for data analysis)
dataclasses.asdict()
A function that converts a data class instance into a dict, recursively and with copies of nested lists and dicts. (21. Dataclasses, enums and slots)
dataclasses.field()
A function that describes one dataclass field in detail: its default, its default_factory, and whether it appears in __init__, the repr and comparisons. (21. Dataclasses, enums and slots)
dataclasses.fields()
A function that returns one Field object (with name, type and default) per field of a data class, for generic code. (21. Dataclasses, enums and slots)
dataclasses.replace()
A function that returns a new data class instance with some fields changed; it calls __init__, so __post_init__ validates the copy. (21. Dataclasses, enums and slots)
DataFrame
A pandas table: several named columns, each a Series, that share one index of row labels. (24. pandas fundamentals)
DataFrame.stack
A pandas method that moves column labels into the innermost index level (wide to long); not the stack data structure of module 17. (25. pandas advanced)
DataLoader
A PyTorch object that draws samples from a Dataset, stacks them into batches and can shuffle them in every epoch. (42. Deep learning with PyTorch)
Dataset
A collection of related data, usually a table. (Start here)
Dataset (PyTorch)
Any object with __len__ and __getitem__ that returns one sample, such as a (features, target) pair. (42. Deep learning with PyTorch)
datetime64
The NumPy and pandas dtype for dates and times; pandas 3 parses dates as `datetime64[us]`, with microsecond precision. (24. pandas fundamentals)
DatetimeIndex
A pandas index of timestamps that enables date-string selection, resampling, time shifts and date axes in plots. (40. Time series)
Daylight saving time (DST)
The practice of moving clocks one hour forward in spring and back in autumn, which makes some local days 23 or 25 hours long. (09. Standard library power tools)
DBSCAN
Density-Based Spatial Clustering of Applications with Noise: a clustering algorithm that grows clusters through dense regions and labels isolated points as noise (-1). (39. Unsupervised learning)
ddof
Delta degrees of freedom: the number subtracted from n in the variance formula; 0 in NumPy by default, 1 in pandas. (29. Statistics and probability)
Debugger
A tool that pauses a running program so that you can inspect variables and run it one line at a time. (06. Errors and debugging)
Debugging
Finding and fixing the cause of a crash or of a wrong result. (06. Errors and debugging)
Decimal
A number type from the decimal module that stores decimal digits exactly; build it from a string, as in Decimal("129.95"). (13. Pythonic code)
Decision function
A classifier method that returns a real-valued score per row; higher means more likely positive, and 0 is the default threshold. (36. Classification)
Decision stump
A decision tree with a single split and two leaves. (35. Regression)
Decision tree
A model that predicts by asking a sequence of yes/no questions about the features and returns the mean training target of the leaf a row reaches. (35. Regression)
Declarative language
A language in which you describe the result you want and the engine decides how to compute it. (30. SQL for data analysis)
Decode
To turn bytes into a str with a character encoding, as in data.decode("utf-8"). (02. Strings and text)
Decomposition (time series)
Splitting a time series into a trend, a seasonal part and a remainder. (40. Time series)
Decoration time
The moment Python executes a def statement with a decorator and calls the decorator, usually once at import. (11. Decorators and context managers)
Decorator
A callable that takes a function (or class) and returns a replacement for it; @deco above def f means f = deco(f). (11. Decorators and context managers)
Decorator factory
A function that takes settings and returns a decorator, used as @retry(3, [1, 2, 4]); also called a decorator with arguments. (11. Decorators and context managers)
Decorator stacking
Putting several decorators on one function; the one nearest the def wraps first, and the top one runs first at call time. (11. Decorators and context managers)
Decoupled weight decay
Weight decay applied directly to the weights at each step, outside the adaptive Adam update, as AdamW does; with Adam it is not the same as an L2 penalty in the loss. (42. Deep learning with PyTorch)
Deep copy
A copy of a container and, recursively, of every mutable object inside it, made by copy.deepcopy(). (04. Data structures)
Deep learning
Training neural networks with several layers, so that the model learns its own features from raw data such as pixels or text. (42. Deep learning with PyTorch)
Default factory
The function, such as list or float, that a defaultdict calls with no arguments to build the value of a missing key. (09. Standard library power tools)
Default value
The value a parameter takes when the caller passes no argument for it, as in discount=0.0. (05. Functions)
defaultdict
A dict from collections that calls a default factory to create the value of a missing key. (09. Standard library power tools)
Definite integral
The signed area under a curve over an interval [a, b], used to compute continuous probabilities and expectations from probability density functions. (47. Calculus and optimization for ML)
Degrees of freedom
The number of values that are free to vary after some statistics are fixed, such as n − 1 for a sample variance. (29. Statistics and probability)
Delegation
Passing work to another object; with yield from, a generator passes on the items of an inner iterable. (10. Iterators and generators)
Delimiter
A character that separates fields in a line of text, such as a comma, a semicolon, a tab or |. (02. Strings and text)
Dendrogram
A tree diagram of hierarchical clustering in which the height of each join is the distance at which two clusters merged. (39. Unsupervised learning)
Dense vector
A short vector, typically 50 to 1,000 numbers, in which most values are non-zero; the opposite of a sparse vector. (41. NLP fundamentals)
Density (sparse matrix)
The share of non-zero cells in a matrix: nnz divided by rows times columns. (41. NLP fundamentals)
Dependency
A package that your code needs in order to run. (08. Modules, packages and environments)
Dependency group
A named list of developer-only packages in [dependency-groups] of pyproject.toml, such as test and lint tools. (08. Modules, packages and environments)
Dependency injection
Passing a component such as a sleep function or a clock into code as an argument, instead of hard-coding it, so that tests can replace it. (11. Decorators and context managers)
Dependency inversion principle
High-level logic should depend on abstractions, such as "a function that returns rows", not on details such as a file path. (22. Design principles and patterns)
Dependency resolution
The work of an installer's resolver: picking one version of every package that satisfies all version specifiers at once. (08. Modules, packages and environments)
Depth-first search (DFS)
A walk of a tree or graph that follows one branch to its end before it backs up, using a stack or recursion. (17. Algorithms and data structures)
deque
A double-ended queue from collections that adds and removes items at both ends in constant time; with maxlen it drops the oldest item. (09. Standard library power tools)
Derivative
The slope of a function at a point: how fast the output changes when the input changes a tiny amount. (32. Math for ML)
Derived field
A field whose value is computed from other fields, usually declared with field(init=False) and set in __post_init__. (21. Dataclasses, enums and slots)
Descriptive statistics
Numbers and charts that summarize the data you have: center, spread and shape. (29. Statistics and probability)
Deselected test
A collected test that pytest does not run because -k or -m filtered it out. (14. Testing with pytest)
Deserialization
Rebuilding objects in memory from stored bytes or text, such as json.load() or pickle.load(). (07. Files and data formats)
Design matrix
The matrix of model inputs with one row per observation and one column per input, often with a column of ones for the intercept. (23. NumPy)
Design pattern
A named, reusable solution to a design problem that keeps coming back, such as choosing an algorithm at run time. (22. Design principles and patterns)
Design principle
A rule of thumb for arranging code, such as "give each class one job". (22. Design principles and patterns)
detach()
A tensor method that returns the same values without the computational graph, for example before converting to NumPy. (42. Deep learning with PyTorch)
Determinant
One number computed from a square matrix; it is 0 exactly when the matrix has no inverse. (23. NumPy)
Deterministic
Giving exactly the same output every time it runs on the same input. (26. Data cleaning)
Deterministic profiler
A profiler, such as cProfile, that records every function call and return instead of taking samples. (15. Performance and concurrency)
Deterministic trend
A trend that follows a fixed line or curve over time; the series returns to it after a shock. (40. Time series)
Developer representation
The unambiguous text that __repr__ returns for debugging, logs and the REPL, ideally the code that rebuilds the object. (20. The Python data model)
Diamond problem
The question of which method runs, and how often, when two parents of a class share a common parent. (19. Inheritance and polymorphism)
Dict merge operator
The | operator between two dicts (Python 3.9+), which returns a new dict with the keys of both; the right side wins on shared keys. (07. Files and data formats)
Dict unpacking
Writing **d inside a dict literal to copy all keys and values of d, as in {**row, "month": "2024-01"}. (07. Files and data formats)
Dictionary (dict)
A collection that maps keys to values, written in curly braces, such as {"sensor_id": "S1"}. (03. Control flow)
Diff
A list of line changes between two versions of a text: lines that start with - are removed, lines that start with + are added. (13. Pythonic code)
Difference-in-Differences (DiD)
A quasi-experimental method that compares the before-and-after change in a treated group against the before-and-after change in a control group. (49. Causal inference, GLMs and advanced experimentation)
Differencing
Replacing each value of a series by its change from an earlier value, to remove a trend, a unit root or a seasonal pattern. (40. Time series)
Differentiability
The property of a function having a single well-defined tangent slope (equal left and right limits of the difference quotient) at a point. (47. Calculus and optimization for ML)
Dijkstra's algorithm
A priority-queue shortest-path algorithm that finds minimum-cost routes from a source node in a graph with non-negative edge weights in O((V + E) log V) time. (45. Algorithms and data structures II)
Dimension table
A table with one row per thing, such as a store or a product, that holds its attributes. (25. pandas advanced)
Dimensionality reduction
Replacing many feature columns with a few new ones that keep most of the information. (39. Unsupervised learning)
Direct dependency
A dependency that you list and import yourself, such as pandas. (08. Modules, packages and environments)
Direct forecasting strategy
Forecasting several steps ahead with features that are all at least as old as the horizon, so no prediction is fed back. (40. Time series)
Directed acyclic graph (DAG)
A directed graph with no directed cycles, used to model data pipelines, build systems, computation graphs and causal relationships. (45. Algorithms and data structures II)
Directional derivative
The rate of change of a multivariable function along a unit direction vector u, equal to the dot product of the gradient with u. (47. Calculus and optimization for ML)
Directory
A folder: a container on a disk that holds files and other directories. (07. Files and data formats)
Directory tree
A directory with all its subdirectories and files, nested level by level. (07. Files and data formats)
Dirichlet prior
A probability distribution over mixtures that LDA uses so that each document uses few topics and each topic few words. (41. NLP fundamentals)
Discrete random variable
A random variable that takes separate, countable values such as 0, 1, 2. (29. Statistics and probability)
Disjoint Set Union (Union-Find)
A forest-based structure that tracks elements partitioned into non-overlapping groups and supports union and find operations in nearly O(1) amortized time. (45. Algorithms and data structures II)
Distance-based model
A model that compares rows by their distance, such as k-nearest neighbors, k-means or a support vector machine. (33. Feature engineering)
Distribution
The values a variable takes and how often it takes each of them. (27. Exploratory data analysis)
Distribution metadata
The information an installer saves next to each installed package, such as its name, version and dependencies; importlib.metadata reads it. (08. Modules, packages and environments)
Distribution name
The name under which a package is installed and published, such as scikit-learn; it can differ from the import name sklearn. (08. Modules, packages and environments)
Distributional hypothesis
The idea that words used in similar contexts have similar meanings, the basis of LSA and word embeddings. (41. NLP fundamentals)
Divergence
The failure of an iterative algorithm whose values grow without limit instead of settling, often from a too-large learning rate. (03. Control flow)
Diverging color map
A color scale with two hues that meet at a neutral middle color, used for values with a meaningful center such as a correlation of 0. (27. Exploratory data analysis)
Diversity (ensemble)
How differently the base learners of an ensemble err; the less their errors correlate, the more combining them helps. (38. Ensembles)
Divide and conquer
A strategy that splits a problem into smaller problems of the same kind, solves them and combines their answers. (17. Algorithms and data structures)
Django model
A class in the Django web framework that maps to a database table; each class attribute declares a column. (18. Classes and objects)
Dockerfile
A text file with the steps that build a container image: the base image, the packages to install, the files to copy and the command to run. (Capstone 8. Deployment)
Docstring
A string literal on the first line of a function, class or module body that documents it; help() and editors show it. (05. Functions)
Document (NLP)
One text of a corpus, the unit that you classify or compare, such as one review or one email. (41. NLP fundamentals)
Document frequency
The number of documents of a corpus that contain a term at least once. (41. NLP fundamentals)
Document frequency cut-off
A rule that drops terms by how many documents contain them: min_df removes rare terms and max_df removes very common ones. (41. NLP fundamentals)
Document-term matrix
A matrix with one row per document, one column per vocabulary term and a count or weight in each cell. (41. NLP fundamentals)
Dot product
The sum of the products of matching components of two vectors; the @ operator computes it for a Vector. (20. The Python data model)
Doubly linked list
A chain of nodes where each node stores pointers to both its previous and next neighbors, allowing O(1) insertion and removal once you hold a reference to the node. (45. Algorithms and data structures II)
Downcast
To convert a column to a smaller dtype that still holds its values, such as `int64` to `int32` or `int8`, to save memory. (24. pandas fundamentals)
Downsampling
Resampling to a coarser frequency; several rows go into each new bin, so they must be aggregated with sum, mean or similar. (40. Time series)
DPI (dots per inch)
The number of pixels per inch of figure size when a raster image is saved. (28. Visualization)
Dropout
A regularization layer that sets a random share p of its inputs to 0 during training and scales the rest by 1/(1-p); it does nothing in eval mode. (42. Deep learning with PyTorch)
dtype
The data type of every element of an array, such as int64, float64 or bool. (23. NumPy)
Duck typing
Using an object by what it can do (its methods), not by what class it is: if it has fit and predict, treat it as a model. (12. Type hints)
DuckDB
An embedded, columnar database engine built for analysis that also queries CSV, Parquet and DataFrames directly. (30. SQL for data analysis)
Dummy estimator
A scikit-learn baseline (DummyClassifier, DummyRegressor) that ignores the features and predicts a constant, such as the most frequent class or the median. (34. The scikit-learn workflow)
Dummy variable
A 0/1 column that marks one level of a categorical variable in a regression. (29. Statistics and probability)
Dummy variable trap
Perfect collinearity when all dummy columns of a feature sum to 1 next to an intercept; dropping one dummy removes it. (33. Feature engineering)
Dunder name
A name with two underscores on each side, such as __name__ or __init__; Python gives these names a special meaning. (08. Modules, packages and environments)
Duplicate
A row that records the same real-world event as another row. (26. Data cleaning)
Dynamic programming
Solving a problem from the stored answers of its overlapping subproblems, by memoized recursion or by filling a table bottom-up. (17. Algorithms and data structures)
Dynamic typing
A language rule that variables have no fixed type and types are checked only when a line runs; Python is dynamically typed. (12. Type hints)

E

EAFP
Easier to ask forgiveness than permission: try the operation and handle the exception if it fails. (06. Errors and debugging)
Eager API
The Polars style in which each call runs at once and returns a DataFrame, as with pl.read_csv and DataFrame methods. (31. Polars)
Eager evaluation
Computing all values at once and storing them, as a list comprehension does; the opposite of lazy evaluation. (10. Iterators and generators)
Early binding
Capturing a value when a function is created, for example with a default argument lambda t, limit=limit: ..., instead of looking it up when the function runs. (13. Pythonic code)
Early stopping
Stopping training when the validation loss has not improved for a set number of epochs (the patience). (18. Classes and objects)
ECDF
Empirical cumulative distribution function: for each value, the share of observations at or below it. (28. Visualization)
Eckart–Young theorem
The theorem proving that the truncated rank-k SVD gives the smallest possible Frobenius and spectral reconstruction error among all matrices of rank at most k. (46. Linear algebra in depth)
Edge case
An input at the border of what code handles, such as an empty string, a missing token or a value just outside a range. (14. Testing with pytest)
Edit distance (Levenshtein distance)
The minimum number of single-character insertions, deletions or substitutions required to transform one string into another, computed by 2D dynamic programming. (45. Algorithms and data structures II)
Editable install
An install (pip install -e .) that points the environment to your source folder, so code changes apply without a reinstall. (08. Modules, packages and environments)
Editor
The program where you write code, for example VS Code. (Start here)
Effect size
A measure of how large an effect is, such as a difference in means or Cohen's d. (29. Statistics and probability)
Eigenvalue
The stretch factor λ of an eigenvector; for a correlation matrix it measures the variation along that direction. (23. NumPy)
Eigenvector
A direction that a square matrix only stretches: Av = λv. (23. NumPy)
Elasticity
The percent change of one quantity for a 1% change of another; the coefficient of a log-log regression. (29. Statistics and probability)
ElasticNet
Linear regression with a mix of L1 and L2 penalties, set by l1_ratio, that can zero out weights while keeping correlated features together. (35. Regression)
Elbow method
Choosing k by plotting inertia against k and picking the k after which the curve flattens. (39. Unsupervised learning)
Element
One value inside a container; also called an item. (04. Data structures)
Element-wise
Applied to each element separately, as in temps * 2, which doubles every element of an array. (23. NumPy)
Embedded database
A database engine that runs as a library inside your program, with no separate server; SQLite and DuckDB are examples. (30. SQL for data analysis)
Embedded method
A feature selection method in which the model selects features while it trains, such as Lasso or tree importances. (33. Feature engineering)
Embedding
A new, low-dimensional set of coordinates for the rows of a data set, such as a 2-D map from t-SNE or UMAP. (39. Unsupervised learning)
EmbeddingBag
A PyTorch layer that looks up one learned vector per token id and averages (or sums) the vectors of each text in one call, using offsets instead of padding. (Capstone 7. Review sentiment)
Empirical Bayes
A Bayesian approach that estimates prior hyperparameters directly from the pooled dataset across groups to shrink noisy small-sample estimates. (48. Probability, Bayesian statistics and information theory)
Empty string
The string with no characters, written ""; its length is 0 and it is falsy. (02. Strings and text)
Encapsulation
Hiding an object's internal details behind a small public interface, so that internals can change safely. (18. Classes and objects)
Enclosing scope
The scope of an outer function, as seen from a function defined inside it. (05. Functions)
Encode
To turn a str into bytes with a character encoding, as in text.encode("utf-8"). (02. Strings and text)
End-to-end test
A test that runs the whole program the way a user does, for example from the command line. (14. Testing with pytest)
Endpoint
One URL path that an API answers, such as /v1/products. (16. APIs and web data)
Ensemble
A model that combines the predictions of several models, such as a random forest or a boosted set of trees. (35. Regression)
Entry point
A terminal command that an installer creates from a [project.scripts] line such as salesreport = "salesreport.cli:main". (08. Modules, packages and environments)
Enum (Polars dtype)
A dtype for text from a fixed list of values, stored as small integer codes; it rejects other values and sorts in the list's order. (31. Polars)
Enum alias
A second enum name with the value of an existing member; it refers to that member instead of creating a new one. (21. Dataclasses, enums and slots)
Enum member
One named constant of an enumeration, such as Distance.EUCLIDEAN, with a .name and a .value; each member is a singleton. (21. Dataclasses, enums and slots)
enumerate()
A built-in that gives (position, item) pairs for an iterable; start=1 numbers from 1. (03. Control flow)
Enumeration (Enum)
A class with a fixed set of named constants, created as a subclass of enum.Enum. (21. Dataclasses, enums and slots)
Environment marker
A condition after a requirement, such as ; sys_platform == "win32", that limits it to some systems. (08. Modules, packages and environments)
Environment variable
A named setting that the shell passes to a program, such as PYTHONBREAKPOINT=0. (06. Errors and debugging)
Epoch
In machine learning, one full pass of a training algorithm over the training data. (03. Control flow)
eps (DBSCAN)
The neighborhood radius that DBSCAN uses to count a point's neighbors. (39. Unsupervised learning)
Equivalence bound
The smallest difference that would change a decision, fixed before a test; a confidence interval inside the bounds means any plausible effect is too small to matter. (Capstone 2. Sales analysis)
Equivalence test (TOST)
A test, built from two one-sided tests, of whether a difference lies within a stated margin. (29. Statistics and probability)
Error bar
A line on a bar or point that shows the uncertainty of the estimate, such as a 95% confidence interval. (28. Visualization)
Error code
The short name in square brackets at the end of a mypy message, such as [arg-type]; used to look the error up or to silence one line. (12. Type hints)
Error correlation
The correlation between the errors of two models on the same rows; it sets a floor on how much averaging the models can reduce the error. (38. Ensembles)
Error term
The part of the outcome that a regression's predictors do not explain; it is never observed, and residuals estimate it. (29. Statistics and probability)
Escape sequence
A backslash code inside a string for one special character, such as \n for a line break. (01. Python basics)
Estimator
In scikit-learn, any object that learns from data with a fit method, such as a model, a scaler or an encoder. (33. Feature engineering)
Estimator API
The shared scikit-learn interface: every estimator learns with fit(), transformers add transform(), and predictors add predict() and score(). (34. The scikit-learn workflow)
ETag
A response header with a version tag of a resource, used for conditional requests and caching. (16. APIs and web data)
ETL
Extract, transform, load: the three steps of a data pipeline that moves data from a source into a target system. (10. Iterators and generators)
Euclidean distance
The straight-line distance between two points: the L2 norm of their difference, sqrt(sum((a - b)**2)). (32. Math for ML)
Euclidean norm
The length of a vector: the square root of the sum of its squared components, written ||v||; abs() returns it for a Vector. (20. The Python data model)
Eval mode
The state set with model.eval(), in which dropout passes values through and batch normalization uses stored statistics; used for validation and prediction. (42. Deep learning with PyTorch)
Event
Something that happens and that observers can react to, such as the end of a training epoch or a button click. (22. Design principles and patterns)
Event hook
A function that an httpx client calls for every request or response, for example to log or count them. (16. APIs and web data)
Event loop
The asyncio scheduler that runs one task until it awaits, then switches to another task that is ready. (15. Performance and concurrency)
Exact duplicate
A row that has the same value as another row in every column. (26. Data cleaning)
Exception
An error that Python raises when it cannot run a line; it has a type, such as ValueError, and a message. (01. Python basics)
Exception chaining
Linking a new exception to the one that caused it with raise ... from err; the original is kept in __cause__. (06. Errors and debugging)
Exception group
An ExceptionGroup (Python 3.11+) that carries several exceptions at once; except* handles the ones of one type. (06. Errors and debugging)
Exception handling
Catching an exception with try and except and deciding what happens next, instead of letting the program stop. (06. Errors and debugging)
Exception hierarchy
The family tree of exception types, in which a specific type such as KeyError is a kind of a general one such as LookupError. (06. Errors and debugging)
Excess kurtosis
A measure of tail heaviness that is 0 for the normal distribution and positive for heavier tails. (29. Statistics and probability)
Executor
A concurrent.futures object that runs tasks on a pool of threads or processes. (15. Performance and concurrency)
Exhausted iterator
An iterator that has given all its items; every later loop over it gets nothing. (10. Iterators and generators)
Exit code
The number a program returns when it ends: 0 means success, any other number means failure. (08. Modules, packages and environments)
ExitStack
A contextlib context manager that collects any number of other context managers and cleanup callbacks and exits them all in reverse order. (11. Decorators and context managers)
Exogenous variable
An outside input to a time-series model, such as a planned marketing budget; its future values must be known to forecast. (40. Time series)
Expanding window
A window that grows from the first row up to the current row. (25. pandas advanced)
Expectation-maximization (EM) algorithm
The fitting method of a Gaussian mixture, which alternates computing each row's component probabilities and updating each component from those probabilities. (39. Unsupervised learning)
Expected frequency
The count a cell of a contingency table would hold if the two variables were independent. (29. Statistics and probability)
Expected loss
The average loss a model would have on all possible new data from the same source; the average loss on held-out data estimates it, while the training average underestimates it. (32. Math for ML)
Expected profit (campaign)
The average money a campaign earns per decision: the chance of success times the value of a success, minus the cost of acting, summed over the customers you act on. (Capstone 4. Customer churn classification)
Expected value
The long-run average of a random variable: each possible value times its probability, added up; also called the expectation. (32. Math for ML)
Experiment (MLflow)
A named group of MLflow runs, such as churn-baseline. (44. ML in production basics)
Experiment tracking
Recording each training run with its settings, results and files in a searchable store. (44. ML in production basics)
explain()
A LazyFrame method that returns the optimized query plan as text, to be read from the bottom up. (31. Polars)
Explained variance ratio
The share of the total variance that one principal component captures. (39. Unsupervised learning)
Explanation object
The result of a shap explainer call, holding the SHAP values, base values, feature values and feature names. (43. Interpretability)
Exploratory data analysis (EDA)
The first, open-ended look at a dataset with summaries and plots, to learn its shape, quality and main patterns before testing or modeling. (27. Exploratory data analysis)
Exponent
Raising a number to a power, written **; 2 ** 10 is 1024. (01. Python basics)
Exponential backoff
A retry strategy that doubles the wait after each failed attempt, for example 1, 2 and 4 seconds. (06. Errors and debugging)
Exponential time
O(c^n) for some c > 1: the work is multiplied by a constant each time n grows by one. (17. Algorithms and data structures)
Exponentially weighted moving average (EWMA)
An average in which each older value gets a smaller weight, so recent values count most. (25. pandas advanced)
Expression
A piece of code that produces a value, such as 120 + 80. (01. Python basics)
Expression (Polars)
A recipe for a column, such as pl.col("revenue") * 0.9, that computes nothing until a context runs it on data. (31. Polars)
Expression namespace
A group of methods for one family of dtypes behind an attribute of an expression, such as .str for text, .dt for dates and .list for lists. (31. Polars)
Extension
An add-on that gives an editor such as VS Code new features. (Start here)
External sort
Sorting data that does not fit in memory: sort chunks, write each to a file, then merge the sorted files. (17. Algorithms and data structures)
Extra
An optional set of dependencies of a package, installed with a name in brackets, such as pandas[excel]. (08. Modules, packages and environments)
Extrapolation
Predicting for inputs outside the range of the training data, where a model's behavior is not supported by examples. (35. Regression)

F

F statistic
The ratio of between-group variance to within-group variance in ANOVA. (29. Statistics and probability)
f-string
A string literal with f before the opening quote, in which expressions in curly braces are replaced by their values. (01. Python basics)
F1 score
The harmonic mean of precision and recall; high only when both are high. (09. Standard library power tools)
FacetGrid
The Seaborn object returned by figure-level functions; it holds the figure and the grid of Axes. (28. Visualization)
Fact table
A table with one row per event, such as an order line, whose id columns point to other tables. (25. pandas advanced)
Factory
A function or method whose job is to create objects, so that callers do not name the concrete class. (22. Design principles and patterns)
Factory fixture
A fixture that returns a function, so a test can build several customized objects, such as rows with some fields changed. (14. Testing with pytest)
Fail fast
Checking inputs and settings at the start of a program, so that a problem stops it with a clear message before any work is done. (07. Files and data formats)
Fake
A simple stand-in for a real component, such as a network call or the clock, that behaves in a controlled way so that tests are repeatable. (11. Decorators and context managers)
False discovery rate (FDR)
The expected share of false positives among the results called significant. (29. Statistics and probability)
False negative (FN)
A positive row that the model wrongly predicts as negative, such as a missed churner. (36. Classification)
False positive
An item that a classifier flags but that does not belong to the positive class. (03. Control flow)
False positive rate (FPR)
The share of real negatives that the model flags, FP / (FP + TN), used on the x-axis of a ROC curve. (36. Classification)
Falsy
A value that counts as False, such as False, 0, 0.0, "" or None. (01. Python basics)
Family-wise error rate (FWER)
The probability of at least one false positive among a family of tests. (29. Statistics and probability)
Fan-out
The multiplication of rows when a join key repeats on one side, which inflates sums and counts. (30. SQL for data analysis)
Fancy indexing
Selecting array elements with an array or list of integer positions, in any order and with repeats; it returns a copy. (23. NumPy)
FastAPI
A Python web framework that uses type hints and pydantic models to validate requests, convert data and document the API. (44. ML in production basics)
Feature
An input column that a model uses to make predictions, such as sqft. (18. Classes and objects)
Feature attribution
Assigning a share of a prediction, or of a model's performance, to each input feature. (43. Interpretability)
Feature engineering
Creating, transforming, encoding and selecting input columns so that a model can learn the real pattern in the data. (33. Feature engineering)
Feature map
The output grid of one convolution kernel; it is high where the input matches the pattern of the kernel. (42. Deep learning with PyTorch)
Feature scaling
Putting numeric features on a similar range so that no feature dominates because of its units. (33. Feature engineering)
Feature selection
Keeping a subset of the candidate features to reduce overfitting, cost and complexity. (33. Feature engineering)
Feature subsampling
Letting each split of a tree choose only among a random subset of the features (max_features), which makes the trees of a random forest less alike. (38. Ensembles)
Feature vector
One row of data written as an ordered list of numbers, one position per feature, such as [sqft, bedrooms, bathrooms] for one house. (32. Math for ML)
Fence
A limit of the IQR rule; values outside the lower or upper fence are flagged. (26. Data cleaning)
Field (dataclass)
A class-level annotated name in a data class, such as model: str, that becomes a parameter of __init__ and an attribute of every instance. (21. Dataclasses, enums and slots)
Field constraint
A rule on a value set with pydantic's Field(), such as ge=18, max_length=100 or a regex pattern. (44. ML in production basics)
Field width
The minimum number of characters a formatted value takes; shorter values are padded, longer ones are never cut. (02. Strings and text)
FIFO
First in, first out: the rule of a queue, where the oldest item is removed first. (17. Algorithms and data structures)
Figure (Matplotlib)
The whole image or window of a Matplotlib chart; it holds one or more Axes. (28. Visualization)
Figure-level function
A Seaborn function that creates its own figure and can split the data into panels with col= and row=, such as relplot. (28. Visualization)
File
A named sequence of bytes stored on a disk, such as data/sales.csv. (07. Files and data formats)
File hash
A fingerprint, such as a SHA-256 value, of a downloaded file; a lock file or requirements file stores it so the installer can verify the file. (08. Modules, packages and environments)
File mode
The second argument of open() that says how to open a file: r (read), w (write and replace), a (append), x (create only), plus b for binary. (07. Files and data formats)
File object
The object that open() returns; it reads from or writes to an open file step by step (also called a file handle). (07. Files and data formats)
File signature
Fixed bytes at the start of a binary file that name its format, such as PAR1 for Parquet (also called a magic number). (07. Files and data formats)
Fill character
The character used for padding in a format spec, a space unless you choose another, as in {x:*^9}. (02. Strings and text)
filter (groupby)
A groupby method that keeps all rows of the groups for which a function returns True and drops the other groups. (25. pandas advanced)
Filter method
A feature selection method that scores each feature with a statistic, such as variance, correlation or mutual information, without fitting the final model. (33. Feature engineering)
Finding
One actionable statement from an analysis, written as a claim backed by evidence and limited by a caveat. (27. Exploratory data analysis)
Fine-tuning
Training a pre-trained network further on new data, often with most layers frozen and only the last layers trainable. (42. Deep learning with PyTorch)
First difference
The change from the previous value, y_t - y_(t-1); in pandas, y.diff(). (40. Time series)
First-class function
A function that is an ordinary object: it can be assigned to a name, stored in a list, passed as an argument and returned. (05. Functions)
Fisher's exact test
An exact test for 2×2 tables, used when expected counts are small. (29. Statistics and probability)
Fitted value
The prediction a model makes for a row, often written y-hat. (35. Regression)
Fixture (pytest)
A function marked with @pytest.fixture that prepares an input or resource; a test receives it by naming it as a parameter. (14. Testing with pytest)
Fixture scope
How often pytest creates a fixture: once per test (function), class, module, package or session. (14. Testing with pytest)
Flag
An option without a value that switches a feature on, such as --share; argparse uses action="store_true". (08. Modules, packages and environments)
Flag (enum)
An enum whose members can be combined with |, such as Check.NULLS | Check.RANGE, and tested with in. (21. Dataclasses, enums and slots)
Flag variable
A variable that records whether something happened in a loop, such as found = None before a search. (03. Control flow)
Flaky test
A test that sometimes passes and sometimes fails on the same code, for example because of randomness or shared state. (14. Testing with pytest)
Flat layout
A project layout with the package folder at the project root, next to pyproject.toml. (08. Modules, packages and environments)
Flatten
To turn a nested collection, such as a list of lists, into one flat collection. (04. Data structures)
float32
A 32-bit floating-point type with about 7 significant digits; the default dtype for features and weights in deep learning. (42. Deep learning with PyTorch)
Floating-point number (float)
A number with a decimal point, stored in binary with about 15 to 17 significant digits, such as 21.7. (01. Python basics)
Floor division
Division that rounds down to a whole number, written //; 250 // 12 is 20. (01. Python basics)
Flow (time series)
A quantity measured per period, such as revenue or visits per day; it is downsampled with sum. (40. Time series)
Fluent interface
An API whose methods return self, so that calls chain: builder.add(...).add(...).build(). (22. Design principles and patterns)
Fold
Combining a sequence into one value by applying a two-argument function step by step; functools.reduce does this. (09. Standard library power tools)
Fold (cross-validation)
One of the k parts into which cross-validation splits the data. (33. Feature engineering)
For loop
A statement that runs its indented block once for each item of a sequence, as in for region in regions:. (02. Strings and text)
Forecast
A prediction of values of a time series that do not exist yet, made from the values known up to now. (40. Time series)
Forecast combination
A forecast made by averaging the forecasts of several models; their errors partly cancel, so it often beats each model alone. (Capstone 6. Demand forecasting)
Forecast horizon
How far ahead a forecast predicts, for example 28 days after the forecast origin. (40. Time series)
Forecast origin
The last time point whose value is known when a forecast is made. (40. Time series)
Foreign key
A column that holds the primary key of a row in another table, such as store_id in the sales table. (26. Data cleaning)
forkserver
A start method that runs one small server process, which starts a fresh worker for each request; the Linux default from Python 3.14. (15. Performance and concurrency)
Format spec
A short code after a colon in an f-string field that controls how a value looks, such as :.2f for 2 decimals. (01. Python basics)
Format spec mini-language
The small grammar of format specs: [[fill]align][sign][z][#][0][width][grouping][.precision][type]. (02. Strings and text)
Formatter
A tool that rewrites the layout of your code into one consistent style. (Start here)
Formula API
The statsmodels interface (statsmodels.formula.api) that describes a model as a string such as "price ~ sqft". (29. Statistics and probability)
Forward fill
Filling a gap with the last known value before it (ffill); backward fill (bfill) uses the next known value. (26. Data cleaning)
Forward pass
Computing the outputs and the loss of a model from its inputs. (42. Deep learning with PyTorch)
Forward reference
A type hint written as a string, such as "Dataset", for a name that does not exist yet when the annotation is evaluated. (18. Classes and objects)
forward()
The method of an nn.Module that defines the computation; you run it by calling the module, model(x), not model.forward(x). (42. Deep learning with PyTorch)
Forwarding
Passing arguments that a function received, often through **kwargs, on to another function unchanged. (05. Functions)
Fourier terms
Sine and cosine waves with a fixed period, such as a year, used as regressors to give a model a smooth seasonal shape. (Capstone 6. Demand forecasting)
Fragile base class problem
The risk that a change in a parent class breaks subclasses that its author never saw. (19. Inheritance and polymorphism)
Frame
One entry of the call stack: one function call with its own local variables and current line. (06. Errors and debugging)
Free variable
A name used in a function but defined in an enclosing function's scope; a closure keeps its free variables alive. (05. Functions)
Free-threaded build
An optional CPython build without the GIL (experimental in 3.13, supported in 3.14), in which threads run Python code in parallel. (15. Performance and concurrency)
Frequency (time series)
The fixed step between the rows of a time-series index, such as one day; set with asfreq. (40. Time series)
Frequency table
A table of each distinct value and how often it occurs, built in pandas with `value_counts()`. (24. pandas fundamentals)
Frobenius norm
The Euclidean length of a matrix treated as a flattened vector: the square root of the sum of all squared entries, equal to the square root of the sum of squared singular values. (46. Linear algebra in depth)
Frozen dataclass
A data class created with @dataclass(frozen=True): assignments after __init__ raise FrozenInstanceError, and instances are hashable. (21. Dataclasses, enums and slots)
Frozen distribution
A scipy.stats distribution object with its parameters fixed, such as stats.norm(loc=21, scale=0.5). (29. Statistics and probability)
FrozenInstanceError
The exception (a subclass of AttributeError) that a frozen dataclass raises when code assigns to or deletes one of its fields. (21. Dataclasses, enums and slots)
frozenset
An immutable set, which can itself be a dict key or a set element. (04. Data structures)
Full join
A join that keeps every row of both tables, with NULLs on the side that has no match (FULL OUTER JOIN). (30. SQL for data analysis)
Function
A named piece of code that does one job; you call it with its name and parentheses, such as print(). (01. Python basics)
Function body
The indented block of statements under a def line; it runs each time the function is called. (05. Functions)
Function definition
A def statement that creates a function: the keyword def, a name, a parameter list in parentheses, a colon and an indented body. (05. Functions)
Function factory
A function that builds and returns a new function, usually a closure configured by the factory's arguments. (05. Functions)
FunctionTransformer
A scikit-learn transformer that wraps a plain function, such as np.log1p, so that it can be a step in a pipeline. (34. The scikit-learn workflow)
functools.partial
A function that returns a new function with some arguments of another function already filled in. (09. Standard library power tools)
functools.total_ordering
A class decorator that writes the missing ordering methods from __eq__ and one of __lt__, __le__, __gt__ or __ge__. (20. The Python data model)
functools.wraps
A decorator for wrapper functions that copies the wrapped function's name, docstring, module and type hints and adds __wrapped__. (11. Decorators and context managers)
Future
An object that stands for the result of a task that may not have finished yet; result() waits for it. (15. Performance and concurrency)

G

Gains table
A table of rows sorted into score deciles, with the positive rate, lift and cumulative share of positives captured per decile. (36. Classification)
Galloping
A Timsort merge trick: when one side wins many comparisons in a row, it jumps ahead with a binary search instead of comparing element by element. (17. Algorithms and data structures)
Gang of Four
The four authors of the 1994 book Design Patterns (Gamma, Helm, Johnson and Vlissides), which named 23 classic object-oriented patterns. (22. Design principles and patterns)
Gaussian mixture model (GMM)
A model that describes the data as a weighted mix of several normal distributions and gives each row a probability for each of them. (39. Unsupervised learning)
Gaussian naive Bayes
Naive Bayes that models each feature within each class as a normal distribution with its own mean and variance. (36. Classification)
Generalization
How well a model predicts on new data that it did not see during training. (34. The scikit-learn workflow)
Generalization error
The expected error of a model on new data from the same source, which you estimate on held-out rows. (37. Model evaluation and tuning)
Generalization gap
The difference between the training score and the validation score; a large gap signals overfitting. (37. Model evaluation and tuning)
Generalized Linear Model (GLM)
A regression framework extending linear models to non-normal outcomes (binary, count, positive skewed) via an exponential-family distribution and a link function. (49. Causal inference, GLMs and advanced experimentation)
Generator
The iterator returned by a generator function or a generator expression; it runs its code lazily, one item at a time. (10. Iterators and generators)
Generator expression
A comprehension in parentheses that produces its values lazily, one at a time, as in sum(o["amount"] for o in orders). (04. Data structures)
Generator function
A function that contains yield; calling it returns a generator instead of running its body. (10. Iterators and generators)
Generator state
Where a generator paused and the values of its local variables; inspect.getgeneratorstate() reports CREATED, SUSPENDED or CLOSED. (10. Iterators and generators)
GeneratorExit
The exception that gen.close() raises inside a paused generator so that its finally and with blocks run. (10. Iterators and generators)
Generic class
A class with type parameters, such as class Box[T], whose objects remember the item type, for example Box[float]. (12. Type hints)
Generic function
A function written for any item type, such as def take[T](n: int, it: Iterable[T]) -> list[T] (Python 3.12+ syntax). (10. Iterators and generators)
Generic type
A type that takes other types as parameters in square brackets, such as list[float] or dict[str, int]. (12. Type hints)
get_feature_names_out
The method that returns the names of a fitted transformer's output columns, such as cat__contract_one-year after one-hot encoding. (34. The scikit-learn workflow)
Getter
The method of a property that returns its value. (18. Classes and objects)
Gini impurity
A measure of how mixed the classes in a tree node are, 1 minus the sum of squared class shares; 0 for a pure node. (36. Classification)
Glob pattern
A file-name pattern with wildcards, such as *.csv or 2024-0[1-3].csv, used by glob() and rglob(). (07. Files and data formats)
Global explanation
An explanation of how a model behaves over the whole dataset, such as which features matter most on average. (43. Interpretability)
Global interpreter lock (GIL)
The lock in CPython that a thread must hold to run Python code, so one thread per process runs Python code at a time. (15. Performance and concurrency)
Global variable
A name assigned at the top level of a module; every function in the module can read it. (05. Functions)
Golden test
A test that compares a result with a stored, known-good result, for example the scores that training gave a few customers, to catch any change in behavior. (Capstone 8. Deployment)
Google-style docstring
A docstring layout with sections such as Args:, Returns: and Raises: and indented entries; this course uses it. (05. Functions)
Gotcha
A language behavior that surprises most people the first time and causes bugs, such as a mutable default argument. (13. Pythonic code)
Gradient
The slope of the error with respect to a parameter; it shows in which direction the error grows. (03. Control flow)
Gradient (vector)
The vector of all partial derivatives of a function with several inputs; it points in the direction in which the function grows fastest. (32. Math for ML)
Gradient accumulation
The PyTorch rule that backward() adds new gradients to .grad instead of replacing them; it is why each training step starts with zero_grad(). (42. Deep learning with PyTorch)
Gradient boosting
An ensemble that adds small trees one after another, each fitted to the current residuals and scaled by a learning rate. (35. Regression)
Gradient check
Comparing an analytic gradient with a numerical one to find bugs before training. (32. Math for ML)
Gradient descent
An algorithm that improves a model's parameters step by step by moving them against the slope of the error. (03. Control flow)
Gradual typing
Adding type hints step by step; the checker checks the typed parts and leaves the untyped parts alone. (12. Type hints)
Gram–Schmidt process
An algorithm that turns linearly independent columns into an orthonormal basis by repeatedly subtracting projections onto previously built directions. (46. Linear algebra in depth)
Graph
A set of nodes connected by edges, where any node can connect to any other and loops are allowed. (17. Algorithms and data structures)
Greedy algorithm
An algorithm that builds a solution by making the locally best choice at each step, which is optimal only when the problem has the greedy-choice property. (45. Algorithms and data structures II)
Greedy quantifier
A quantifier that matches as many characters as possible; the default in Python regex. (09. Standard library power tools)
Tuning by trying every combination of a few candidate values for each setting. (09. Standard library power tools)
Gross profit
Revenue minus the cost of the goods sold: revenue − unit cost × quantity. (28. Visualization)
Group k-fold
Cross-validation that keeps all rows of one group, such as one customer, in the same fold. (37. Model evaluation and tuning)
Group key
The column or values that decide which group a row belongs to in a groupby. (25. pandas advanced)
Group leakage
An inflated score caused by rows of the same entity appearing in both the training and the validation data. (37. Model evaluation and tuning)
Group-wise imputation
Filling each gap with a statistic, such as the median, of the row's own group. (26. Data cleaning)
GroupBy object
What groupby returns: a plan that records which rows belong to which group and computes nothing until you ask for a result. (25. pandas advanced)
Grouping
Collecting records under a shared key, such as all order lines of one region. (09. Standard library power tools)
Guard
A check of a precondition before the code that needs it, such as if readings: before a mean; in match, an if condition after a pattern. (03. Control flow)
Guardrail metric
A metric that must not get worse in an experiment, even if the main metric improves. (29. Statistics and probability)

H

Half-life
The number of rows after which a value's weight in an EWMA has halved. (25. pandas advanced)
Half-open interval
An interval that includes its start and excludes its end, as range(0, 60, 10) does. (03. Control flow)
Handler
The part of logging that sends messages to a destination, such as the terminal or a file. (06. Errors and debugging)
Happy path
The normal input for which code works as intended, without errors or edge cases. (14. Testing with pytest)
Hard assignment
Giving each row exactly one cluster, as k-means does. (39. Unsupervised learning)
Hard voting
Voting that combines the predicted class labels by majority; it gives no probabilities. (38. Ensembles)
Harmonic mean
The reciprocal of the mean of the reciprocals; it is pulled toward the smallest value, so the F1 score is high only when precision and recall are both high. (09. Standard library power tools)
has-a relationship
The relation that composition models: an object holds another object as a part, such as a pipeline has a scaler. (19. Inheritance and polymorphism)
Hash
A whole number computed from a value, which tells a set or dict where to store and find it. (04. Data structures)
Hash contract
The rule that equal objects must have equal hashes: if a == b, then hash(a) == hash(b). (20. The Python data model)
Hash manifest
A file that lists the SHA-256 hash of each file in a folder, so a loader can detect any changed file; it shows change, not who made the files. (Capstone 8. Deployment)
Hash map
A structure that finds a value by its key in constant time on average by hashing the key; a Python dict is one. (17. Algorithms and data structures)
Hash table
The internal table that sets and dicts use to find a value or key from its hash in constant time. (04. Data structures)
Hashable
Having a hash that never changes; immutable built-in values are hashable, lists, dicts and sets are not. (04. Data structures)
HAVING
The SQL clause that filters groups after GROUP BY, using conditions on aggregates. (30. SQL for data analysis)
Hazard rate
The instantaneous rate at which the event occurs at time t, given that the unit has survived up to time t. (49. Causal inference, GLMs and advanced experimentation)
HC3 standard errors
Heteroscedasticity-robust standard errors for OLS, requested with fit(cov_type="HC3") in statsmodels. (29. Statistics and probability)
HDBSCAN
Hierarchical DBSCAN: a density-based clusterer that tries many eps values and keeps the most stable clusters, so it needs only a minimum cluster size; it labels noise -1. (39. Unsupervised learning)
A name-value pair of metadata in a request or response, such as Content-Type or Authorization; names are case-insensitive. (16. APIs and web data)
Header row
The first row of a CSV file, which holds the column names. (07. Files and data formats)
Health check endpoint
An endpoint such as /health that reports whether a service is up and which model it serves; load balancers call it often. (44. ML in production basics)
Heap
A list arranged so that every element is less than or equal to its two children at indices 2k + 1 and 2k + 2; the heapq module maintains it. (17. Algorithms and data structures)
Heap property
The rule heap[k] <= heap[2k + 1] and heap[k] <= heap[2k + 2] that keeps the smallest element of a heap at index 0. (17. Algorithms and data structures)
Heatmap
A grid of colored cells in which the color shows the value, used for correlation matrices and pivot tables. (27. Exploratory data analysis)
Hessian matrix
The symmetric p-by-p matrix of all second-order partial derivatives of a scalar function, measuring local curvature along every direction. (47. Calculus and optimization for ML)
Heteroscedasticity
Error spread that changes with the fitted values or the predictors, which makes classic OLS standard errors wrong. (29. Statistics and probability)
Hexadecimal
Base-16 notation with the digits 0-9 and a-f; bytes and code points are often written in it, as in 0xe9 or U+00E9. (02. Strings and text)
Hexbin
A 2-D histogram that counts points in hexagonal cells and colors each cell by its count, used against overplotting. (28. Visualization)
Hidden file
A file whose name starts with a dot, such as .DS_Store; file browsers hide it, but glob() and walk() still find it. (07. Files and data formats)
Hidden layer
Any layer between the input and the output of a network; its outputs are learned features, not predictions. (42. Deep learning with PyTorch)
Hierarchical clustering
Clustering that builds a tree of nested clusters instead of one flat split. (39. Unsupervised learning)
High cardinality
A categorical feature with many distinct categories, such as postcodes or product ids. (33. Feature engineering)
High-water mark
The saved position up to which a job has processed its input, so that a restarted job resumes from there. (10. Iterators and generators)
Higher-order function
A function that takes another function as an argument or returns one, such as sorted(), map() or a function factory. (05. Functions)
Highest posterior density (HPD) interval
The narrowest credible interval containing a specified share of posterior probability mass, useful for skewed posteriors. (48. Probability, Bayesian statistics and information theory)
Histogram
A chart that splits the value range into bins and draws one bar per bin, as high as the number of values in it. (27. Exploratory data analysis)
Histogram-based gradient boosting
A fast gradient boosting method that first sorts each feature into at most 255 bins; in scikit-learn it is HistGradientBoostingRegressor and handles missing values and categories natively. (35. Regression)
Hold-out set
Rows set aside before training and used once at the end to estimate how the chosen model generalizes; another name for the test set. (34. The scikit-learn workflow)
Holdout
The last part of a time series, hidden from every modeling choice and used once at the end to test the final model. (40. Time series)
Homogeneous
Made of elements of one type; every element of a NumPy array has the same dtype. (23. NumPy)
Homoscedasticity
Constant spread of the regression errors across all fitted values; an assumption of classic OLS standard errors. (29. Statistics and probability)
Hook
A method that a base class calls at a fixed step and that a subclass may override to change that step. (19. Inheritance and polymorphism)
Hotspot
The part of a program where most of the run time goes; also called a bottleneck. (15. Performance and concurrency)
HTML
HyperText Markup Language: the text format of web pages, made of nested tags. (16. APIs and web data)
HTML attribute
A name="value" pair in a start tag, such as class="price" or data-id="P001". (16. APIs and web data)
HTML element
A start tag, its content and its end tag, such as <td>P001</td>; elements nest into a tree. (16. APIs and web data)
HTML entity
An escape code in HTML such as &amp; for & or &#x27; for an apostrophe. (16. APIs and web data)
HTTP
The HyperText Transfer Protocol: the rules that web clients and servers follow to exchange requests and responses. (16. APIs and web data)
HTTP method
The verb of a request that says what the client wants, such as GET (read) or POST (create). (16. APIs and web data)
HTTP status code
The number a web server returns with each response, such as 200 (success), 429 (too many requests) or 503 (server error). (03. Control flow)
HTTPS
HTTP over an encrypted connection; APIs that need a key always use it. (16. APIs and web data)
httpx
A third-party HTTP library with a requests-like API, async support and a built-in mock transport. (16. APIs and web data)
Huber loss
A smooth regression loss that behaves quadratically for small residuals and linearly for large residuals, combining outlier robustness with differentiability at zero. (47. Calculus and optimization for ML)
Hyperparameter
A setting chosen before training, such as the learning rate, rather than a value the model learns. (03. Control flow)
Hyperparameter tuning
Searching for the hyperparameter values that give the best cross-validated score. (37. Model evaluation and tuning)
Hypothesis test
A procedure that decides whether data gives enough evidence against a null hypothesis. (29. Statistics and probability)

I

I/O-bound
Describes code that spends most of its time waiting for input/output: network, disk or a database. (15. Performance and concurrency)
IANA time-zone database
The public database of time-zone rules, with names such as America/Chicago, that zoneinfo reads. (09. Standard library power tools)
Idempotency key
A unique id sent with a POST so that the server performs the action only once, which makes a retry safe. (16. APIs and web data)
Idempotent
Giving the same result whether it runs once or many times; a pipeline that writes with mode w is idempotent. (07. Files and data formats)
Identity
The property of being the very same object in memory; a is b tests identity, while a == b tests equal values. (13. Pythonic code)
Identity matrix
A square matrix with 1 on the diagonal and 0 elsewhere; multiplying by it changes nothing. (23. NumPy)
Idiom
A common, accepted way to express one small idea in a language, such as for item in items: to visit every item. (13. Pythonic code)
if statement
A branch that runs its block when its condition is true, optionally followed by elif and else branches. (03. Control flow)
imbalanced-learn
A scikit-learn-compatible library of resampling methods and a pipeline that resamples during fit only. (37. Model evaluation and tuning)
Immutable
Not changeable after creation; strings are immutable, so every string method returns a new string. (02. Strings and text)
Import
The statement that finds a module, runs its code once and binds a name for it in your namespace. (08. Modules, packages and environments)
Impurity-based feature importance
A tree model's measure of how much each feature's splits reduce the error; fast, but biased toward continuous and high-cardinality features. (33. Feature engineering)
Imputation
Filling a missing value with an estimated value, such as a median, a group median or an interpolated value. (26. Data cleaning)
Imputer
A step that fills missing values with a substitute value, such as the median of the column learned from the training rows. (22. Design principles and patterns)
In-memory database
A database that lives only in RAM and disappears when its connection closes, made with sqlite3.connect(":memory:"). (30. SQL for data analysis)
In-place algorithm
An algorithm that changes its input directly and needs only a constant amount of extra memory, such as list.sort(). (17. Algorithms and data structures)
In-place operator
An augmented assignment such as += that calls __iadd__ when it exists, and otherwise falls back to a = a + b. (20. The Python data model)
InconsistentVersionWarning
The warning scikit-learn gives when it loads a model that was saved with a different scikit-learn version. (34. The scikit-learn workflow)
Indentation
The spaces at the start of a line; Python uses them to mark which block a statement belongs to (4 spaces per level). (03. Control flow)
IndentationError
The error Python raises before a script runs when a block is missing or indented wrongly. (03. Control flow)
Independent events
Events where knowing one does not change the probability of the other: P(A | B) = P(A). (32. Math for ML)
Index
The position of an item in a sequence, written in square brackets, as in s[0]. (02. Strings and text)
Index (pandas)
The row labels of a Series or DataFrame (or the column labels in `df.columns`); pandas uses it to look up and align rows. (24. pandas fundamentals)
Index alignment
The pandas rule that arithmetic between two Series pairs values by label, not by position; labels present on one side only give NaN. (24. pandas fundamentals)
Index level
One layer of a MultiIndex, such as region or year. (25. pandas advanced)
IndexError
The exception Python raises when an index is outside the valid range, such as "S01"[3]. (02. Strings and text)
Indicator column
The _merge column that indicator=True adds to a merge result: left_only, right_only or both. (25. pandas advanced)
Individual conditional expectation (ICE) curve
A curve of one row's prediction as only one feature changes; the partial dependence is the average of the ICE curves. (43. Interpretability)
Inertia
The sum of the squared distances from each row to its own cluster centroid; also called the within-cluster sum of squares (WCSS). (39. Unsupervised learning)
Inferential statistics
Methods that draw conclusions about a population from a sample, with a stated uncertainty. (29. Statistics and probability)
Infinite loop
A loop whose condition never becomes false, so the program never stops on its own. (03. Control flow)
Inheritance
Building a new class on an existing one, so that the new class reuses the parent's attributes and methods and can add or change some. (19. Inheritance and polymorphism)
Initializer (__init__)
The method Python calls on a new object to set its starting attributes; it must return None. (18. Classes and objects)
InitVar
A dataclass annotation for an __init__ argument that is passed to __post_init__ but not stored as a field. (21. Dataclasses, enums and slots)
Inner join
A merge that keeps only the keys found in both tables. (25. pandas advanced)
inplace
An old pandas argument (`inplace=True`) that changes an object instead of returning a new one; pandas 3.1 deprecates it on most methods, such as sort_values and dropna, with a Pandas4Warning. (24. pandas fundamentals)
Insertion order
The order in which keys were added to a dict; Python dicts keep it. (04. Data structures)
Insertion point
The index where a value would go to keep a sorted list sorted; bisect_left and bisect_right return it. (17. Algorithms and data structures)
Insertion sort
A simple O(n²) sorting algorithm that moves each value left past every larger value. (15. Performance and concurrency)
inspect.signature()
A function that returns the parameters and type hints of a callable; its bind() method matches call arguments to parameter names. (11. Decorators and context managers)
Instance
One object created from a class, for example Timer() creates one Timer instance. (11. Decorators and context managers)
Instance attribute
An attribute stored on one object, usually created with self.name = value in __init__. (18. Classes and objects)
Instance namespace
The dict that holds an object's own attributes; vars(obj) returns it. (18. Classes and objects)
Instantiate
To create a new instance by calling a class, as in SensorReading("S1", 20.21). (18. Classes and objects)
Integer (int)
A whole number, such as 3, -12 or 20228. (01. Python basics)
Integer division
Division that drops the fractional part; SQLite divides two integers this way, so 5 / 2 is 2. (30. SQL for data analysis)
Integer overflow
A result that does not fit in an integer dtype and silently wraps around, as 100 + 100 = -56 in int8. (23. NumPy)
Integrated terminal
A terminal panel inside VS Code that starts in the project folder. (Start here)
Integration test
A test that checks that several parts work together, such as reading, cleaning and writing a file. (14. Testing with pytest)
IntEnum
An enum whose members are also integers, so they compare and sort as ints, as in http.HTTPStatus. (21. Dataclasses, enums and slots)
Interaction
A situation in which the effect of one variable depends on the level of another, such as tickets raising churn only on month-to-month contracts. (27. Exploratory data analysis)
Interaction feature
The product of two features, which lets the effect of one feature depend on the value of the other. (33. Feature engineering)
Interactive chart
A chart in a web page that the reader can hover over, zoom into and filter. (28. Visualization)
Intercept
The regression's predicted outcome when all predictors are 0. (29. Statistics and probability)
Interface
The attributes and methods of an object that other code is meant to use. (18. Classes and objects)
Interface segregation principle
No code should depend on methods it does not use; prefer several small interfaces to one large one. (22. Design principles and patterns)
Interning
Storing one shared copy of a string and reusing it; CPython interns many strings from the source code, but not strings built at run time. (13. Pythonic code)
Interpolation
Estimating a missing value in an ordered series from its neighbors, for example with a straight line between the values before and after the gap. (26. Data cleaning)
Interpretability
The degree to which a person can understand why a model makes its predictions. (43. Interpretability)
Interpreter
The program that reads Python code and runs it. (Start here)
Interquartile range (IQR)
The difference Q3 - Q1, the width of the middle half of the data. (26. Data cleaning)
Interval coverage
The share of actual values that fall inside their prediction intervals; a 90% interval method should cover about 90% of new values. (Capstone 3. House price regression)
Intrinsically interpretable model
A model whose logic you can read directly, such as a linear model with few features or a shallow decision tree. (43. Interpretability)
Invariant
A condition that must always hold, such as valid + broken lines == all lines; a good target for assert. (03. Control flow)
Invariant (typing)
A generic type whose type arguments must match exactly: list[int] is not accepted as list[float]. (12. Type hints)
Inverse document frequency (IDF)
A weight that is high for terms that appear in few documents; scikit-learn uses ln((1 + n) / (1 + df)) + 1. (41. NLP fundamentals)
Inverse matrix
The matrix A⁻¹ with A⁻¹A = I; it exists only for square matrices whose determinant is not 0. (23. NumPy)
Inverse Probability Weighting (IPW)
An observational causal estimator that reweights treated units by 1 / e(X) and control units by 1 / (1 - e(X)) to balance confounders. (49. Causal inference, GLMs and advanced experimentation)
Inversion of control
A design in which a framework or base class calls your code, instead of your code calling it. (22. Design principles and patterns)
io.StringIO
A file object that keeps its text in memory instead of on disk. (11. Decorators and context managers)
IQR rule
An outlier rule, also called Tukey's fences, that flags values below Q1 - 1.5 IQR or above Q3 + 1.5 IQR. (26. Data cleaning)
Irreducible error
The noise in the target that no model can remove; it sets a floor for the expected error. (37. Model evaluation and tuning)
is-a relationship
The relation that inheritance models: a child is a kind of its parent, such as a LinearRegression is an estimator. (19. Inheritance and polymorphism)
ISO 8601
The international standard for writing dates and times with the largest unit first, such as 2024-05-01T08:25:13. (09. Standard library power tools)
ISO week
A week from Monday to Sunday, numbered 1 to 52 or 53 within its ISO year. (09. Standard library power tools)
Isolation Forest
An anomaly detector that isolates rows with random cuts; rows that need few cuts get a low score and count as anomalies. (39. Unsupervised learning)
Isotonic regression
A free-form increasing step function; used for calibration with method='isotonic' when there are enough rows. (36. Classification)
Item
In a dict, one pair of a key and its value; more generally, an element of a container. (04. Data structures)
itemgetter
operator.itemgetter(key) returns a function that looks up that key or index; a fast replacement for lambda row: row[key]. (09. Standard library power tools)
iter()
A built-in function that asks an iterable for an iterator; on an iterator it returns the same object. (10. Iterators and generators)
Iterable
Any object that a for loop can walk through item by item, such as a list, a string, a dict or a range. (03. Control flow)
Iteration
One pass through the block of a loop. (03. Control flow)
Iteration protocol
The rules that make looping work: iter() returns an iterator, next() returns items, and StopIteration marks the end. (10. Iterators and generators)
Iterator
An object that produces values one at a time when asked and is used up after one pass; map() and filter() return iterators. (05. Functions)
itertools
The standard-library module of fast, lazy building blocks for loops: chain, islice, batched, accumulate, pairwise, groupby, product, combinations and more. (09. Standard library power tools)
Itertools recipe
A short helper function built from itertools tools, listed in the Python docs, such as take, sliding_window or unique_everseen. (10. Iterators and generators)
itertools.batched()
An itertools function (Python 3.12+) that yields tuples of up to n items from an iterable. (10. Iterators and generators)
itertools.chain.from_iterable()
Flattens an iterable of iterables into one stream, taking each inner iterable only when it is needed. (10. Iterators and generators)
itertools.dropwhile()
Skips items while a predicate is true, then yields every remaining item. (10. Iterators and generators)
itertools.islice()
A lazy slice of an iterator by position: islice(it, stop) or islice(it, start, stop, step). (10. Iterators and generators)
itertools.takewhile()
Yields items while a predicate is true, then stops at the first item for which it is false. (10. Iterators and generators)
itertools.tee()
Splits one iterator into n independent iterators; it buffers the items that one copy has seen and another has not. (10. Iterators and generators)

J

Jacobian matrix
The m-by-p matrix of all first-order partial derivatives of a vector-valued function mapping p inputs to m outputs. (47. Calculus and optimization for ML)
Jensen-Shannon (JS) divergence
A symmetric, finite, bounded version of KL divergence computed against the midpoint distribution, widely used for production drift detection. (48. Probability, Bayesian statistics and information theory)
Jitter
A random part added to a retry wait, so that many clients do not retry at the same moment. (15. Performance and concurrency)
joblib
A Python library, installed with scikit-learn, whose dump() and load() functions save and restore Python objects such as fitted pipelines, using pickle. (34. The scikit-learn workflow)
Join
A SQL operation that combines rows of two tables; every pair of rows that meets the join condition becomes one output row. (30. SQL for data analysis)
Join cardinality
How many rows on each side of a merge can share a key: one-to-one, one-to-many, many-to-one or many-to-many. (25. pandas advanced)
Join condition
The expression after ON that decides which pairs of rows a join combines, usually a foreign key equal to a primary key. (30. SQL for data analysis)
Join key
A column whose values identify matching rows in two tables, such as store_id. (25. pandas advanced)
Join validation
A check, set with validate="m:1", "1:1" or "1:m", that raises an error when the join keys have unexpected duplicates. (31. Polars)
Joint distribution
A probability distribution over two or more random variables simultaneously, giving the likelihood of every combination of outcomes. (48. Probability, Bayesian statistics and information theory)
JSON
JavaScript Object Notation: a text format for data built from objects, arrays, strings, numbers, true/false and null. (04. Data structures)
JSON Lines
A text format with one complete JSON object per line (.jsonl); records can be appended and read one at a time. (07. Files and data formats)
json_normalize
The pandas function `pd.json_normalize` that flattens nested JSON records into a table, with dotted column names such as `address.city`. (24. pandas fundamentals)

K

k-distance plot
A plot of every point's distance to its k-th nearest neighbor, sorted; its bend suggests a value for DBSCAN's eps. (39. Unsupervised learning)
k-fold cross-validation
An evaluation that cuts the data into k folds, trains on k - 1 of them and scores on the remaining one, k times, and reports the mean and spread of the k scores. (34. The scikit-learn workflow)
k-means
A clustering algorithm that splits rows into k clusters by repeatedly assigning each row to its nearest centroid and moving each centroid to the mean of its rows. (39. Unsupervised learning)
k-means++
The default way to choose the starting centroids of k-means, which picks them far apart from each other. (39. Unsupervised learning)
k-nearest neighbors (KNN)
A model that predicts the label of a point from the labels of its k closest training points. (18. Classes and objects)
k-way merge
Merging k sorted inputs into one sorted output by always taking the smallest front item, usually with a heap; heapq.merge does it. (17. Algorithms and data structures)
Kaplan–Meier estimator
A non-parametric product-limit method for estimating the survival function S(t) from time-to-event data that includes right-censored observations. (49. Causal inference, GLMs and advanced experimentation)
KD-tree
A space-partitioning binary tree that splits k-dimensional points along alternating axes to accelerate nearest-neighbor and radius queries in low dimensions. (45. Algorithms and data structures II)
keepdims
An aggregation option that keeps the reduced axis with length 1, so the result still broadcasts against the input. (23. NumPy)
Kernel (SVM)
A similarity function that lets an SVM draw curved boundaries without building new features explicitly. (36. Classification)
Kernel density estimate (KDE)
A smooth estimate of a distribution made by placing a small bell curve on each value and adding them up. (28. Visualization)
Key
The name under which a dictionary stores a value; record["sensor_id"] looks up the key "sensor_id". (03. Control flow)
Key duplicate
A row that has the same primary key as another row but may differ in other columns. (26. Data cleaning)
Key function
A function that sorted(), min() and max() call on each item to get the value to compare. (05. Functions)
Keyword
A word that Python reserves for its own grammar, such as if, for, class, True or None; it cannot be a variable name. (01. Python basics)
Keyword argument
An argument passed with a name, such as sep="-" in print(). (01. Python basics)
Keyword-only field
A dataclass field that must be passed by name to __init__; set with kw_only=True, field(kw_only=True) or the KW_ONLY sentinel. (21. Dataclasses, enums and slots)
Keyword-only parameter
A parameter after a bare * or after *args in a definition; callers must pass it by name. (05. Functions)
KISS
"Keep it simple": prefer the simplest design that works. (22. Design principles and patterns)
KL divergence
Kullback-Leibler divergence: a measure of how different two probability distributions are; t-SNE minimizes it between neighbor probabilities in the data and on the map. (39. Unsupervised learning)
Kolmogorov axioms
The three foundational rules of probability: non-negativity, total probability equal to one, and additivity for mutually exclusive events. (48. Probability, Bayesian statistics and information theory)
Kolmogorov–Smirnov test (KS test)
A test that compares two samples of a numeric variable; its statistic D is the largest gap between their ECDFs. (44. ML in production basics)
KPI
Key performance indicator: one number a business tracks to judge performance, such as revenue or growth. (02. Strings and text)
Kruskal–Wallis test
A rank-based alternative to one-way ANOVA for skewed, outlier-prone or ordinal data. (29. Statistics and probability)
Kullback-Leibler (KL) divergence
An asymmetric, non-negative measure of the extra information lost when approximating a reference distribution P with another distribution Q. (48. Probability, Bayesian statistics and information theory)
KW_ONLY
A sentinel from dataclasses; a pseudo-field annotated with it makes every field after it keyword-only. (21. Dataclasses, enums and slots)

L

L-BFGS
Limited-memory BFGS, a quasi-Newton optimizer that approximates inverse Hessian curvature from recent gradient differences in O(m*p) memory. (47. Calculus and optimization for ML)
L1 norm
The sum of the absolute values of a vector's elements; the Lasso penalty and the basis of the Manhattan distance. (32. Math for ML)
L1 penalty
A regularization term equal to the sum of the absolute values of the coefficients; it pushes weak coefficients to exactly zero. (33. Feature engineering)
L2 norm
The square root of the sum of the squared elements of a vector, its straight-line length; the same as the Euclidean norm. Its square is the Ridge penalty. (32. Math for ML)
L2 penalty
A regularization term equal to the sum of squared weights; it shrinks all weights smoothly but sets none exactly to zero. (35. Regression)
Label
The name of one row or column in pandas, such as the house id `H0003` or the column name `price`. (24. pandas fundamentals)
Label encoding
Mapping each text label to an integer code, for example basic -> 0, premium -> 1, standard -> 2. (18. Classes and objects)
Label noise
Wrong labels in the training data, such as a review whose star rating contradicts its text; it caps the accuracy a model can reach. (41. NLP fundamentals)
Label-based indexing (loc)
Selecting pandas rows and columns by their labels with `df.loc[rows, cols]`; a label slice includes its end. (24. pandas fundamentals)
Lag
The same series moved back in time by k steps; lag 7 of a day is the same weekday one week earlier. (40. Time series)
LAG and LEAD
Window functions that return a value from a previous or a following row of the window. (30. SQL for data analysis)
Lag feature
A past value of a series used as a feature, such as yesterday's visits to predict today's. (37. Model evaluation and tuning)
Lagrange multiplier
A scalar parameter that enforces a constraint by setting the objective gradient proportional to the constraint gradient at a constrained optimum. (47. Calculus and optimization for ML)
Lambda expression
An expression that creates a small unnamed function whose body is a single expression, such as lambda p: p["price"]. (05. Functions)
Laplace smoothing
Adding a small count (alpha, usually 1) to every word count so that a word never seen with a class does not get probability 0. (41. NLP fundamentals)
Largest remainder method
A rounding method for shares that rounds every share down, then gives the missing points to the largest remainders, so the shown values add up to 100. (02. Strings and text)
Lasso
Linear regression with an L1 penalty, which sets the coefficients of weak features to exactly zero. (33. Feature engineering)
Late binding
Looking up a closure's free variables when the inner function runs, not when it is created, so functions made in a loop all see the loop variable's last value. (05. Functions)
Latency
The time that one request takes, from sending it to receiving the answer. (44. ML in production basics)
Latent Dirichlet allocation (LDA)
A probabilistic topic model in which each document is a mixture of topics and each topic is a probability distribution over words. (41. NLP fundamentals)
Latent semantic analysis (LSA)
Document and word embeddings from a truncated SVD of a TF-IDF matrix, computed with TruncatedSVD. (41. NLP fundamentals)
Latin-1
ISO-8859-1, a one-byte encoding of 256 characters for Western European languages; decoding with it never fails. (02. Strings and text)
Law of large numbers
The result that a sample mean gets closer to the population mean as the sample grows. (29. Statistics and probability)
Law of total probability
The rule that computes an event's probability as the weighted average of its conditional probabilities across a partition of the sample space. (48. Probability, Bayesian statistics and information theory)
Lax mode
pydantic's default validation mode, which converts values when no information is lost, such as "34" to 34. (44. ML in production basics)
Layer (neural network)
One building block of a network that turns an input tensor into an output tensor, such as a linear layer or a convolution. (42. Deep learning with PyTorch)
Lazy API
The Polars style in which calls build a query plan that runs only when you call collect(), after the optimizer has rewritten it. (31. Polars)
Lazy evaluation
Computing values only when they are requested; map() and filter() return lazy iterators that produce one item at a time. (05. Functions)
Lazy quantifier
A quantifier followed by ?, such as .*?, that matches as few characters as possible. (09. Standard library power tools)
LazyFrame
A Polars object that describes a query (its data source and steps) without holding the result; collect() turns it into a DataFrame. (31. Polars)
LBYL
Look before you leap: check a condition before an operation, for example if key in data. (06. Errors and debugging)
Leaf
A node of a tree with no children, such as a product at the bottom of a catalog tree. (17. Algorithms and data structures)
Leaf tensor
A tensor created directly by the user rather than by an operation; after backward(), a leaf with requires_grad=True holds its gradient in .grad. (42. Deep learning with PyTorch)
Leaf-wise tree growth
Growing a tree by always splitting the leaf with the largest loss reduction, as LightGBM does, instead of filling one depth level at a time. (38. Ensembles)
Leakage suspect
A column that may carry information unavailable at prediction time, for example one computed from the target or recorded after the outcome. (27. Exploratory data analysis)
Learned attribute
An attribute that fit() computes from data, named with a trailing underscore in scikit-learn style, such as coef_ or mean_. (18. Classes and objects)
Learning curve
A plot of training and validation scores against the number of training rows, used to decide whether more data will help. (37. Model evaluation and tuning)
Learning path
An ordered list of modules for one goal, such as data analyst. (Start here)
Learning rate
The factor that sets how large each gradient descent step is. (03. Control flow)
Learning-rate schedule
A rule that changes the learning rate during training, usually lowering it over time. (32. Math for ML)
Least squares
Fitting a model by choosing the parameters that minimize the sum of squared errors. (18. Classes and objects)
Leave-one-out evaluation
Evaluation that trains on all rows but one, predicts the left-out row, and repeats for every row; useful for very small datasets. (22. Design principles and patterns)
Left censoring
A gap at the start of the data: events before the first recorded date are missing, so the earliest period looks unusual. (31. Polars)
Left join
A merge that keeps every row of the left table and fills NaN where the right table has no match. (25. pandas advanced)
Left-skewed distribution
A distribution with a long tail of small values, so the mean lies below the median; also called negatively skewed. (27. Exploratory data analysis)
LEGB rule
The order in which Python looks up a name: Local, Enclosing, Global, then Built-in scope. (05. Functions)
Lemmatization
Mapping a word to its dictionary form with a vocabulary and grammar rules, for example better to good and arrived to arrive. (41. NLP fundamentals)
Level (time series)
A state measured at a moment, such as a temperature or a price; it is downsampled with mean, min or max. (40. Time series)
Level curve
A contour of inputs where a multivariable function takes a constant value; the gradient is always perpendicular to it. (47. Calculus and optimization for ML)
Levene's test
A test of the null hypothesis that several groups have equal variances; scipy.stats.levene. (29. Statistics and probability)
Lexicographic order
Dictionary-like order for strings, comparing character by character by Unicode code point: digits, then ASCII uppercase A-Z, then ASCII lowercase a-z, then accented letters. (02. Strings and text)
libomp
A system library that lets a program use several processor cores at once; XGBoost and LightGBM need it on macOS. (Start here)
Lifespan (FastAPI)
A function that runs code when the app starts (before yield) and when it stops (after yield), for example to load a model once. (44. ML in production basics)
LIFO
Last in, first out: the rule of a stack, where the most recently added item is removed first. (17. Algorithms and data structures)
Lift
In market basket analysis, how much more often two items occur together than chance would predict. (25. pandas advanced)
Lift (rate)
A group's outcome rate divided by the base rate; a lift of 1.5 means the group has the outcome 1.5 times as often as average. (27. Exploratory data analysis)
LightGBM
A fast gradient boosting library from Microsoft that grows trees leaf by leaf, with LGBMClassifier and LGBMRegressor. (36. Classification)
Like-for-like growth
Growth measured only on the stores and products that were already selling at the start of the comparison, so that openings and launches do not inflate it. (Capstone 2. Sales analysis)
Likelihood
The probability of the observed data under a given hypothesis or parameter value, seen as a function of that hypothesis or parameter. (32. Math for ML)
Limit (calculus)
The value a function approaches as its input gets arbitrarily close to a target point from both sides. (47. Calculus and optimization for ML)
Line coverage
The share of statements that ran at least once during the tests; also called statement coverage. (14. Testing with pytest)
Line ending
The invisible characters that end a line of text: LF (\n) on Linux and macOS, CRLF (\r\n) on Windows and in CSV files. (07. Files and data formats)
Lineage column
An extra column that records where each row came from, such as the source file name in a combined table. (07. Files and data formats)
Linear algebra
The mathematics of vectors and matrices: products, linear systems, inverses, eigenvalues and decompositions. (23. NumPy)
Linear independence
A property of vectors where no vector in the set can be written as a linear combination of the others, meaning each feature adds genuinely new information. (46. Linear algebra in depth)
Linear model
A model whose prediction is an intercept plus a dot product of weights and features, such as linear and logistic regression. (32. Math for ML)
Linear regression
A model that predicts a number as a weighted sum of the features plus an intercept, with weights chosen to minimize the sum of squared residuals. (35. Regression)
A search that looks at the elements one by one from the start until it finds the target: O(n). (17. Algorithms and data structures)
Linear system
A set of linear equations Ax = b, solved for the vector x with np.linalg.solve. (23. NumPy)
Linear time
Work that grows in proportion to the size of the data, written O(n). (04. Data structures)
Linear transformation
A map T(x) = Ax that preserves vector addition and scalar multiplication, geometrically rotating, scaling, shearing, or projecting space while keeping the origin fixed. (46. Linear algebra in depth)
Linearithmic time
O(n log n): a little more than linear; the cost of a good sorting algorithm. (15. Performance and concurrency)
The smooth transformation in a GLM that maps the expected outcome mu onto the linear predictor scale X beta, such as logit or log. (49. Causal inference, GLMs and advanced experimentation)
Linkage
The rule that defines the distance between two clusters in hierarchical clustering, such as ward, complete, average or single. (39. Unsupervised learning)
Linkage matrix
SciPy's record of a hierarchical clustering: one row per merge with the two merged cluster ids, the merge distance and the size of the new cluster. (39. Unsupervised learning)
Linter
A tool that reads your code and warns about likely mistakes without running it. (Start here)
Liskov substitution principle
The rule that an object of a subclass must work everywhere an object of its parent class works. (19. Inheritance and polymorphism)
List
An ordered collection of values written in square brackets, such as ['North', 'South']; split() returns one. (02. Strings and text)
Literal
A value written directly in code, such as 79.99 or "S01". (01. Python basics)
Literal expression
An expression with a constant value, made with pl.lit(), for example pl.lit("bulk") inside then(). (31. Polars)
Literal pattern
A pattern that is a literal value, such as 200 or "ok"; it matches a value equal to it. (03. Control flow)
Literal type
A type whose only values are the listed constants, such as Literal["mean", "median"]. (12. Type hints)
Liveness check
A health check that asks whether a process is still alive; when it fails, the platform restarts the process. (Capstone 8. Deployment)
Load balancer
A component that spreads incoming requests over the running copies of a service and stops sending requests to a copy that is not ready. (Capstone 8. Deployment)
Loadings
The weights of the original features in a principal component (PCA's components_); large absolute weights show which features drive it. (39. Unsupervised learning)
Local explanation
An explanation of one prediction, such as which features raised one customer's churn score. (43. Interpretability)
Local minimum
A solution that no small change improves, but that is not the best solution overall. (39. Unsupervised learning)
Local Outlier Factor (LOF)
An anomaly detector that compares the density around a row with the density around its neighbors; rows in sparse spots next to dense crowds stand out. (39. Unsupervised learning)
Local variable
A name assigned inside a function; it exists only during one call and only that function can see it. (05. Functions)
Locality-Sensitive Hashing (LSH)
A hashing family designed so that similar items collide in the same bucket with high probability, enabling sub-linear approximate nearest-neighbor and near-duplicate search. (45. Algorithms and data structures II)
Lock
An object that only one thread can hold at a time; code inside with lock: runs in one thread at a time. (15. Performance and concurrency)
Lock file
A file, such as uv.lock, that records the exact version of every direct and transitive dependency, often with file hashes. (08. Modules, packages and environments)
Log formatter
The part of logging that decides how one log line looks. (06. Errors and debugging)
Log level
A number that says how serious a log message is: DEBUG, INFO, WARNING, ERROR or CRITICAL. (06. Errors and debugging)
Log loss
The negative mean log-likelihood of 0/1 outcomes under predicted probabilities; it punishes confident wrong predictions. Also called binary cross-entropy. (32. Math for ML)
Log scale
An axis on which equal distances mean equal ratios, such as 100k to 1M and 1M to 10M. (28. Visualization)
Log target
A regression setup that fits the model on the logarithm of the target, so features act as percentage multipliers instead of fixed amounts. (35. Regression)
Log transform
Replacing each value x by log(x), which turns ratios into equal steps and often makes right-skewed data close to symmetric. (27. Exploratory data analysis)
Log-likelihood
The logarithm of the likelihood; a sum instead of a product, so it does not underflow. (32. Math for ML)
Log-odds
The logarithm of the odds, log(p / (1 - p)); the score of a logistic regression model. Also called the logit. (32. Math for ML)
Logarithmic time
O(log n): the work grows by one step each time the data doubles, as in binary search. (15. Performance and concurrency)
Logger
The object that a program sends log messages to; it has a name, such as sales.cleaner, and a level. (06. Errors and debugging)
Logging
Writing messages about what a program does while it runs, with a level, a format and a destination. (06. Errors and debugging)
Logical operator
An operator that combines truth values: and, or, not. (01. Python basics)
Logical query order
The order in which the engine applies the clauses: FROM and JOIN, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, LIMIT. (30. SQL for data analysis)
Logistic regression
A linear model for a 0/1 target that passes the linear score through the sigmoid to predict a probability. (32. Math for ML)
Logit
The raw score that a classifier outputs before the sigmoid or softmax; for binary classification it is the log-odds of the positive class. (42. Deep learning with PyTorch)
LogRecord attribute
A field of one log message, such as %(levelname)s or %(asctime)s, used in a log format string. (06. Errors and debugging)
Long format
A table layout with one row per observation and one column per variable. (25. pandas advanced)
Long tail
The thin stretch of rare, extreme values on one side of a skewed distribution. (27. Exploratory data analysis)
Lookup table
An array indexed by codes, so that fancy indexing turns millions of codes into values in one step. (23. NumPy)
Loop
A statement that runs a block of code again and again: for or while. (03. Control flow)
Loop body
The indented lines under a for or while line, which run once per repetition. (02. Strings and text)
Loop else
An else block after a for or while loop; it runs only when the loop ended without break. (03. Control flow)
Loop pattern
A standard way to use a loop: sum, count, filter, maximum or search. (03. Control flow)
Loop variable
The name in a for loop that refers to the current item on each iteration. (03. Control flow)
Loss
A number that measures how wrong a model's predictions are, such as the mean squared error; training lowers the loss on the training data. (22. Design principles and patterns)
Loss curve
A plot of the training loss against the iteration or epoch; the first chart to check when a model trains. (32. Math for ML)
Low-rank approximation
Reconstructing a matrix using only its top k singular values and vectors (Uk @ diag(sk) @ Vk.T) to compress data or remove noise. (46. Linear algebra in depth)
LRU (least recently used)
A cache policy that, when the cache is full, drops the entry that was used longest ago. (09. Standard library power tools)
LRU cache
A fixed-capacity cache that evicts the least recently used entry when full, implemented in O(1) per operation with a hash map pointing into a doubly linked list. (45. Algorithms and data structures II)

M

Macro average
The plain mean of a metric over the classes, which gives each class the same weight. (21. Dataclasses, enums and slots)
MAD
Median absolute deviation: the median of the absolute distances of the values from their median. (26. Data cleaning)
MAE
Mean absolute error: the average size of the differences between estimates and true values. (26. Data cleaning)
Magic number
A bare number in code whose meaning the reader must guess, such as 50 in if q > 50:; a named constant replaces it. (13. Pythonic code)
Magic string
A string literal with a special meaning in code, such as "euclidean"; a typo in it fails silently. (21. Dataclasses, enums and slots)
Main guard
The statement if __name__ == "__main__": that runs code only when the file runs as a program, not when it is imported. (08. Modules, packages and environments)
maintain_order
A Polars option of group_by, unique, sort and join that keeps a defined row order, which is otherwise not guaranteed. (31. Polars)
Majority vote
A rule that predicts the class that more than half (or the most) of the models predict. (38. Ensembles)
Manhattan distance
The sum of the absolute differences of the coordinates of two points, like a taxi driving along a street grid. (22. Design principles and patterns)
Manifest
A list of the files that a folder must contain, with a fact to check for each one, such as its size. (09. Standard library power tools)
Mann–Whitney U test
A rank-based test of whether one of two independent groups tends to have larger values; also called the Wilcoxon rank-sum test. (29. Statistics and probability)
Many-to-one
A join where many left rows can match one right row, such as sales lines to stores; it keeps the number of left rows. (25. pandas advanced)
Mapping pattern
A pattern in curly braces that matches a dict containing the given keys; extra keys are ignored. (03. Control flow)
MAR
Missing at random: the chance that a value is missing depends on other observed columns, not on the missing value itself. (26. Data cleaning)
Margin (SVM)
The gap between an SVM's decision boundary and the closest training points of each class. (36. Classification)
Margin of error
The half-width of a confidence interval: critical value times standard error. (29. Statistics and probability)
Margin rate
Profit per unit divided by the unit price, often shown as a percentage. (01. Python basics)
Marginal distribution
The distribution of a single variable obtained by summing or integrating a joint distribution over all other variables. (48. Probability, Bayesian statistics and information theory)
Margins
The total row and total column that pivot_table and crosstab add with margins=True. (25. pandas advanced)
Marker (pytest)
A label on a test, such as @pytest.mark.slow or @pytest.mark.xfail, used to select, skip or change how a test runs. (14. Testing with pytest)
Market basket analysis
Finding products that customers often buy together in the same order. (09. Standard library power tools)
Markov Chain Monte Carlo (MCMC)
A family of algorithms that draw dependent samples from complex posterior distributions without computing their normalizing integral. (48. Probability, Bayesian statistics and information theory)
Markup
Profit per unit divided by the unit cost, often shown as a percentage; compare margin rate, which divides by the price. (01. Python basics)
Masking
The effect in which large outliers inflate the mean and standard deviation so much that a z-score rule no longer flags them or other outliers. (26. Data cleaning)
Match object
The object that re returns for a successful match; it holds the matched text, its position and its groups. (09. Standard library power tools)
match statement
A branch (Python 3.10+) that compares a subject with patterns and runs the block of the first case that matches. (03. Control flow)
Matplotlib
The base plotting library of Python; pandas and Seaborn draw their charts with it. (28. Visualization)
Matrix
A 2-dimensional array of numbers, such as a stores x months sales table. (23. NumPy)
Matrix multiplication
The product A @ B, in which each element is the dot product of a row of A and a column of B. (23. NumPy)
Matrix–vector product
The product X @ w: the dot product of every row of X with the vector w, which predicts for every row at once. (32. Math for ML)
Max pooling
Pooling that keeps the largest value of each window; nn.MaxPool2d(2) halves the height and width. (42. Deep learning with PyTorch)
Maximum A Posteriori (MAP) estimation
Point estimation that chooses parameter values maximizing the posterior density, combining log-likelihood with a log-prior penalty. (48. Probability, Bayesian statistics and information theory)
Maximum likelihood estimation (MLE)
Choosing the parameter values that make the observed data most probable. (32. Math for ML)
MCAR
Missing completely at random: the chance that a value is missing has nothing to do with any value in the data. (26. Data cleaning)
Mean
The average of a set of values: their sum divided by their count. (01. Python basics)
Mean absolute error (MAE)
The average absolute difference between the true and the predicted values, in the units of the target. (19. Inheritance and polymorphism)
Mean absolute percentage error (MAPE)
The average absolute error divided by the true value; scikit-learn returns it as a fraction, so 0.12 means 12%. (35. Regression)
Mean absolute scaled error (MASE)
The MAE of a forecast divided by the MAE of a seasonal naive forecast inside the training data; it is scale-free and works with zeros. (40. Time series)
Mean decrease in impurity (MDI)
Another name for impurity-based feature importance: the total impurity reduction of a feature's splits, averaged over the trees. (43. Interpretability)
Mean squared error (MSE)
The average of the squared differences between predictions and true values. (03. Control flow)
Median
The middle value of sorted data; with an even count, the mean of the two middle values. (04. Data structures)
Median absolute percentage error (MdAPE)
The median of the absolute errors divided by the actual values; half of the predictions are closer than this, and a few huge errors do not move it. (Capstone 3. House price regression)
Mediator
A variable on the causal path from treatment to outcome that transmits part or all of the treatment effect. (49. Causal inference, GLMs and advanced experimentation)
melt
A pandas method that turns columns into rows, going from wide to long format. (25. pandas advanced)
Membership test
The operator in, which checks whether a value is an element of a container (or a key of a dict). (04. Data structures)
Memoization
Caching the results of a function by its arguments, so that a repeated call returns the stored result. (09. Standard library power tools)
Merge
Matching the rows of two tables on their keys and putting the columns side by side; also called a join. (25. pandas advanced)
Merge intervals
Combining overlapping or touching intervals, such as alert windows, into one interval each, in one pass over intervals sorted by start. (17. Algorithms and data structures)
Merge sort
A divide and conquer sort that sorts the two halves of a list and merges them; O(n log n) in every case and stable. (17. Algorithms and data structures)
MergeError
The pandas exception that merge raises when validate finds that the keys break the declared cardinality. (25. pandas advanced)
Meta-estimator
An estimator built from other estimators, such as Pipeline, ColumnTransformer or GridSearchCV, that exposes their methods as one object. (34. The scikit-learn workflow)
Meta-feature
One input column of a meta-learner: the prediction of one base model for each row, made out of fold to avoid leakage. (38. Ensembles)
Meta-learner
The model on top of a stacking ensemble (final_estimator in scikit-learn) that takes the base models' predictions as its features. (38. Ensembles)
Metadata
Data about a project or package, such as its name, version, license and dependencies. (08. Modules, packages and environments)
Method
A function that belongs to a value and is called with a dot after the value, as in region.strip(). (02. Strings and text)
Method chaining
Calling a method on the result of another method in one expression, as in raw.strip().lower(). (02. Strings and text)
Method resolution order (MRO)
The ordered list of classes that Python searches for an attribute, stored in Class.__mro__. (19. Inheritance and polymorphism)
Metric (MLflow)
A number logged with an MLflow run, such as a cross-validated ROC-AUC. (44. ML in production basics)
Metropolis-Hastings algorithm
An MCMC sampler that proposes candidate parameter moves and accepts or rejects them using the unnormalized posterior ratio. (48. Probability, Bayesian statistics and information theory)
Micro average
A multiclass average that pools TP, FP and FN over all classes before computing the metric; equals accuracy for single-label problems. (36. Classification)
Micro-benchmark
A benchmark of one small piece of code, such as a single function call, run many times. (15. Performance and concurrency)
Middleware
A web framework function that handles each request, then passes it on to the next handler in a chain. (22. Design principles and patterns)
min_periods
The minimum number of non-missing values a window needs before it returns a result instead of NaN. (25. pandas advanced)
min_samples (DBSCAN)
The number of points, the point itself included, that a neighborhood must hold for its center to be a core point. (39. Unsupervised learning)
Min-heap
A heap whose smallest element is at the top (index 0); heapq builds min-heaps. (17. Algorithms and data structures)
Min-max scaling
Mapping numbers linearly so that the smallest becomes a low value (often 0) and the largest a high value (often 1). (05. Functions)
MinHash
A sketching technique that estimates the Jaccard similarity of two sets from the fraction of hash functions on which their minimum hash values agree. (45. Algorithms and data structures II)
Mini-batch gradient descent
Gradient descent that estimates each gradient from a small random batch of rows, often 32 to 256; the default for neural networks. (32. Math for ML)
Minimum detectable effect (MDE)
The smallest effect worth detecting, chosen before an experiment to set its sample size. (29. Statistics and probability)
Minimum spanning tree (MST)
A subset of edges that connects every node of a weighted undirected graph with no cycles and the smallest possible total edge weight, found by Kruskal's or Prim's algorithm. (45. Algorithms and data structures II)
Minkowski distance
A family of distances between two points: the p-th root of the sum of the absolute coordinate differences raised to the power p; p=1 is Manhattan, p=2 is Euclidean. (22. Design principles and patterns)
Missing value
A cell with no known value; pandas marks it as NaN, NaT or pd.NA depending on the dtype. (26. Data cleaning)
Missing-data mechanism
The reason why values are missing: MCAR, MAR or MNAR; it decides whether dropping or filling biases the result. (26. Data cleaning)
Missing-value indicator
A True/False column that records which values of another column were missing before imputation. (26. Data cleaning)
Missing-value token
The text a system writes for a missing value, such as an empty field, N/A or -, which read_csv turns into NaN only if it knows the token. (26. Data cleaning)
Missingness pattern
The combination of columns that are missing together in a row. (26. Data cleaning)
Mixin
A small class that adds one capability to other classes through multiple inheritance and is not used on its own, such as TransformerMixin. (19. Inheritance and polymorphism)
Mixture component
One of the normal distributions in a Gaussian mixture, with its own mean, covariance matrix and weight. (39. Unsupervised learning)
MLflow
An open-source tool for experiment tracking and model packaging, with a Python API and a web UI. (44. ML in production basics)
MLOps
Machine learning operations: the practices that keep a model correct in production, such as reproducible training, versioned artifacts, tests, deployment and monitoring. (44. ML in production basics)
MNAR
Missing not at random: the chance that a value is missing depends on the missing value itself. (26. Data cleaning)
MockTransport
An httpx transport that answers each request with a handler function instead of the network, for offline tests. (16. APIs and web data)
Mode
The most frequent value of a variable. (29. Statistics and probability)
Model bundle
One saved file that holds a fitted pipeline together with its metadata, so the two cannot be separated. (44. ML in production basics)
Model card
A short document that states what a model is for, how it was trained and tested, how well it works overall and by segment, and where it must not be used. (Capstone 3. House price regression)
Model checkpoint
A saved dictionary with a model's state_dict and everything needed to rebuild or resume it, such as hyperparameters, optimizer state and epoch. (42. Deep learning with PyTorch)
Model complexity
How flexible a model is, controlled by knobs such as polynomial degree, tree depth or the number of neighbors. (37. Model evaluation and tuning)
Model metadata
Facts saved with a model: its version, training date, data hash, library versions, features, metrics and threshold. (44. ML in production basics)
Model persistence
Saving a fitted model to a file so that another program can load it and predict without training again. (34. The scikit-learn workflow)
Model registry
A store of trained model versions with their metrics and stages, such as staging, production and archived. (21. Dataclasses, enums and slots)
Model signature
The names and types of a model's inputs and outputs, stored with a logged MLflow model. (44. ML in production basics)
Model-agnostic method
An explanation method that only calls the model's predict functions, so it works for any model. (43. Interpretability)
Model-specific method
An explanation method that uses the internals of one model family, such as coefficients for linear models or impurity importance for trees. (43. Interpretability)
Module
A file of Python code that other code can load with import, such as the standard math module. (01. Python basics)
Module cache (sys.modules)
The dictionary of every module that a program has already imported; a second import reuses the module from it. (08. Modules, packages and environments)
Module search path (sys.path)
The list of folders that Python searches, in order, when it imports a module; the script folder comes first. (08. Modules, packages and environments)
Module shadowing
A file of yours that hides a module of the same name, such as a csv.py next to a script that imports csv. (08. Modules, packages and environments)
Modulo
The remainder of a division, written %; 250 % 12 is 10. (01. Python basics)
Mojibake
Garbled text such as Café that appears when bytes are decoded with the wrong encoding. (02. Strings and text)
Momentum
An optimizer technique that steps in the direction of an average of recent gradients, which smooths and speeds up training. (42. Deep learning with PyTorch)
Mondrian conformal prediction
Split conformal prediction run separately within each group, such as each price band, so that every group gets its own interval width and its own coverage. (Capstone 3. House price regression)
Monitoring
Measuring a production system continuously and raising an alert when a measure crosses a threshold. (44. ML in production basics)
monkeypatch
A built-in pytest fixture that changes environment variables, attributes or the working folder for one test and undoes the change afterwards. (14. Testing with pytest)
Monotone transform
A transform that keeps the order of the values, such as a log; it does not change the splits of a tree model. (33. Feature engineering)
Monotonic deque
A deque of indices whose values only decrease (or only increase) from front to back, so its front is the maximum (or minimum) of a sliding window. (17. Algorithms and data structures)
Monotonic relationship
A relationship in which one variable keeps rising (or keeps falling) as the other rises, in a straight line or not. (27. Exploratory data analysis)
Monte Carlo integration
Estimating an integral or expectation by averaging function evaluations over random draws, with standard error shrinking as O(1/sqrt(N)) in any dimension. (47. Calculus and optimization for ML)
Monte Carlo simulation
Answering a question about chance by simulating the random process many times and counting the outcomes. (09. Standard library power tools)
Month-over-month (MoM)
The change of a value from one month to the next, often as a percentage. (30. SQL for data analysis)
Moore–Penrose pseudoinverse
The SVD-based generalization of the matrix inverse (V @ Sigma+ @ U.T) that exists for any rectangular or rank-deficient matrix and yields the minimum-norm least-squares solution. (46. Linear algebra in depth)
more-itertools
A third-party package that ships the itertools recipes and many more iterator tools. (10. Iterators and generators)
Moving average
The mean of the most recent window of values, recomputed as each new value arrives; it smooths noisy data. (05. Functions)
Moving-average (MA) model
A time-series model that predicts a value from the last q forecast errors; it is not a rolling mean. (40. Time series)
Multi-armed bandit
An adaptive experimentation algorithm that shifts traffic toward higher-performing variants over time to balance exploration and exploitation. (49. Causal inference, GLMs and advanced experimentation)
Multi-horizon training table
A training table with one row per (forecast origin, horizon) pair, whose features are known on the origin and which includes the horizon as a feature. (Capstone 6. Demand forecasting)
Multi-key sort
A sort by several fields in order of importance, written in Python with a tuple key or with stable passes. (17. Algorithms and data structures)
Multiclass classification
Classification with three or more classes, where each row belongs to exactly one. (36. Classification)
Multicollinearity
Strong correlation between features, which makes the individual coefficients of a linear model unstable and hard to interpret. (33. Feature engineering)
MultiIndex
A pandas index with two or more levels, where each row label is a tuple. (25. pandas advanced)
Multilabel classification
Classification where several labels can be true for the same row at once. (36. Classification)
Multilayer perceptron (MLP)
A network made only of fully connected linear layers with activations between them; the standard network for tabular data. (42. Deep learning with PyTorch)
Multinomial logistic regression
Logistic regression with one score per class, turned into probabilities by the softmax; the scikit-learn default for multiclass targets. (36. Classification)
Multinomial naive Bayes
A classifier for word counts that estimates how likely each word is in each class and adds the log-probabilities of a document's words. (41. NLP fundamentals)
Multiple inheritance
A class that has more than one parent class, such as class StandardScaler(TransformerMixin, BaseEstimator). (19. Inheritance and polymorphism)
Multiple testing problem
The rise in false positives when many tests are run at once. (29. Statistics and probability)
Multiplicative decomposition
A decomposition where the series is trend times seasonal factor times remainder; the seasonal swing grows with the level. (40. Time series)
Multivariate analysis
Analysis of three or more variables together, for example with a correlation matrix, a two-key pivot table or a pairplot. (27. Exploratory data analysis)
Mutable
Able to change in place after creation; lists, dicts and sets are mutable. (04. Data structures)
Mutable default argument
A default parameter value such as [] or {}; Python creates it once, so every call that uses the default shares the same object. (13. Pythonic code)
Mutual information
A measure of how much knowing one variable reduces uncertainty about another; 0 means independent, and it detects non-linear dependence. (33. Feature engineering)
mypy
The original static type checker for Python; run it as mypy file.py or mypy --strict file.py. (12. Type hints)

N

N-gram
A sequence of n consecutive tokens; a bigram such as not worth has two, a trigram three. (41. NLP fundamentals)
Naive Bayes
A classifier that applies Bayes' rule while assuming the features are independent within each class. (36. Classification)
Naive datetime
A datetime without time-zone information, so it does not name one exact moment. (09. Standard library power tools)
Naive forecast
A forecast that repeats the last known value for every future step. (40. Time series)
Name mangling
Python's compile-time rename of identifiers of the form __name inside a class body to _ClassName__name, to avoid clashes in subclasses. (18. Classes and objects)
Named aggregation
The agg form new_name=(column, function), which names each result column in the same step. (25. pandas advanced)
Named group
A capturing group written (?P<name>...) whose text can be read by name, such as m["status"]. (09. Standard library power tools)
namedtuple
A function from collections that builds a tuple type whose fields can also be read by name. (09. Standard library power tools)
NameError
The exception raised when code uses a name that has no value, often because of a typo. (01. Python basics)
Namespace
A mapping from names to objects; each function call, each module and the built-ins have their own. (05. Functions)
Namespace package
A package folder without __init__.py, meant for large projects that spread one package over several folders. (08. Modules, packages and environments)
NaN
Not a Number: the float value that marks a missing or undefined result; it is not equal to itself. (09. Standard library power tools)
nan function
A NumPy aggregation that skips NaN values, such as np.nanmean or np.nanmax. (23. NumPy)
NaT
"Not a time": the missing-value marker of a datetime column in pandas. (24. pandas fundamentals)
Natural language processing (NLP)
The field that turns human-written text into numbers so that programs can classify, search, compare and summarize it. (41. NLP fundamentals)
NCHW layout
The PyTorch order of image tensor dimensions: batch size, channels, height, width. (42. Deep learning with PyTorch)
ndarray
NumPy's n-dimensional array: a fixed-size grid of elements of one dtype stored in one block of memory. (23. NumPy)
Near duplicate
A row that differs from another only by formatting, such as case or spaces, and becomes an exact duplicate after normalization. (26. Data cleaning)
Negative index
An index that counts from the end of a sequence: -1 is the last item, -2 the one before it. (02. Strings and text)
Nested cross-validation
Cross-validation with an inner loop that tunes hyperparameters and an outer loop that scores the tuned model on unseen folds. (37. Model evaluation and tuning)
Nested format spec
A format spec that contains its own replacement fields, so that a width or a precision comes from a variable, as in {x:>{width}}. (02. Strings and text)
Nested loop
A loop inside the block of another loop. (03. Control flow)
Nested structure
A container that holds other containers, such as a list of dicts with lists inside. (04. Data structures)
Neural network
A model built from layers of simple units; each layer multiplies its input by learned weights, adds biases and usually applies an activation function. (42. Deep learning with PyTorch)
Neuron
One output value of a layer: a weighted sum of its inputs plus a bias, usually passed through an activation function. Also called a unit. (42. Deep learning with PyTorch)
Newcombe interval
A Wilson-based confidence interval for the difference of two proportions. (29. Statistics and probability)
Newton's method
A second-order optimization algorithm that solves H * delta = -grad using the local Hessian to achieve rapid quadratic convergence near a strictly convex minimum. (47. Calculus and optimization for ML)
NewType
typing.NewType creates a distinct type for the checker, such as CustomerId from str, with no runtime cost. (12. Type hints)
next()
A built-in function that returns the next item of an iterator; next(it, default) returns default instead of raising StopIteration. (10. Iterators and generators)
NFC
The composed Unicode normalization form: one code point per accented letter where one exists; the form to use for storage and comparison. (02. Strings and text)
NFD
The decomposed Unicode normalization form: each accented letter is a base letter followed by combining marks. (02. Strings and text)
NFKC
The composed Unicode normalization form that also replaces compatibility characters, such as the ligature fi with fi and ² with 2. (02. Strings and text)
NFKD
The decomposed normalization form that also replaces compatibility characters, such as the ligature fi with fi; used to build accent-free keys. (02. Strings and text)
nn.Linear
A fully connected layer that computes x @ W.T + b with a weight matrix of shape (out, in) and a bias of shape (out,). (42. Deep learning with PyTorch)
nn.Module
The base class of every PyTorch model and layer; it registers sub-layers and parameters and provides parameters(), state_dict(), train() and eval(). (42. Deep learning with PyTorch)
nn.Parameter
A tensor that a module registers as learnable; it always has requires_grad=True and appears in parameters() and state_dict(). (42. Deep learning with PyTorch)
nn.Sequential
A module that runs a list of layers in order, like a scikit-learn Pipeline of steps. (42. Deep learning with PyTorch)
Node
One element of a tree or graph, such as a category in a catalog tree or a store in a delivery network. (17. Algorithms and data structures)
Node ID
The full name pytest gives a test, such as test_dates.py::test_parse_date[iso]; it selects one test on the command line. (14. Testing with pytest)
Noise band
The range that a measure takes on ordinary days or units without the intervention; an effect inside it cannot be told apart from normal variation. (Capstone 2. Sales analysis)
Noise point
In DBSCAN, a point that is neither a core point nor a border point; it gets the label -1. (39. Unsupervised learning)
Nominal feature
A categorical feature whose categories have no natural order, such as region or payment method. (33. Feature engineering)
Nominal typing
Type compatibility based on the class name and inheritance, as with isinstance(x, int) or an abstract base class. (12. Type hints)
Non-capturing group
A group written (?:...) that groups part of a pattern without saving its text. (09. Standard library power tools)
Non-negative matrix factorization (NMF)
Writing a non-negative matrix X as the product W H of two smaller non-negative matrices: document-topic weights and topic-word weights. (41. NLP fundamentals)
None
Python's value for "no value here", used for missing or unknown data; its type is NoneType. (01. Python basics)
nonlocal
A statement that makes assignments to a name inside a nested function change the variable of the enclosing function. (05. Functions)
Nonparametric test
A test with weaker assumptions, usually based on ranks. (29. Statistics and probability)
noqa comment
A comment such as # noqa: F401 that tells a linter to ignore one rule on one line. (13. Pythonic code)
Norm
A measure of the length of a vector; the norm of a difference between two vectors is a distance. (32. Math for ML)
Normal distribution
The symmetric bell-shaped distribution defined by its mean and standard deviation; also called Gaussian. (29. Statistics and probability)
Normal equations
The linear system XᵀXβ = Xᵀy whose solution is the least-squares coefficient vector. (23. NumPy)
Normalization
Dividing a raw number by a size, a duration or another base so that values can be compared fairly. (01. Python basics)
NotFittedError
The exception raised when a model or transformer is used before fit(); in minilearn and scikit-learn it is a subclass of ValueError. (18. Classes and objects)
NotImplemented
A special value (not an exception) that a binary special method returns to say "I cannot handle this operand; ask the other one". (20. The Python data model)
NotRequired
A TypedDict marker for a key that may be missing from the dict. (12. Type hints)
Novelty detection
Anomaly detection in which the model trains on clean data and scores new rows later. (39. Unsupervised learning)
np.select
The NumPy function that picks a value per element from a list of conditions and choices, with a default: the multi-branch form of `np.where`. (24. pandas fundamentals)
NULL
SQL's marker for a missing or unknown value; any comparison with NULL is unknown, so test it with IS NULL. (30. SQL for data analysis)
null (Polars)
The Polars marker for a missing value; every dtype can hold it, and aggregations skip it. (31. Polars)
Null distribution
The distribution of a test statistic if the null hypothesis were true. (29. Statistics and probability)
Null hypothesis (H0)
The default claim of no effect or no difference that a test tries to find evidence against. (29. Statistics and probability)
Null space
The set of all vectors v that a matrix maps to zero (Av = 0); a nonzero null space means the columns are linearly dependent. (46. Linear algebra in depth)
Nullable integer dtype
A pandas dtype such as `Int64` (capital I) that holds whole numbers and marks a missing value as `<NA>`, unlike `int64`. (24. pandas fundamentals)
nullcontext
A contextlib context manager that does nothing, used where a context manager is optional. (11. Decorators and context managers)
Numeric promotion
The typing rule that an int is accepted where a float is expected. (12. Type hints)
Numerical derivative
An estimate of a derivative from function values at nearby points, such as (f(w + h) - f(w - h)) / (2h). (32. Math for ML)
NumPy
The core Python library for numeric arrays; pandas, scikit-learn, SciPy and PyTorch build on it. (23. NumPy)
NumPy scalar
One value with a NumPy dtype, such as np.float64(20.21); print() shows it like a Python number. (23. NumPy)
NumPy-style docstring
A docstring layout with section headings underlined by dashes, such as Parameters and Returns; used by NumPy, pandas and scikit-learn. (05. Functions)

O

Object
One value stored in memory; every value in Python, such as 21.7 or None, is an object. (01. Python basics)
object dtype
A NumPy and pandas dtype that stores general Python objects, such as lists, dicts or mixed values; flexible but slow. (24. pandas fundamentals)
Object identity
The fact that two names refer to the very same object, tested with is; the default == of a class compares identity. (20. The Python data model)
Object-oriented interface (Matplotlib)
The Matplotlib API in which you get Figure and Axes objects from plt.subplots and call their methods, such as ax.set_title. (28. Visualization)
Object-oriented programming (OOP)
A style of programming that groups data and the functions that work on it into objects made from classes. (18. Classes and objects)
Objective function
The function an optimizer maximizes or minimizes; in Optuna it takes a trial and returns a score. (37. Model evaluation and tuning)
observed (groupby)
The groupby parameter that decides whether unused categories appear in the result; True, the pandas 3 default, shows only categories that occur. (25. pandas advanced)
Observer pattern
A design in which a subject notifies any number of observers when an event happens, without knowing what they do. (22. Design principles and patterns)
Odds
The probability of an event divided by the probability that it does not happen, p / (1 − p). (29. Statistics and probability)
Odds ratio
The odds of an event in one group divided by the odds in another group. (29. Statistics and probability)
Offset alias
The short text that names a pandas frequency, such as "D" for days, "h" for hours or "MS" for month start. (40. Time series)
Offsets (EmbeddingBag)
A tensor of start positions that tells EmbeddingBag where each text begins in one flat tensor of token ids. (Capstone 7. Review sentiment)
OLAP
Online analytical processing: a workload of few long queries that scan and aggregate many rows. (30. SQL for data analysis)
OLTP
Online transaction processing: a workload of many short reads and writes of single rows, as in apps and shops. (30. SQL for data analysis)
One-hot encoding
Encoding a categorical feature as one 0/1 column per category, with a 1 in the column of the row's category. (33. Feature engineering)
One-sided test
A test that looks for a difference in one stated direction only, decided before seeing the data. (29. Statistics and probability)
One-vs-one (OvO)
A multiclass strategy that trains one binary model per pair of classes and lets them vote. (36. Classification)
One-vs-rest (OvR)
A multiclass strategy that trains one binary model per class, 'this class or any other'. (36. Classification)
One-way ANOVA
A test of whether three or more group means are equal, based on the F statistic. (29. Statistics and probability)
OneToOneFeatureMixin
A scikit-learn mixin that gives a transformer get_feature_names_out() when each output column matches one input column. (34. The scikit-learn workflow)
Online inference
Scoring one request as soon as it arrives, usually through a web API, while a person or program waits. (44. ML in production basics)
Open/closed principle
Code should be open for extension and closed for modification: add behavior by adding code, not by editing working code. (22. Design principles and patterns)
OpenAPI
A standard, machine-readable description of an HTTP API; FastAPI generates it from the pydantic models. (44. ML in production basics)
OpenMP
A library that runs loops on several CPU threads at once; scikit-learn's HistGradientBoosting uses it, and threadpoolctl can limit its thread count. (38. Ensembles)
openpyxl
The Python package that pandas uses to read and write Excel `.xlsx` workbooks. (24. pandas fundamentals)
Operand
A value that an operator works on; in 2 + 3, the operands are 2 and 3. (01. Python basics)
Operation count
The number of basic steps (comparisons, additions, lookups) that an algorithm makes; unlike a timing, it is the same on every machine. (17. Algorithms and data structures)
Operator
A symbol that combines values, such as +, // or ==. (01. Python basics)
operator module
A standard-library module that provides operators and lookups as functions, such as itemgetter, attrgetter and mul. (09. Standard library power tools)
Operator overloading
Giving an operator such as +, == or @ a meaning for your own class by writing its special method. (20. The Python data model)
Optimize flag
The python -O option; it removes every assert statement from the program. (06. Errors and debugging)
Optimizer
An object that updates the parameters of a model from their gradients, such as SGD, Adam or AdamW. (42. Deep learning with PyTorch)
Option
A command-line argument that starts with - or --, such as --top 3; it is optional by default. (08. Modules, packages and environments)
Optional stopping (peeking)
Repeatedly running a fixed-horizon hypothesis test as data arrives and stopping early once p < alpha, which inflates the false-positive rate. (49. Causal inference, GLMs and advanced experimentation)
Optional type
A union with None, such as str | None, for a value that can be missing; old code writes Optional[str]. (12. Type hints)
Optuna
A Python library for hyperparameter optimization built around studies, trials and samplers. (37. Model evaluation and tuning)
Or-pattern
A pattern with alternatives separated by |, such as "warn" | "fail"; it matches any of them. (03. Control flow)
Ordered categorical
A categorical whose categories have a defined order, such as basic < standard < premium, so that comparisons, min, max and sorting follow it. (24. pandas fundamentals)
Ordinal encoding
Encoding categories as integer codes in a given order, such as month-to-month 0, one-year 1, two-year 2. (33. Feature engineering)
Ordinal feature
A categorical feature whose categories have a natural order, such as contract length or plan level. (33. Feature engineering)
Ordinary least squares (OLS)
Linear regression that chooses the coefficients minimizing the sum of squared residuals. (29. Statistics and probability)
Orphan record
A row whose foreign key points to no row in the referenced table. (26. Data cleaning)
Orthogonal matrix
A square matrix Q with orthonormal columns (Q.T @ Q = Q @ Q.T = I) that acts as a rigid rotation or reflection, preserving all lengths and angles. (46. Linear algebra in depth)
Orthogonal projection
Dropping a perpendicular from a vector onto a subspace to find its closest point in that subspace; ordinary least squares is the orthogonal projection of y onto the column space of X. (46. Linear algebra in depth)
Orthogonal vectors
Vectors whose dot product is zero, meaning they meet at a right angle (90 degrees). (46. Linear algebra in depth)
Orthonormal basis
A basis whose vectors all have unit length and are mutually perpendicular, so its matrix satisfies Q.T @ Q = I. (46. Linear algebra in depth)
Out-of-bag (OOB) score
A random forest's validation score computed by predicting each training row only with the trees whose bootstrap sample left that row out. (35. Regression)
Out-of-fold metrics
Metrics computed from out-of-fold predictions on the training set, used to compare strategies without touching the test set. (37. Model evaluation and tuning)
Out-of-fold prediction
A prediction for a row made by a model trained on the other cross-validation folds, so the model never saw that row; cross_val_predict returns one per row. (35. Regression)
Out-of-vocabulary (OOV) word
A word that was not in the training texts, so a fitted vectorizer has no column for it and ignores it. (41. NLP fundamentals)
Outer join
A merge that keeps every key of both tables. (25. pandas advanced)
Outlier
A value far from the other values; it can be an error or a genuine but rare extreme. (26. Data cleaning)
Outlier detection
Anomaly detection in which the anomalies are part of the training data and you want to find them. (39. Unsupervised learning)
Output validator
A check that runs after a function and rejects an impossible result, such as a probability above 1. (11. Decorators and context managers)
Over-differencing
Differencing a series more than needed; it adds noise and shows up as a moving-average coefficient close to -1. (40. Time series)
Over-engineering
Design for needs that you do not have, which costs reading, testing and changing time for a benefit that may never come. (22. Design principles and patterns)
Overdispersion
A variance larger than a model predicts, such as count data whose variance exceeds its Poisson mean. (29. Statistics and probability)
Overfitting
When a model fits the training rows much better than new rows because it memorized details and noise instead of general patterns. (34. The scikit-learn workflow)
Overlapping subproblems
Smaller problems that a recursive solution solves again and again, which makes plain recursion exponential. (17. Algorithms and data structures)
Overload
One of several signatures declared with @overload for a single function, so the return type can depend on the argument types. (12. Type hints)
Overplotting
Many points drawn on top of each other, so that the density of an area cannot be seen. (28. Visualization)
Override
To define a method in a child class with the same name as a parent method, so that the child's version runs instead. (19. Inheritance and polymorphism)
Oversampling
Adding rows of the rare class to the training data, by copying them or by creating synthetic rows. (37. Model evaluation and tuning)
Oversubscription
Running more busy threads than CPU cores, for example when several processes each use every core; the threads compete and everything slows down. (42. Deep learning with PyTorch)

P

p-hacking
Running many analyses and reporting only those with small p-values. (29. Statistics and probability)
p-value
The share of results under the 'no effect' assumption that are at least as extreme as the observed result. (23. NumPy)
Package
Code that other people wrote and published so that you can install and use it, for example pandas. (Start here)
Padding
Extra characters added to a value to fill it up to a field width. (02. Strings and text)
Padding (convolution)
Extra zeros added around the border of the input of a convolution, often to keep the output the same size. (42. Deep learning with PyTorch)
Pagination
Splitting a large API result into pages that the client requests one at a time. (16. APIs and web data)
Paired bootstrap
Resampling one test set with replacement many times and scoring two models on the same resample each time, to get an interval for the difference of their scores. (Capstone 7. Review sentiment)
Paired comparison
Comparing two models on exactly the same folds or samples, fold by fold, so that the differences come from the models and not from the data split. (34. The scikit-learn workflow)
Paired t-test
A t-test on the differences between two measurements of the same units, such as before and after. (29. Statistics and probability)
Pairplot
A grid of scatter plots for every pair of a few columns, with each column's distribution on the diagonal. (27. Exploratory data analysis)
pandas
The standard Python library for tables of data: it reads, cleans, filters, combines and summarizes labeled columns at NumPy speed. (24. pandas fundamentals)
Pandas4Warning
The pandas 3 deprecation warning for features that pandas 4 removes, such as `inplace=True` on most methods. (24. pandas fundamentals)
Parallel lists
Lists of the same length where position i in each list describes the same thing. (03. Control flow)
The key DiD assumption that treated and control groups would have followed the same outcome trajectory over time without the treatment. (49. Causal inference, GLMs and advanced experimentation)
Parallelism
Several tasks running at the same instant on different CPU cores. (15. Performance and concurrency)
Parameter
A name in a function definition that receives the value of an argument when the function is called. (05. Functions)
Parameter (MLflow)
An input setting logged with an MLflow run, such as C=0.1; MLflow stores it as text. (44. ML in production basics)
Parameter (statistics)
A number that describes a population, such as the true churn rate; usually unknown. (29. Statistics and probability)
Parameter routing (double underscore)
The step__parameter naming that lets set_params() and get_params() reach a parameter of a step inside a pipeline or column transformer, for example model__C. (34. The scikit-learn workflow)
Parameterized query
A query with placeholders whose values are passed separately, so the engine treats them as data, never as code. (30. SQL for data analysis)
Parametric test
A test that assumes a model for the data, such as normally distributed means. (29. Statistics and probability)
Parametrize
To run one test function once per set of arguments with @pytest.mark.parametrize. (14. Testing with pytest)
ParamSpec
A type parameter written **P that stands for a whole parameter list, so that a decorator can keep the signature of the function it wraps. (11. Decorators and context managers)
Parent class
The class that another class inherits from; also called the base class or superclass. (19. Inheritance and polymorphism)
Parent parser
An argparse parser made with add_help=False whose arguments are copied into other parsers through parents=[...], so several subcommands share options without repeated code. (Capstone 1. Python CLI report tool)
Parquet
A fast, compressed binary file format for tables. (Start here)
Parser
Code that reads text in a format such as HTML and builds a structure from it; html.parser comes with Python. (16. APIs and web data)
Partial autocorrelation function (PACF)
The correlation of a series with lag k after removing the part that lags 1 to k-1 already explain. (40. Time series)
Partial dependence plot (PDP)
A plot of the average prediction as one feature is set to each value of a grid in every row. (43. Interpretability)
Partial derivative
The derivative of a function of several inputs with respect to one input while the others stay fixed, written with a curly d. (32. Math for ML)
Partial string indexing
Selecting rows of a DatetimeIndex with a date string such as df.loc["2024-02"], which returns every row of that month. (40. Time series)
Partition (window)
One group of rows, defined by PARTITION BY, that a window function processes separately. (30. SQL for data analysis)
PascalCase
A naming style that capitalizes each word and joins the words without underscores, used for class names: SensorReading. (13. Pythonic code)
pass
A statement that does nothing; a placeholder for an empty block. (03. Control flow)
Pass-through stage
A pipeline stage that yields its items unchanged and counts or logs them on the way. (10. Iterators and generators)
Passthrough (stacking)
A stacking option that gives the meta-learner the original features in addition to the base models' predictions. (38. Ensembles)
PATH
The list of folders where the operating system looks for the commands you type. (Start here)
Path compression
A Union-Find optimization that points every node visited during find directly to its group root, flattening future lookups. (45. Algorithms and data structures II)
Path length
The number of random cuts from the root of an isolation tree to the leaf that holds a row; short paths mean unusual rows. (39. Unsupervised learning)
Path object
A pathlib object that represents a path and knows its parts (name, stem, suffix, parent) and can check, read and write the file. (07. Files and data formats)
Path operation
In FastAPI, a function decorated with an HTTP method and a path, such as @app.post("/predict"), that handles those requests. (44. ML in production basics)
Path parameter
A variable part of a URL path, such as {contract} in /rate/{contract}, that FastAPI passes to the function. (44. ML in production basics)
pathlib
The standard library module that represents paths as Path objects that you join with / and query with methods. (07. Files and data formats)
Patience
The number of epochs without improvement of the validation loss that early stopping accepts before it stops training. (42. Deep learning with PyTorch)
Pattern
The part of a case that describes which values match and which parts to capture. (03. Control flow)
pd.concat
A pandas function that stacks tables below each other (axis=0) or places them side by side (axis=1). (25. pandas advanced)
pd.cut
A pandas function that sorts numbers into bins and returns a categorical with one category per bin. (25. pandas advanced)
pd.NA
The missing-value marker of pandas nullable dtypes such as Int64, boolean and string. (26. Data cleaning)
pdb
The Python debugger, part of the standard library; breakpoint() opens it. (06. Errors and debugging)
Peak memory
The highest amount of memory a program used at any moment while it ran. (10. Iterators and generators)
Pearson correlation
The correlation coefficient that measures how close points lie to a straight line; sensitive to outliers. (27. Exploratory data analysis)
Peeking
Checking a running experiment repeatedly and stopping at the first significant result, which inflates false positives. (29. Statistics and probability)
PEP 257
The Python convention for docstrings: triple double quotes and a one-line summary in the imperative mood. (05. Functions)
PEP 695
The Python 3.12 proposal that added the bracket syntax for type parameters (def f[T], class C[T]) and the type statement. (12. Type hints)
PEP 8
The official style guide for Python code. (01. Python basics)
Percent change
The relative change from an old value to a new one: 100 × (new − old) / old. (05. Functions)
Percent point function (PPF)
The inverse of the CDF, also called the quantile function: the value below which a given share of outcomes falls. (29. Statistics and probability)
Percent-encoding
Replacing characters that are not safe in a URL with codes such as %20 or +, so the URL stays valid. (16. APIs and web data)
Percentage point (pp)
The unit for the difference between two percentages: 10.12% to 11.66% is +1.54 percentage points, a relative lift of about 15%. (09. Standard library power tools)
Percentile
The value below which a given percentage of the data falls; the 95th percentile is above 95% of the values. (09. Standard library power tools)
Performance
How much time and memory a program needs to do its job. (15. Performance and concurrency)
Period
A pandas value for a span of time, such as the month 2024-12, made with .dt.to_period. (25. pandas advanced)
Permutation
An ordered arrangement of items; (A, B) and (B, A) are different permutations. (09. Standard library power tools)
Permutation importance
The drop in a model's score on held-out data when one feature's column is randomly shuffled, averaged over several shuffles. (43. Interpretability)
Permutation test
A test that shuffles group labels many times to see how large a difference chance alone produces. (23. NumPy)
Perplexity
The main t-SNE setting: roughly the number of neighbors each point pays attention to, usually 5 to 50. (39. Unsupervised learning)
pickle
The standard library module that serializes almost any Python object to bytes; loading a pickle can run code, so load only files you trust. (07. Files and data formats)
Pinball loss
The loss minimized by quantile regression; it penalizes errors on one side of the prediction more than on the other, so the model learns a chosen quantile instead of the mean. (Capstone 3. House price regression)
Pinned version
An exact package version written with ==, so the installer always picks that version. (Start here)
pip
The standard package installer that comes with Python. (Start here)
pipe
A DataFrame method that calls a function with the frame as its first argument, so own functions fit into a method chain. (25. pandas advanced)
Pipeline
A chain of steps in which the output of one step is the input of the next. (10. Iterators and generators)
Pipeline (scikit-learn)
An estimator that chains transformers and a final model, so that fit fits every step in order on the same training data. (33. Feature engineering)
Pipeline pattern
A chain of steps that share one interface, where the output of each step is the input of the next. (22. Design principles and patterns)
Pivot table
A table that groups rows by one key and columns by another and aggregates a value in each cell. (25. pandas advanced)
pl.Config
The Polars settings object that controls how tables print, for example the number of rows, columns and characters shown. (31. Polars)
Placeholder
A ? mark in an SQL statement that the database fills with a value, safely quoted. (10. Iterators and generators)
Platt scaling
Calibration that fits a logistic regression on a model's scores; method='sigmoid' in CalibratedClassifierCV. (36. Classification)
Plotly
A library for interactive charts in a web page, with hover, zoom and legend filtering. (28. Visualization)
Plotly Express
Plotly's short API (plotly.express, imported as px) that builds a chart from a DataFrame and column names. (28. Visualization)
Plugin
Code that a program finds and loads at run time without knowing it in advance, often through a registry or entry points. (22. Design principles and patterns)
Plugin system
A design in which new classes add features to an application, usually by subclassing a base class, without edits to the core code. (19. Inheritance and polymorphism)
Poisson distribution
The standard distribution for counts of independent events per interval, such as orders per day. (23. NumPy)
Polars
A fast DataFrame library written in Rust that uses Arrow memory, runs on all CPU cores, has no index and offers an eager and a lazy, optimized API. (31. Polars)
Polymorphism
The ability of one piece of code to work with objects of different types, because each type provides the same method in its own way. (19. Inheritance and polymorphism)
Polynomial degree
The highest power in a set of polynomial features; it controls how much a polynomial model can bend. (35. Regression)
Polynomial feature
A power of a feature, such as x squared, that lets a linear model fit a curve. (33. Feature engineering)
Polynomial regression
Linear regression on powers and products of the features, which lets the prediction follow a curve while the model stays linear in its weights. (35. Regression)
Pool
A fixed group of worker threads or processes that run tasks one after another. (15. Performance and concurrency)
Pooled standard deviation
A combined standard deviation of two groups, weighted by their degrees of freedom. (29. Statistics and probability)
Pooling
A layer that shrinks feature maps by summarizing each small window, for example with its maximum or mean. (42. Deep learning with PyTorch)
Pop
Removing and returning the top item of a stack, or the smallest item of a heap. (17. Algorithms and data structures)
Population
The whole group you want to learn about, such as every customer of a company. (29. Statistics and probability)
Population stability index (PSI)
A drift measure that compares the shares of reference and current data in fixed bins: sum of (c - r) * ln(c / r). (44. ML in production basics)
Population standard deviation
A measure of how far values spread around their mean: the square root of the average squared distance from the mean; pandas .std() divides by n − 1 instead (module 29). (01. Python basics)
Portfolio
A collection of your finished projects that you can show to employers. (Start here)
pos_weight
An argument of BCEWithLogitsLoss that multiplies the loss of positive samples; n_negative / n_positive balances an imbalanced dataset. (42. Deep learning with PyTorch)
Position-based indexing (iloc)
Selecting pandas rows and columns by integer positions with `df.iloc[rows, cols]`; a slice excludes its end, as with lists. (24. pandas fundamentals)
Positional argument
An argument that is matched to a parameter by its position in the call. (05. Functions)
Positional argument (CLI)
A command-line argument whose position gives its meaning, such as the file path in python -m salesreport data/sales.csv. (08. Modules, packages and environments)
Positional-only parameter
A parameter before a / in a definition; callers must pass it by position, never by name. (05. Functions)
Positional-or-keyword parameter
An ordinary parameter, between / and *, that a caller may pass either by position or by name. (05. Functions)
Positive class
The class a binary model looks for, coded 1; 'positive' means 'the thing we look for', not 'good'. (36. Classification)
Positive definite matrix
A symmetric matrix S for which x.T @ S @ x > 0 for every nonzero vector x, equivalently one whose eigenvalues are all strictly positive, such as a non-degenerate covariance matrix. (46. Linear algebra in depth)
Post hoc test
A follow-up test that finds which pairs of groups differ after a significant ANOVA, with control of false alarms. (29. Statistics and probability)
Post-hoc explanation
An explanation computed after training, by probing a fitted model, rather than read from its structure. (43. Interpretability)
Post-mortem debugging
Inspecting the variables of the frame that crashed after the crash, for example with python -m pdb -c continue. (06. Errors and debugging)
Posterior
In Bayes' rule, the updated probability of an event after you see the evidence. (32. Math for ML)
Posterior distribution
The updated probability distribution over an unknown parameter after combining the prior with the likelihood of observed data via Bayes' theorem. (48. Probability, Bayesian statistics and information theory)
Posterior predictive distribution
The distribution of future observations obtained by averaging the likelihood over the full posterior distribution of the model parameters. (48. Probability, Bayesian statistics and information theory)
Potential outcomes
The pair of outcomes a unit would experience under treatment Y(1) and under control Y(0), only one of which is ever observed. (49. Causal inference, GLMs and advanced experimentation)
Power
The probability that a test detects an effect of a given size when the effect is real; 1 minus the Type II error rate. (29. Statistics and probability)
Power curve
A chart of a test's power against the sample size or the effect size. (29. Statistics and probability)
Practical significance
Whether an effect is large enough to matter for a decision, beyond being statistically significant. (29. Statistics and probability)
Precedence
The order in which Python applies operators in an expression, such as * before +. (01. Python basics)
Precision
The number after the dot in a format spec: digits after the decimal point for f, e and %, significant digits for g, or the maximum length of a string. (02. Strings and text)
Precision (classification)
The share of flagged cases that are really positive: true positives / all flagged. (09. Standard library power tools)
Precision at k
The share of real positives among the k rows with the highest scores; the metric for a fixed-capacity call list. (36. Classification)
Precision-recall curve
A plot of precision against recall for every decision threshold; most informative when positives are rare. (36. Classification)
Precondition
A condition that must be true before an algorithm runs, such as sorted input for binary search. (17. Algorithms and data structures)
Predicate
A function that returns True or False, such as a test passed to filter(). (05. Functions)
Predicate pushdown
An optimization that moves a filter into the file reader, so rows that fail it are dropped while the file is read; explain() shows it as SELECTION. (31. Polars)
Prediction drift
A change in the distribution of a model's scores or decisions, such as a higher share of flagged customers. (44. ML in production basics)
Prediction interval
A range that should contain a future actual value with a given probability, such as 95%. (40. Time series)
Predictor (scikit-learn)
An estimator with a predict() method, such as a classifier or a regressor. (34. The scikit-learn workflow)
Presentation type
The letter at the end of a format spec that decides how a value is written, such as f for fixed point, % for percent or d for integers. (02. Strings and text)
Pretrained embedding
Word or sentence vectors learned once from a very large corpus, such as word2vec, GloVe, fastText or a transformer model, and reused in other tasks. (41. NLP fundamentals)
Primary key
The column or set of columns whose values must identify each row of a table uniquely. (26. Data cleaning)
Principal component
A new axis found by PCA: a weighted mix of the original features along which the data varies most, at a right angle to the earlier components. (39. Unsupervised learning)
Principal component analysis (PCA)
A method that replaces many correlated columns by a few main directions of variation, found from the eigenvectors of the covariance or correlation matrix. (23. NumPy)
Prior
In Bayes' rule, the probability of an event before you see the evidence. (32. Math for ML)
Prior distribution
A probability distribution expressing initial belief about an unknown parameter before observing the current dataset. (48. Probability, Bayesian statistics and information theory)
Prior shift
A change in the share of each class, such as a higher churn rate; also called label shift. (44. ML in production basics)
Priority queue
A queue that always serves the item with the best priority next, whatever the arrival order; usually built on a heap. (17. Algorithms and data structures)
Probability density function (PDF)
For a continuous random variable, the curve whose area between two points is the probability of a value in that range. (29. Statistics and probability)
Probability distribution
A description of the values a random variable can take and how likely each one is. (29. Statistics and probability)
Probability mass function (PMF)
For a discrete random variable, the function that gives the probability of each value. (29. Statistics and probability)
Probability of superiority
The chance that a random value from one group is larger than a random value from another, with ties counted as half; 0.5 means no tendency either way. (Capstone 2. Sales analysis)
Problem inventory
A list of the data problems found while profiling a raw file, with a count for each, used as the to-do list of a cleaning pipeline. (26. Data cleaning)
Process
A running program with its own memory and, in Python, its own interpreter. (15. Performance and concurrency)
Product rule
The differentiation rule for products of two functions: (f * g)' = f' * g + f * g'. (47. Calculus and optimization for ML)
Production (ML)
The setting in which other people or software rely on a model's predictions, on new data, again and again. (44. ML in production basics)
Profiler
A tool that records which functions run, how often and for how long. (15. Performance and concurrency)
Profiling
Measuring where a program spends its time, function by function, to find its hotspots. (15. Performance and concurrency)
Program
A list of instructions that a computer carries out. (01. Python basics)
Projection pushdown
An optimization that makes the file reader parse only the columns a query uses; explain() shows it as PROJECT k/n COLUMNS. (31. Polars)
Prompt
The characters, such as >>>, that show where to type the next command or line of code. (Start here)
Propensity score
The probability that a unit receives treatment given its observed pre-treatment covariates, e(X) = P(T = 1 | X). (49. Causal inference, GLMs and advanced experimentation)
Property
An attribute computed by a getter method (and optionally checked by a setter), read and assigned with plain attribute syntax. (18. Classes and objects)
Property-based test
A test that checks a general rule on many generated inputs instead of a few hand-picked examples. (14. Testing with pytest)
Protocol
A set of methods that an object must have to work with a language feature, such as __enter__ and __exit__ for with. (11. Decorators and context managers)
Protocol (typing)
A class that lists the methods and attributes a type must have; any class with a matching shape is accepted, without inheritance. (12. Type hints)
Proxy feature
A feature that stands in for another attribute, such as a postcode that reflects ethnicity, so a model can use the attribute without seeing it. (43. Interpretability)
Pseudo-random number
A number that looks random but comes from a deterministic formula started from a seed. (09. Standard library power tools)
Pseudo-residual
The negative gradient of the loss with respect to the current predictions; the target that each new tree fits in gradient boosting (the plain residual for squared error). (38. Ensembles)
Pseudonymized
Stripped of names and contact details but still carrying an id that can link each record back to a person. (04. Data structures)
pstats
The standard-library module that loads, sorts and prints cProfile results. (15. Performance and concurrency)
Pure function
A function whose return value depends only on its arguments and that has no side effects. (05. Functions)
Push
Adding an item to the top of a stack, or to a heap. (17. Algorithms and data structures)
py.typed
An empty marker file in a package that tells type checkers the package ships its own type hints. (12. Type hints)
pydantic
A library that validates and converts data against type hints at runtime; FastAPI is built on it. (12. Type hints)
PyPI
The Python Package Index (pypi.org), the public server that hosts third-party packages. (08. Modules, packages and environments)
pyplot interface
The state-based Matplotlib API (plt.plot, plt.title) that sends each command to a hidden current figure and Axes. (28. Visualization)
pyproject.toml
The standard file that describes a Python project: its metadata, dependencies, entry points, build system and tool settings. (08. Modules, packages and environments)
pyright
A fast static type checker from Microsoft that also powers the Pylance extension in VS Code. (12. Type hints)
pytest
The standard third-party test runner for Python; it finds test files and functions, runs them and reports the results. (14. Testing with pytest)
pytest-cov
A pytest plugin that measures code coverage with the coverage package (pytest --cov). (14. Testing with pytest)
pytest.approx
A pytest helper that makes a number, list, dict or array compare equal to values within a tolerance. (14. Testing with pytest)
pytest.raises
A context manager that passes only if its block raises the given exception, optionally with a message matching match=. (14. Testing with pytest)
python -m
The command that runs a module or package by its module name instead of its file path. (08. Modules, packages and environments)
Python data model
The rules that connect Python syntax to your objects: which special method runs for len(x), x[0], a + b, for, with or print(). (20. The Python data model)
Pythonic
Written in the clear, idiomatic style that experienced Python developers use. (03. Control flow)
PyTorch
A Python library for deep learning with tensors, automatic gradients (autograd) and building blocks for models, losses, optimizers and data loading. (42. Deep learning with PyTorch)

Q

Q-Q plot
A plot of sorted data against the quantiles of a reference distribution; points on a straight line mean the data follows that distribution. (29. Statistics and probability)
QR factorization
Factoring a matrix X into an orthonormal matrix Q and an upper-triangular matrix R (X = QR), enabling numerically stable least-squares solving without forming X.T @ X. (46. Linear algebra in depth)
Quadratic time
Work that grows with the square of the size of the data, written O(n²); ten times the data, about a hundred times the work. (04. Data structures)
QUALIFY
A DuckDB clause that filters rows on the result of a window function, after the windows are computed. (30. SQL for data analysis)
Qualitative palette
A set of distinct colors for categories that have no order. (28. Visualization)
Quality dimension
One testable aspect of data quality, such as completeness (values present) or uniqueness (each real thing stored once). (26. Data cleaning)
Quantifier
A regex symbol such as *, +, ? or {m,n} that says how many times the item before it may repeat. (09. Standard library power tools)
Quantile
The value below which a given share of the data falls; the 0.9 quantile is above 90% of the values. (27. Exploratory data analysis)
Quantize
The Decimal method that rounds a value to a fixed exponent, such as cents, with a chosen rounding rule. (13. Pythonic code)
Quartile
One of the three cut points that split sorted data into four equal parts. (09. Standard library power tools)
Query
One request to a database, written in SQL, such as a SELECT statement that returns rows. (30. SQL for data analysis)
Query optimizer
The part of Polars that rewrites a query plan into a faster plan with the same result before it runs. (31. Polars)
Query parameter
One name=value pair in a query string; it filters, sorts or pages the result of a request. (16. APIs and web data)
Query plan
The tree of steps (scan, filter, join, aggregate, sort) that a lazy query runs to produce its result. (31. Polars)
Query string
The part of a URL after the ?, made of name=value pairs joined by &. (16. APIs and web data)
query()
The DataFrame method that filters rows with a string expression, such as `df.query("age >= @min_age")`, where `@` refers to a Python variable. (24. pandas fundamentals)
Queue
A line of items processed in arrival order: first in, first out. (09. Standard library power tools)
Quickselect
A divide-and-conquer selection algorithm that partitions around a pivot and recurses into only one side, finding the k-th smallest item or median in O(n) expected time. (45. Algorithms and data structures II)
Quotient rule
The differentiation rule for ratios of functions: (f / g)' = (f' * g - f * g') / g^2 whenever g is nonzero. (47. Calculus and optimization for ML)
Quoting
Wrapping a CSV field in double quotes so that it can contain the delimiter, quotes or line breaks, as in "January 7, 2023". (07. Files and data formats)

R

Race condition
A bug that appears when the state of the world changes between two steps, for example a file deleted between an exists check and the read. (13. Pythonic code)
Raise
To signal an exception: Python stops the current line and looks for code that handles the error. (06. Errors and debugging)
Random forest
An ensemble of deep decision trees, each trained on a bootstrap sample (and often with a random subset of features at each split), whose predictions are averaged. (35. Regression)
Random generator
A NumPy Generator object from np.random.default_rng(seed) that draws arrays of random numbers. (23. NumPy)
Random sample
A sample in which every member of the population has the same chance of being chosen. (29. Statistics and probability)
Tuning by drawing a fixed number of random candidates from distributions of hyperparameter values. (37. Model evaluation and tuning)
Random variable
A quantity whose value depends on chance, such as the number of buyers among the next 200 visitors. (29. Statistics and probability)
Random walk
A series where each value is the previous value plus a random shock; it is not stationary. (40. Time series)
Randomized controlled experiment
An experiment that assigns treatments by chance, which breaks the link to every confounder. (29. Statistics and probability)
Range
The difference between the largest and the smallest value in a set. (01. Python basics)
range()
A built-in that produces whole numbers from a start up to, but not including, a stop, with an optional step. (03. Control flow)
RangeIndex
The compact default index of a DataFrame: the row numbers 0 to n − 1, stored as a start, a stop and a step. (24. pandas fundamentals)
Rank
The position of a value in sorted order: 1 for the smallest, 2 for the next, and so on. (27. Exploratory data analysis)
Rank (matrix)
The number of linearly independent columns of a matrix; lstsq reports it. (32. Math for ML)
RANK and DENSE_RANK
Window functions that give tied rows the same number; RANK then skips numbers, DENSE_RANK does not. (30. SQL for data analysis)
Rank-1 approximation
The best approximation of a matrix by one column vector times one row vector, built from the first SVD pattern. (23. NumPy)
Rank-biserial correlation
An effect size for the Mann–Whitney test on a −1 to 1 scale: 1 − 2U/(n1·n2). (29. Statistics and probability)
Raster image
An image stored as a grid of pixels, such as PNG; it blurs when enlarged. (28. Visualization)
Rate limit
A cap on how many requests a client may send in a time window; going over it gives 429 Too Many Requests. (16. APIs and web data)
Raw string
A string literal with r before the quote, in which a backslash is an ordinary character, as in r"C:\data\new.csv". (02. Strings and text)
RBF kernel
The radial basis function kernel, exp(-gamma * squared distance), which scores close points as similar; the default of SVC. (36. Classification)
rcParams
Matplotlib's dict of default settings, such as figure size, fonts, colors and grid. (28. Visualization)
Re-iterable
An iterable that returns a fresh iterator for each loop, such as a list or a class whose __iter__ is a generator. (10. Iterators and generators)
Re-raise
To raise the exception that is being handled again, with a bare raise inside an except block. (06. Errors and debugging)
Read-only connection
A connection that can query a database but not change it; in sqlite3, the URI file:path?mode=ro with uri=True. (30. SQL for data analysis)
Readiness check
A health check that asks whether a copy of a service can serve requests now; when it fails, the platform stops sending traffic to it but does not restart it. (Capstone 8. Deployment)
Recall
The share of real positive cases that a classifier flags: true positives / all real positives. (09. Standard library power tools)
Recency
In RFM analysis, the number of days between a customer's last order and the snapshot date. (Capstone 5. Customer segmentation)
Reconciliation
A check that the target of a data load holds the same counts and totals as its source. (10. Iterators and generators)
Reconstruction error
The mean squared difference between the original data and the data rebuilt from a reduced representation, for example with PCA's inverse_transform. (39. Unsupervised learning)
Records
A table stored as a list of dicts, one dict per row. (04. Data structures)
Recursion
A technique in which a function calls itself on smaller parts of its input until it reaches a base case. (05. Functions)
Recursion limit
The maximum depth of the Python call stack, 1,000 frames by default; deeper recursion raises RecursionError. (17. Algorithms and data structures)
RecursionError
The error raised when the call stack exceeds Python's depth limit, usually because a recursive function never reaches its base case. (05. Functions)
Recursive
Applied to a folder and to all folders inside it, level by level, as rglob() does. (07. Files and data formats)
Recursive case
The part of a recursive function that splits the input and calls the function on the smaller parts. (05. Functions)
Recursive feature elimination (RFE)
A wrapper method that fits a model, removes the weakest feature by coefficient or importance, and repeats until the wanted number remain. (33. Feature engineering)
Recursive forecasting strategy
Forecasting several steps ahead with a one-step model whose predictions are fed back as the lags of the next step. (40. Time series)
Red-green-refactor
The TDD cycle: write a failing test (red), write the least code that passes (green), clean up while the tests stay green (refactor). (14. Testing with pytest)
Redundant feature
A feature that carries almost the same information as another one, such as house size and number of bathrooms. (27. Exploratory data analysis)
Refactor
To change the structure of code, for example its names or layout, without changing what it does. (01. Python basics)
Reference
The link from a name (or a container slot) to an object; assignment copies the reference, not the object. (04. Data structures)
Reference category
The category that one-hot encoding with drop="first" removes; the coefficients of the other categories are differences from it. (43. Interpretability)
Reference data
The data that new data is compared with to detect drift, usually the training set. (44. ML in production basics)
Reference level
The level of a categorical predictor that has no dummy variable; other levels are compared with it. (29. Statistics and probability)
Reference profile
A compact summary of the training data (bin edges and shares) saved with a model, so drift checks do not need the training data. (44. ML in production basics)
Referential integrity
The rule that every foreign key points to a row that exists in the referenced table. (26. Data cleaning)
Reflected operator
The right-hand version of a binary operator, such as __radd__ or __rmul__, that Python calls when the left operand returns NotImplemented. (20. The Python data model)
Regex flag
An option such as re.IGNORECASE, re.MULTILINE or re.VERBOSE that changes how a pattern matches. (09. Standard library power tools)
Registration decorator
A decorator that records a function in a registry, such as a dict of pipeline steps, and returns it unchanged. (11. Decorators and context managers)
Registry
A dict that maps names to functions or classes, so that a text config can choose them by name. (05. Functions)
Regression
A break in behavior that used to work, caused by a later change. (14. Testing with pytest)
Regression line
The straight line that fits a scatter of points best by least squares. (28. Visualization)
Regression test
A test that reproduces a fixed bug and stays in the suite so the bug cannot return unnoticed. (14. Testing with pytest)
Regular expression (regex)
A pattern in a small language that describes text, used to search, validate, extract or replace parts of strings. (09. Standard library power tools)
Regularization
Adding a penalty on the size of the weights, such as an L1 or squared L2 norm, to the training loss so that a model prefers small weights. (32. Math for ML)
Regularization strength (alpha)
The hyperparameter that scales the penalty in Ridge, Lasso and ElasticNet; 0 means no penalty and larger values shrink the weights more. (35. Regression)
Relation (DuckDB)
The lazy object that duckdb.sql() returns; it describes a query result and gives rows with fetchall(), df() or show(). (30. SQL for data analysis)
Relational database
A database that keeps its data in tables of rows and named, typed columns, linked by keys. (30. SQL for data analysis)
Relative error
A difference divided by the size of the values compared, so that one threshold works at any scale. (32. Math for ML)
Relative import
An import inside a package that starts with a dot: . is the current package and .. its parent. (08. Modules, packages and environments)
Relative lift
The change of a rate relative to its baseline, such as (11.7% − 10.1%) / 10.1% = +15%. (29. Statistics and probability)
Relative path
A file path, such as data/sales.csv, that starts from the working directory instead of the top of the disk. (Start here)
Relative tolerance
An allowed difference expressed as a fraction of the expected value, such as rel=1e-6 (one part in a million). (14. Testing with pytest)
ReLU
The rectified linear unit activation, max(0, z): it keeps positive values and sets negative values to 0. (42. Deep learning with PyTorch)
Remainder (ColumnTransformer)
What a ColumnTransformer does with columns that no branch lists: drop them (the default) or pass them through unchanged. (34. The scikit-learn workflow)
Remainder (decomposition)
What is left of a time series after the trend and the seasonal part are removed: noise and one-off events. (40. Time series)
REPL
An interactive Python session that reads a line, evaluates it, prints the result and waits for the next line. (Start here)
Replacement character
The character � (U+FFFD) that stands in for a byte that could not be decoded. (02. Strings and text)
Replacement field
A part of an f-string or a str.format() template in curly braces, which is replaced by a formatted value. (02. Strings and text)
Replacement scan
The DuckDB feature that lets a query read a pandas DataFrame or a relation by its Python variable name. (30. SQL for data analysis)
repr()
A built-in function that shows a value as you would write it in code, with quotes and escape sequences, so hidden spaces and line breaks become visible. (02. Strings and text)
Reproducible
Giving the same results on every run, for example because the random generator starts from a fixed seed. (23. NumPy)
Request
The message a client sends: a method, a URL, headers and an optional body. (16. APIs and web data)
Request ID
A short string that names one HTTP request; the service puts it in every log line of that request and sends it back in a header, so clients and operators can find the same request. (Capstone 8. Deployment)
Request model
A pydantic model that describes and validates the JSON body a client must send to an endpoint. (44. ML in production basics)
requests
The classic third-party Python library for HTTP requests. (16. APIs and web data)
Requirements file
A text file, usually requirements.txt, that lists the packages a project needs, one per line. (Start here)
requires_grad
A tensor flag that tells autograd to record the operations on the tensor and to compute its gradient. (42. Deep learning with PyTorch)
Resampling
Changing the frequency of a time series, for example from 10-minute readings to hourly means. (40. Time series)
Reshape
Giving the same elements of an array a new shape with the same number of elements, read in row order. (23. NumPy)
Residual
The true value minus the model's prediction for one observation. (23. NumPy)
Residual plot
A chart of residuals, usually against fitted values, used to spot curves, funnels and outliers that a single metric hides. (35. Regression)
Residual-based prediction band
A prediction band built from the quantiles of a model's past forecast errors, for example in a backtest, instead of from the model's own equations. (Capstone 6. Demand forecasting)
Resolver
The part of an installer that reads every version specifier and picks one version of each package that satisfies them all. (08. Modules, packages and environments)
Resource (successive halving)
The budget that successive halving increases each round, usually the number of training rows or trees. (37. Model evaluation and tuning)
Response
The message a server sends back: a status code, headers and a body. (16. APIs and web data)
Response model
A pydantic model that describes, validates and filters the JSON an endpoint returns. (44. ML in production basics)
Result set
The rows that a query returns. (30. SQL for data analysis)
Retention table
A table with one row per cohort and one column per period since the start, showing the share of the cohort still active. (25. pandas advanced)
Retraining
Fitting the same pipeline again on newer data, which produces a new model version. (44. ML in production basics)
Retransformation bias
The systematic underestimate of the mean that appears when you back-transform log-scale predictions with exp, because the exponential of an average log is below the average value. (35. Regression)
Retry
Calling a failed operation again; in this course, attempts counts every call, the first one included, and a wait comes before each retry. (11. Decorators and context managers)
Retry-After
A response header that tells the client how many seconds, or until which date, to wait before the next request. (16. APIs and web data)
Return value
The value that a function gives back to the code that called it. (01. Python basics)
reveal_type()
A function that makes the type checker print the type it infers for an expression; at runtime it prints the runtime type to stderr. (12. Type hints)
Reverse causation
The outcome causes the supposed cause, not the other way round, such as customers who plan to leave opening more support tickets. (27. Exploratory data analysis)
Reverse-mode automatic differentiation
Computing exact derivatives of a scalar output with respect to all inputs in a single backward pass over a computation graph in reverse topological order. (47. Calculus and optimization for ML)
RFM analysis
Describing each customer's buying with three numbers: recency (days since the last order), frequency (how often the customer orders) and monetary value (how much the customer spends). (Capstone 5. Customer segmentation)
Rich comparison method
One of __lt__, __le__, __gt__, __ge__, __eq__ and __ne__, the special methods behind the six comparison operators. (20. The Python data model)
Ridge regression
Linear regression with an L2 penalty on the weights, which keeps them small and stable when features are correlated or numerous. (35. Regression)
Right censoring
In survival analysis, knowing only that a unit survived past the end of observation without yet experiencing the event. (49. Causal inference, GLMs and advanced experimentation)
Right join
A merge that keeps every row of the right table. (25. pandas advanced)
Right-skewed distribution
A distribution with most values small and a long tail of large values, so the mean lies above the median; also called positively skewed. (27. Exploratory data analysis)
RMSProp
An adaptive first-order optimizer that scales each parameter's step inversely by the square root of an exponential moving average of its squared gradients. (47. Calculus and optimization for ML)
robots.txt
A file at the root of a website that says which paths automated clients may visit. (16. APIs and web data)
Robust scaling
Scaling that subtracts the median and divides by the interquartile range, so that outliers barely affect it (RobustScaler). (33. Feature engineering)
Robust standard deviation
A spread estimate that outliers barely move, such as 1.4826 times the median absolute deviation, which equals the standard deviation for normal data. (35. Regression)
Robust statistic
A measure, such as the median, that single outliers barely move. (10. Iterators and generators)
Robust z-score
A z-score that uses the median and the MAD instead of the mean and the standard deviation, so extreme values cannot move it. (26. Data cleaning)
ROC curve
A plot of the true positive rate against the false positive rate for every decision threshold. (36. Classification)
ROC-AUC
A score from 0.5 (random ranking) to 1.0 (perfect ranking) that measures how well a classifier ranks positive cases above negative ones. (33. Feature engineering)
Rollback
Undoing every change made since a starting point after an error, so that no partial result remains. (11. Decorators and context managers)
Rolling feature
A model feature computed from a past window of the target, such as the mean of the 28 days that end 28 days earlier. (40. Time series)
Rolling median
The median of a moving window of values; it follows a trend but ignores single spikes. (28. Visualization)
Rolling statistic
A statistic such as a mean or standard deviation computed on a moving window of the last k rows. (40. Time series)
Rolling window
The last n values of a stream, updated as each new value arrives; used for moving averages and alarms. (09. Standard library power tools)
Root
The top node of a tree, the only node without a parent. (17. Algorithms and data structures)
Root (decision tree)
The first split of a decision tree, at the top, which every row passes through. (38. Ensembles)
Root logger
The logger at the top of the logger tree; logging.basicConfig() configures it. (06. Errors and debugging)
Root mean squared error (RMSE)
The square root of the mean squared error, in the units of the target. (18. Classes and objects)
Round half to even
A rounding rule that rounds an exact half to the neighbor with an even last digit: 85.025 becomes 85.02. Python's round() and NumPy use it. (13. Pythonic code)
Round half up
A rounding rule that rounds an exact half away from zero: 116.955 becomes 116.96. Accounting systems often use it. (13. Pythonic code)
Row
One record in a table, for example one sale or one customer. (Start here)
ROW_NUMBER
A window function that numbers the rows of each partition 1, 2, 3, … with no ties. (30. SQL for data analysis)
Ruff
A fast Python linter and formatter. (Start here)
Rule code
The identifier of one linter rule: a family prefix and a number, such as F401 (unused import) or B006 (mutable default). (13. Pythonic code)
Rule of three
Wait until code is repeated a third time before you extract the shared part, because by then you know what really varies. (22. Design principles and patterns)
Run
In Timsort, a stretch of the data that is already in ascending or strictly descending order. (17. Algorithms and data structures)
Run (MLflow)
One execution of training code, with its logged parameters, metrics, tags and artifacts. (44. ML in production basics)
Runbook
A short document with the steps, and a check after each step, that an operator follows for a routine task or an incident, such as a deploy or a rollback. (Capstone 8. Deployment)
Running total
A cumulative sum that adds each row's value to the values of all rows before it. (30. SQL for data analysis)
Runtime
The moment when the code actually runs, as opposed to the time when a tool reads it. (12. Type hints)
runtime_checkable
A decorator that allows isinstance() checks with a Protocol; the check only tests that the methods exist. (12. Type hints)
Rust
A compiled systems programming language, about as fast as C, in which Polars is written. (31. Polars)

S

Saddle point
A stationary point where the gradient is zero and the Hessian has both positive and negative eigenvalues, curving upward in some directions and downward in others. (47. Calculus and optimization for ML)
Safe fix
An automatic linter fix that keeps the behavior of the code, such as removing an unused import. (13. Pythonic code)
Safe method
An HTTP method that does not change data on the server, such as GET. (16. APIs and web data)
Safety stock
Extra stock held above the forecast so that demand higher than planned does not cause a stockout. (Capstone 6. Demand forecasting)
Sample
The part of a population that you actually observe and measure. (29. Statistics and probability)
Sample ratio mismatch (SRM)
A split between experiment groups that differs from the planned ratio by more than chance allows. (29. Statistics and probability)
Sample standard deviation
A measure of spread that divides the sum of squared deviations by n - 1; statistics.stdev and pandas .std() compute it. (09. Standard library power tools)
Sample weight
A number per training row that sets how much that row counts in the loss of a model; AdaBoost changes these weights between rounds. (38. Ensembles)
Sampler (Optuna)
The Optuna component that proposes the hyperparameter values of the next trial. (37. Model evaluation and tuning)
Sampling bias
A systematic difference between a sample and its population caused by how the sample was chosen. (29. Statistics and probability)
Sampling distribution
The distribution of a statistic over many repeated samples from the same population. (29. Statistics and probability)
Sampling profiler
A profiler, such as py-spy, that looks at a running program many times per second; it adds little overhead. (15. Performance and concurrency)
Sampling with replacement
Drawing items so that each drawn item goes back into the pool and can be drawn again. (09. Standard library power tools)
SARIMA
Seasonal ARIMA: ARIMA plus AR, differencing and MA terms at the seasonal lag, with order (P, D, Q, s). (40. Time series)
SARIMAX
SARIMA with exogenous variables; also the name of the statsmodels class that fits all these models. (40. Time series)
Scalar
A single number, as opposed to a vector or a matrix; multiplying a vector by a scalar multiplies every element. (32. Math for ML)
Scatter plot
A chart with one point per row and one variable on each axis, used to see how two numeric variables relate. (27. Exploratory data analysis)
Schema
The description of a database: its tables, their columns and types, and the keys that link them. (30. SQL for data analysis)
Schema (Polars)
The ordered mapping from column name to dtype of a DataFrame or LazyFrame, available as df.schema or lf.collect_schema(). (31. Polars)
Schema inference
Working out each column's dtype from the data, which pl.read_csv does from the first 100 rows by default. (31. Polars)
Scientific notation
Writing a number as a value times a power of 10; in Python, 1e-3 means 0.001. (01. Python basics)
SciPy
The scientific-computing library of Python; its scipy.stats module holds distributions and statistical tests. (29. Statistics and probability)
Scope
The region of a program in which a name is visible. (05. Functions)
Scorer
A callable object that scores a fitted model on data, called as scorer(model, X, y), with greater always meaning better. (20. The Python data model)
Scoring name
A string such as "roc_auc", "r2" or "neg_root_mean_squared_error" that tells scikit-learn which metric to compute; errors are negated so that higher is always better. (34. The scikit-learn workflow)
Scree plot
A plot of the explained variance ratio (or its running total) against the component number, used to choose how many components to keep. (39. Unsupervised learning)
Script
A text file of Python code, ending in .py, that you run as a whole with one command. (Start here)
Seaborn
A statistical plotting library built on Matplotlib that draws charts from a DataFrame and column names. (28. Visualization)
A loop that looks for the first item that meets a condition and stops there. (03. Control flow)
Search space
The set of hyperparameter values or distributions that a search may try. (37. Model evaluation and tuning)
Seasonal difference
The change from the value one season earlier, such as y_t - y_(t-7) for a weekly pattern; in pandas, y.diff(7). (40. Time series)
Seasonal naive forecast
A forecast that repeats the value of the same position in the last season, such as last Monday's value for next Monday. (40. Time series)
Seasonal period
The number of steps in one seasonal cycle: 7 for daily data with a weekly pattern, 24 for hourly data with a daily pattern. (40. Time series)
Seasonality
A pattern in a time series that repeats with a fixed period, such as busy weekdays and quiet weekends. (40. Time series)
Seed
The starting value of a pseudo-random generator; the same seed gives the same sequence of numbers. (09. Standard library power tools)
Segment
A cluster with a name and a business meaning, such as "Loyal veterans". (39. Unsupervised learning)
Selection bias (tuning)
The upward bias of the best cross-validated score, because it is the maximum of many noisy estimates. (37. Model evaluation and tuning)
Selector (Polars)
An object from polars.selectors, such as cs.numeric(), that picks columns by dtype or name pattern. (31. Polars)
Self
The typing name for "the class of this object", used for methods such as fit that return self. (12. Type hints)
Self join
A join of a table with itself, for example on order_id to pair the categories bought in the same order. (31. Polars)
self parameter
The conventional name of a method's first parameter, which receives the instance before the dot. (18. Classes and objects)
Self-join
A join of a table with itself under two aliases, for example to pair the products of the same order. (30. SQL for data analysis)
Self-merge
A merge of a table with itself, for example on order_id to pair the lines of the same order. (25. pandas advanced)
Semantic mapping
In Seaborn, the link from a DataFrame column to a visual property such as position, color (hue), size or style. (28. Visualization)
Semantic versioning
A version scheme MAJOR.MINOR.PATCH: raise MAJOR for breaking changes, MINOR for new features and PATCH for bug fixes. (08. Modules, packages and environments)
Semaphore
A counter-based lock that lets at most n tasks into a block at a time. (15. Performance and concurrency)
Semi join
A join that keeps each left row that has a match in the right table, once, with only the left columns. (31. Polars)
Semi-join
A join pattern that keeps each left row with at least one match, once, written with WHERE EXISTS. (30. SQL for data analysis)
Sentiment analysis
Finding the opinion in a text, such as positive, negative or neutral, sometimes with a score. (41. NLP fundamentals)
Sentiment lexicon
A hand-made list of words with a sentiment score each; a text's score is the sum of the scores of its words. (41. NLP fundamentals)
Sentinel
A special value that marks the end of the data, such as a STOP line. (03. Control flow)
Sequence
An ordered series of items, such as the characters of a string. (01. Python basics)
Sequence pattern
A pattern in square brackets, such as ["READ", sensor_id, value], that matches a list or tuple of a given shape. (03. Control flow)
Sequential colormap
A colormap that runs from light to dark for values from low to high, such as viridis. (28. Visualization)
Sequential feature selection
A wrapper method that adds (forward) or removes (backward) one feature at a time, choosing the step that best improves the cross-validated score. (33. Feature engineering)
Sequential testing
Test designs that allow repeated looks at the data while keeping the false-positive rate under control. (29. Statistics and probability)
Serialization
Turning an object in memory into bytes or text that can be stored or sent, such as json.dump() or pickle.dump(). (07. Files and data formats)
Series
A pandas column: a sequence of values of one dtype with one label per value, such as unit prices labeled by product id. (24. pandas fundamentals)
Series.map
The pandas method that replaces each value of a Series by a lookup in a dict or Series, or by a function call; unmatched keys give NaN. (24. pandas fundamentals)
Server
The program or computer that receives requests and sends responses. (16. APIs and web data)
Set
An unordered collection of unique, hashable values with fast membership tests and set operations. (04. Data structures)
Set algebra
Operations that combine sets: union (|), intersection (&), difference (-) and symmetric difference (^). (04. Data structures)
set_output
The scikit-learn method that makes transformers return pandas DataFrames with named columns instead of NumPy arrays; call it before fit(). (34. The scikit-learn workflow)
Setter
The method of a property, made with @name.setter, that runs on every assignment and can validate the value. (18. Classes and objects)
SHA-256 hash
A 64-character fingerprint of a file's bytes that changes completely when any byte changes. (30. SQL for data analysis)
Shadowing
Hiding a name from an outer scope by assigning the same name in an inner scope, for example a variable called sum that hides the built-in sum(). (05. Functions)
Shallow copy
A new outer container whose elements are the same objects as in the original, made by copy() or list(x). (04. Data structures)
Shallow immutability
Immutability that blocks assignment to an object's fields but not changes inside the objects they refer to, such as appending to a list field. (21. Dataclasses, enums and slots)
Shallow size
The memory of an object itself, without the objects it refers to; sys.getsizeof() returns it. (21. Dataclasses, enums and slots)
Shannon entropy
The expected self-information (surprise) of a probability distribution, measuring its average uncertainty in bits or nats. (48. Probability, Bayesian statistics and information theory)
SHAP value
The Shapley value of one feature for one prediction: how far that feature moved the prediction away from the base value. (43. Interpretability)
Shape
The tuple of axis lengths of an array, such as (3, 4) for 3 rows and 4 columns. (23. NumPy)
Shapiro–Wilk test
A test of the null hypothesis that data is normally distributed; scipy.stats.shapiro. (29. Statistics and probability)
Shapley value
In cooperative game theory, a player's fair share of a team's payout: the player's added value averaged over every order of joining the team. (43. Interpretability)
Share of growth
The part of a total change that one group delivered: its change divided by the total change; the shares of all groups add up to 100%. (Capstone 2. Sales analysis)
Shell
The program that reads and runs terminal commands, such as bash, zsh or PowerShell. (09. Standard library power tools)
Shell injection
An attack in which input passed to a shell command runs extra commands; avoided by passing subprocess a list of arguments. (09. Standard library power tools)
Short-circuit evaluation
and and or stop evaluating as soon as the result is known, so the right side may never run. (03. Control flow)
Shrinkage
The pull of model weights toward zero caused by a regularization penalty. (35. Regression)
Shrinkage (boosting)
Another name for the learning rate of gradient boosting: the fraction of each new tree's prediction that is added to the model. (38. Ensembles)
Side effect
Any change a function makes outside its return value, such as printing, writing a file or changing a list that was passed in. (05. Functions)
Sidecar file
A small file stored next to another file to describe it, such as a JSON file with a model's metadata and SHA-256 hash. (44. ML in production basics)
Sigmoid function
The function 1 / (1 + e^(-z)) that maps any real number to a probability between 0 and 1; also called the logistic function. (32. Math for ML)
Sign test
A test of whether positive and negative values are equally likely, based only on how many values are below zero; it uses the binomial distribution with p = 0.5. (Capstone 3. House price regression)
Signal (Django)
A Django event, such as post_save, that any code can subscribe to with a handler function; an observer-pattern system. (22. Design principles and patterns)
Signature
The name of a function together with its parameter list, such as summarize(readings, *, digits=1). (05. Functions)
Significance level (alpha)
The false-positive rate you accept for a test, chosen in advance; usually 0.05. (29. Statistics and probability)
Silent bug
A bug that produces a wrong result without any error message. (12. Type hints)
Silhouette score
The mean over all rows of (b − a) / max(a, b), where a is a row's mean distance to its own cluster and b to the nearest other cluster; from −1 to 1, higher is better. (39. Unsupervised learning)
Simpson's paradox
A trend that appears in pooled data but reverses or vanishes inside the subgroups, caused by a confounder. (27. Exploratory data analysis)
Single linkage
A linkage that uses the distance between the closest pair of rows of two clusters; it can follow long, curved shapes. (39. Unsupervised learning)
Single responsibility principle
A class or function should have one reason to change, such as one requirement or one person who asks for changes. (22. Design principles and patterns)
Singleton
A value that has exactly one object, such as None, True and False; compare singletons with is. (13. Pythonic code)
Singular matrix
A square matrix with no inverse, because one of its rows is a combination of the others. (23. NumPy)
Singular value
One diagonal value of Σ in an SVD; its square measures how much of the matrix its pair of patterns explains. (23. NumPy)
Singular value decomposition (SVD)
Writing any matrix as U Σ Vᵀ: patterns over the rows, singular values and patterns over the columns. (23. NumPy)
Sink
The last stage of a pipeline: it consumes the stream and produces a result such as a total, counts or a file. (10. Iterators and generators)
site-packages
The folder of an environment where installers put third-party packages. (08. Modules, packages and environments)
Skewness
A measure of how lopsided a distribution is; positive for a long right tail, negative for a long left tail, near 0 for a symmetric shape. (27. Exploratory data analysis)
skops
A library whose skops.io format saves scikit-learn models and checks the content before loading, a safer choice than pickle for files from others. (34. The scikit-learn workflow)
Slice
A part of a sequence selected with s[start:stop:step]; it starts at start and stops before stop, and out-of-range bounds are clipped instead of raising an IndexError. (02. Strings and text)
Slice object
The object that x[start:stop:step] passes to __getitem__; it holds the start, stop and step of the slice. (20. The Python data model)
Sliding window
A fixed-size view that moves along a sequence one element at a time; as an algorithm pattern, it updates the previous window's result with the element that enters and the one that leaves. (17. Algorithms and data structures)
Slot
A fixed storage place for one attribute inside an object of a class that defines __slots__. (21. Dataclasses, enums and slots)
Small integer cache
A CPython detail: one shared object for each integer from -5 to 256, so is can seem to work for small numbers. (13. Pythonic code)
Small multiples
A grid of small charts with the same axes, one per group, that the reader compares panel by panel. (28. Visualization)
Smoke test
A quick test that checks that the basics work, such as a model training and beating a naive baseline. (14. Testing with pytest)
Smooth idf
The idf variant that adds 1 to the number of documents and to each document frequency, as if one extra document contained every word, so no division by zero can happen. (41. NLP fundamentals)
Smoothing (target encoding)
Mixing a category's target mean with the global mean, weighted by the category's size, so that rare categories get reliable values. (33. Feature engineering)
SMOTE
Synthetic Minority Over-sampling Technique: it creates new rare-class rows on the lines between a rare row and its rare-class neighbors. (37. Model evaluation and tuning)
SMOTENC
A SMOTE variant for mixed data: it interpolates the numeric columns and gives each categorical column the most common value among the neighbors. (37. Model evaluation and tuning)
snake_case
A naming style with lowercase words joined by underscores, such as monthly_charges. (01. Python basics)
Snapshot date
The fixed date when a dataset was extracted, used as the reference for elapsed-time features such as days since signup. (33. Feature engineering)
Soft assignment
Giving each row a probability for every cluster, as a Gaussian mixture does with predict_proba. (39. Unsupervised learning)
Soft voting
Voting that averages the predicted probabilities of the models, optionally with weights, and predicts the class with the highest average. (38. Ensembles)
Softmax
The function exp(z_k) / sum of exp(z_j) that turns K class scores into K positive probabilities that add up to 1. (36. Classification)
SOLID
Five design principles: single responsibility, open/closed, Liskov substitution, interface segregation and dependency inversion. (22. Design principles and patterns)
Source
The first stage of a pipeline: it produces raw items from a file, a database or an API. (10. Iterators and generators)
Source code
The text of a program, as a person writes it; Python source code lives in .py files. (01. Python basics)
Space complexity
How the extra memory that an algorithm needs grows with the size of its input. (17. Algorithms and data structures)
Spaced practice
Reviewing a topic several times with growing gaps between the reviews, so the skill lasts longer. (Start here)
Span
The set of all linear combinations that can be formed from a given collection of vectors. (46. Linear algebra in depth)
Span (ewm)
A way to set the EWMA weight: alpha = 2 / (span + 1). (25. pandas advanced)
Sparse matrix
A matrix format that stores only the non-zero values and their positions, which saves memory for mostly-zero data. (33. Feature engineering)
Sparse vector
A vector in which most elements are exactly 0. (32. Math for ML)
spawn
The start method that launches a fresh interpreter and imports the main script; the default on macOS and Windows. (15. Performance and concurrency)
SPDX identifier
A standard short name for a software license, such as MIT or Apache-2.0, used in the license field of pyproject.toml. (08. Modules, packages and environments)
Spearman rank correlation
The Pearson correlation of the ranks of two variables; it measures monotonic association and is less sensitive to outliers than Pearson. (27. Exploratory data analysis)
Special method
A method with two leading and two trailing underscores, such as __len__, that Python calls for you when you use a language feature; also called a dunder method. (20. The Python data model)
Specificity
The share of real negatives that the model predicts as negative, TN / (TN + FP); the recall of the negative class. (36. Classification)
Spectral theorem
The guarantee that every real symmetric matrix S can be decomposed as S = Q Lambda Q.T with real eigenvalues and mutually orthogonal eigenvectors. (46. Linear algebra in depth)
Spike
A single reading far above the recent normal values of its sensor. (10. Iterators and generators)
Spine
One of the four lines that frame a Matplotlib Axes; many styles hide the top and right spines. (28. Visualization)
Split (decision tree)
One yes/no question in a decision tree, a feature compared with a threshold, chosen to reduce the error the most. (35. Regression)
Split conformal prediction
A way to build prediction intervals from the quantiles of a model's errors on data it did not train on; the intervals cover the chosen share of new values when the new data resemble that held-out data. (Capstone 3. House price regression)
Split-apply-combine
The pattern behind groupby: split rows into groups by a key, apply a function to each group, combine the results. (25. pandas advanced)
Split-half validation
Splitting the rows at random into two halves, building a model on one half and checking that its results hold on the other half. (Capstone 5. Customer segmentation)
Spurious correlation
A correlation between two variables with no causal link, often because both trend over time. (29. Statistics and probability)
SQL
Structured Query Language: the standard declarative language for querying and changing relational databases. (30. SQL for data analysis)
SQL dialect
One engine's variant of SQL, with its own functions, types and small rule differences. (30. SQL for data analysis)
SQL injection
An attack in which input pasted into SQL text contains SQL code that the engine then runs. (30. SQL for data analysis)
SQLAlchemy
A Python library that connects to many databases; pandas needs it for every database except sqlite3. (30. SQL for data analysis)
SQLite
A small embedded database engine that stores a whole database in one file; Python includes it as the sqlite3 module. (30. SQL for data analysis)
sqlite3
The standard-library module for SQLite, a database stored in one file or in memory. (10. Iterators and generators)
src layout
A project layout with the package folder inside src/, so that tests run against the installed package. (08. Modules, packages and environments)
Stable sort
A sort in which items with equal keys keep their original order; sorted() and list.sort() are stable. (05. Functions)
Stack
A collection where items are added and removed at the same end, the top; in Python, a list with append() and pop(). (17. Algorithms and data structures)
Stacking
An ensemble in which a second model, the meta-learner, learns how to combine the out-of-fold predictions of the base models. (38. Ensembles)
Stage
One step of a pipeline; in a lazy pipeline, a generator that takes an iterator and returns an iterator. (10. Iterators and generators)
Staged prediction
The predictions of a boosted model after 1, 2, 3, … trees, produced from one fit with staged_predict or staged_predict_proba. (38. Ensembles)
Standard error
The typical size of the error of an estimate that comes from sampling. (09. Standard library power tools)
Standard error (stderr)
The output stream for errors and log messages, separate from standard output (stdout), where print() writes. (06. Errors and debugging)
Standard library
The modules that ship with Python, such as math, csv, json, pathlib and argparse; they need no install. (08. Modules, packages and environments)
Standard normal distribution
The normal distribution with mean 0 and standard deviation 1. (29. Statistics and probability)
Standardization
Rescaling a feature to mean 0 and standard deviation 1 with z = (x - mean) / std. (18. Classes and objects)
Standardized coefficient
A linear model coefficient fitted on standardized features: the change in the prediction for a one-standard-deviation step in the feature. (43. Interpretability)
Star-unpacking
Unpacking with a starred name, as in first, *rest = items, where the starred name collects the remaining elements in a list. (04. Data structures)
Start method
How multiprocessing creates a new process: spawn, fork or forkserver. (15. Performance and concurrency)
Starter code
A partial program for an exercise, with comments that mark where you write your own code. (Start here)
State
The data an object stores in its attributes at a given moment, such as the mean a scaler has learned. (18. Classes and objects)
State machine
A model of a process that is in exactly one state at a time and moves between states only along allowed transitions. (21. Dataclasses, enums and slots)
state_dict
An ordered dictionary from parameter (and buffer) names to tensors; it holds the learned values of a module and is what you save and load. (42. Deep learning with PyTorch)
Stateful transformer
A transformer that learns values from the training rows in fit(), such as medians, means or category lists, and reuses them in transform(). (34. The scikit-learn workflow)
Stateless transformer
A transformer that learns nothing in fit() and applies the same calculation to any rows, such as a log transform. (34. The scikit-learn workflow)
Statement
One complete instruction in a program, usually one line, such as total = 120 + 80. (01. Python basics)
Static analysis
Checking a program by reading its source code, without running it. (12. Type hints)
Static method
A method decorated with @staticmethod that receives neither the instance nor the class; a plain function stored in the class. (18. Classes and objects)
Static type checker
A tool that reads source code and type hints, infers the type of every expression and reports where types do not fit, before the code runs. (12. Type hints)
Stationary
Describes a time series whose mean, variance and autocorrelation do not change over time. (40. Time series)
Statistic
A number computed from a sample, such as a sample mean, used to estimate a parameter. (29. Statistics and probability)
Statistically significant
Describes a result with a p-value at or below the chosen significance level. (29. Statistics and probability)
statsmodels
A Python library for statistical models, tests and power analysis with detailed inference output. (29. Statistics and probability)
Stemming
Cutting word endings with fixed rules so that related forms share one stem, for example charges and charging become charg. (41. NLP fundamentals)
Step
The third part of a slice, s[start:stop:step]: take every step-th item; a step of -1 walks backwards. (02. Strings and text)
STL
Seasonal-Trend decomposition using LOESS: a decomposition method that fits local smooth curves and lets the seasonal pattern change slowly. (40. Time series)
Stochastic gradient boosting
Gradient boosting in which each tree is fitted on a random share of the training rows (subsample below 1), which adds randomness and reduces variance. (38. Ensembles)
Stochastic gradient descent (SGD)
Gradient descent that estimates each gradient from one random row; cheap, noisy steps. (32. Math for ML)
Stop word
A very frequent word with little meaning on its own, such as the or and; scikit-learn's English list also contains not, no and never. (41. NLP fundamentals)
StopIteration
The exception an iterator raises to signal that it has no more items; a for loop catches it and ends quietly. (10. Iterators and generators)
str dtype
The pandas 3 default dtype for text columns, shown as `str`; it uses Arrow arrays when pyarrow is installed, and missing text is NaN. (24. pandas fundamentals)
Strategy pattern
A design that puts each version of an algorithm behind one interface, so the code that uses it can switch at run time; in Python usually a function parameter. (22. Design principles and patterns)
Stratified k-fold
k-fold cross-validation in which every fold keeps the class shares of the whole target, as StratifiedKFold does. (34. The scikit-learn workflow)
Stratified sample
A sample drawn separately inside each group (stratum) of the population, in fixed proportions, so every group keeps its true share. (29. Statistics and probability)
Stratified split
A train/test split that keeps the share of each class equal in both parts. (09. Standard library power tools)
Stratum
One of the groups into which a population is split before stratified sampling; plural strata. (29. Statistics and probability)
Streak
A sequence of consecutive items with the same value or property; also called a run. (10. Iterators and generators)
Stream
A sequence of items processed one at a time, in order, often without knowing how many items will come. (10. Iterators and generators)
Streaming engine
The Polars engine that runs a lazy query in batches, selected with collect(engine="streaming"), so data larger than memory can be processed. (31. Polars)
Strength of seasonality
A number from 0 to 1, 1 minus Var(remainder) / Var(seasonal + remainder), that measures how much of a series the seasonal part explains. (40. Time series)
StrEnum
An enum (Python 3.11+) whose members are also strings, so they equal their values and work in JSON and f-strings. (21. Dataclasses, enums and slots)
Strict mode
mypy's --strict option: it turns on extra checks such as requiring hints on every function and warning when Any leaks out. (12. Type hints)
Stride
The step between two positions of a convolution or pooling window; a stride of 2 roughly halves each side. (42. Deep learning with PyTorch)
String (str)
A piece of text, written between quotes, such as "Chicago". (01. Python basics)
Structural missing value
A gap whose value is known by a rule, for example a total of 0 for a customer who has not been billed yet. (26. Data cleaning)
Structural typing
Type compatibility based on shape (methods and attributes), as with a Protocol. (12. Type hints)
Structured logging
Writing each log line as data with named fields, for example one JSON object, so that a log system can filter and count by field instead of searching free text. (Capstone 8. Deployment)
Student's t-test
The two-sample t-test that assumes equal variances in both groups. (29. Statistics and probability)
Study (Optuna)
An Optuna optimization run: a series of trials with a direction (maximize or minimize) and a sampler. (37. Model evaluation and tuning)
Style sheet
A named set of rcParams that changes the look of all later charts, applied with plt.style.use. (28. Visualization)
Subclass
A more specific type built on a base class; it is caught by an except clause for its base class. (06. Errors and debugging)
Subcommand
A command word inside a command-line tool that has its own arguments, such as add in uv add. (08. Modules, packages and environments)
Subgradient
Any slope lying between the left and right derivatives at a sharp kink of a convex non-smooth function such as ReLU or absolute error. (47. Calculus and optimization for ML)
Subject
The value after match that the case patterns are compared with. (03. Control flow)
Subject (observer pattern)
In the observer pattern, the object that something happens to and that notifies its observers, such as a training loop. (22. Design principles and patterns)
Submodule
A module inside a package, such as salesreport.stats. (08. Modules, packages and environments)
Subpackage
A package inside another package, such as sklearn.linear_model. (08. Modules, packages and environments)
Subplot
One Axes in a grid of Axes inside a figure. (28. Visualization)
Subplot mosaic
An uneven grid of Axes built by plt.subplot_mosaic from a picture of names, returned as a dict. (28. Visualization)
subprocess
The standard-library module that starts other programs and collects their exit code and output. (09. Standard library power tools)
Subquery
A query nested inside another query, in FROM, WHERE or SELECT. (30. SQL for data analysis)
Subspace
A flat slice through the origin (such as a line or plane) inside a larger vector space that stays closed under addition and scalar multiplication. (46. Linear algebra in depth)
Substring
A string that appears inside another string, such as "Smart TV" inside "55-inch 4K Smart TV". (02. Strings and text)
Subtype
A type whose values are also valid values of another type; bool is a subtype of int. (12. Type hints)
Successive halving
A search that scores many candidates with a small budget, keeps the best fraction and gives them a larger budget, round by round. (37. Model evaluation and tuning)
Suffix
The file extension at the end of a file name, such as .csv or .json, including the dot. (07. Files and data formats)
Summary statistics
A few numbers that describe a column: count, mean, standard deviation, minimum, quartiles and maximum, as `describe()` prints them. (24. pandas fundamentals)
super()
A built-in that returns a helper object for calling a method of the next class in the method resolution order, such as super().__init__(). (19. Inheritance and polymorphism)
Superclass
Another name for a parent class: the class that a subclass inherits from. (19. Inheritance and polymorphism)
Supervised learning
Machine learning from examples whose answers are known, to predict the answer for new examples. (18. Classes and objects)
Support (classification)
The number of rows that truly belong to a class in the data being evaluated. (21. Dataclasses, enums and slots)
Support vector
A training point on or inside the SVM margin; only these points determine the boundary. (36. Classification)
Support vector machine (SVM)
A classifier that finds the boundary with the widest margin between the classes, optionally curved by a kernel. (36. Classification)
Survival function (SF)
The probability of a value greater than x, equal to 1 minus the CDF. (29. Statistics and probability)
Symmetric MAPE (sMAPE)
A percentage error that divides each absolute error by the mean of the actual and forecast values; it ranges from 0 to 200. (40. Time series)
Symmetric matrix
A square matrix that equals its transpose, such as a correlation or covariance matrix. (23. NumPy)
Syntax error
Code that breaks the grammar of Python, such as a missing bracket; Python reports it before any line of the file runs. (06. Errors and debugging)
SyntaxError
The exception raised when code breaks Python's grammar, for example a terminal command typed at the >>> prompt. (01. Python basics)
Synthetic data
Data that a program generated to look and behave like real data. (Start here)
sys.argv
The list of command-line words that a script received; the first item is the script name. (08. Modules, packages and environments)
sys.prefix
The folder of the Python environment that runs now; it differs from sys.base_prefix inside a virtual environment. (08. Modules, packages and environments)

T

t distribution
A bell-shaped distribution with heavier tails than the normal, used when a standard deviation is estimated from the sample. (29. Statistics and probability)
t-SNE
t-distributed Stochastic Neighbor Embedding: a nonlinear method that draws a 2-D map in which each point keeps its near neighbors. (39. Unsupervised learning)
t-test
A test that compares means using a t statistic: a difference divided by its standard error. (29. Statistics and probability)
Table (TOML)
A section of a TOML file, written [name]; Python reads it as a dictionary. (08. Modules, packages and environments)
Tabulation
Bottom-up dynamic programming that fills a table iteratively from the smallest base cases up to the target answer, avoiding recursion overhead. (45. Algorithms and data structures II)
Tag
A marker in HTML such as <td> or </td> that starts or ends an element. (16. APIs and web data)
Tail call
A function call that is the last action of a function; Python does not optimize tail calls, so deep recursion still needs a loop. (17. Algorithms and data structures)
Target
The column that a supervised model learns to predict, such as price or churned. (18. Classes and objects)
Target encoding
Encoding each category by the (smoothed) mean of the target among the training rows in that category. (33. Feature engineering)
Target leakage
Data leakage through a feature that contains the answer, because it is computed from the target or recorded after the outcome. (33. Feature engineering)
Taylor polynomial
A local polynomial approximation of a smooth function around a point that matches its value and first k derivatives there. (47. Calculus and optimization for ML)
Teardown
The cleanup after a test, such as closing a connection; in a fixture, the code after yield. (14. Testing with pytest)
tempfile.TemporaryDirectory
A context manager that creates an empty temporary folder and deletes it, with everything in it, at the end of the block. (11. Decorators and context managers)
Template method pattern
A base-class method that fixes the steps of an algorithm and calls hook methods that subclasses override. (22. Design principles and patterns)
Tensor
PyTorch's n-dimensional array with one dtype and a shape, like a NumPy ndarray, that can also record operations for autograd and run on a GPU. (42. Deep learning with PyTorch)
TensorDataset
A ready-made PyTorch Dataset that pairs row i of several tensors that are already in memory. (42. Deep learning with PyTorch)
Term frequency (TF)
The number of times a term appears in one document. (41. NLP fundamentals)
Terminal
A window where you type commands as text instead of clicking buttons. (Start here)
Test discovery
The rules a test runner uses to find tests: in pytest, test_*.py files, test functions and Test classes. (14. Testing with pytest)
Test double
An object that stands in for a real one during a test, such as a fake, a stub or a mock. (14. Testing with pytest)
Test function
A function whose name starts with test and that checks behavior with assert statements. (14. Testing with pytest)
Test ID
The part of a parametrized test's name in square brackets, built from the argument values or set with id= or ids=. (14. Testing with pytest)
Test isolation
The property that tests do not depend on each other, so each one can run alone and in any order. (14. Testing with pytest)
Test oracle
An independent source of the right answer that a test compares with, such as the counts in a data dictionary. (14. Testing with pytest)
Test runner
A program that finds tests, runs them and reports which passed and which failed. (14. Testing with pytest)
Test set
Rows kept away from training and used only to measure how well the model works on new data. (18. Classes and objects)
Test statistic
One number computed from the data that measures how far it is from the null hypothesis, such as t or z. (29. Statistics and probability)
Test suite
The set of all tests of a project, run together after every change. (14. Testing with pytest)
Test-driven development (TDD)
A way of working in which you write a failing test first and then the code that makes it pass. (14. Testing with pytest)
TestClient
FastAPI's test client, which sends requests directly to an app object in the same process, with no running server. (44. ML in production basics)
Text classification
Assigning a label to each document, such as positive or negative, spam or not spam, or the team that should handle a ticket. (41. NLP fundamentals)
Text embedding
A mapping of a word or a document to a dense vector in which similar meanings get nearby vectors. (41. NLP fundamentals)
Text file
A file whose bytes represent characters in an encoding, such as .txt, .csv, .json or .log. (07. Files and data formats)
Text mode
Opening a file so that Python decodes its bytes into str with an encoding; the default for open(). (07. Files and data formats)
Text normalization
Rewriting text values to one canonical form by stripping spaces, unifying case, collapsing inner spaces and mapping synonyms. (26. Data cleaning)
Text table
A plain-text report whose columns line up because every value is formatted with a fixed width and alignment. (02. Strings and text)
TF-IDF
Term frequency times inverse document frequency: a word weight that is high when the word is frequent in a document and rare in the corpus. (41. NLP fundamentals)
Third-party package
A package written by other people and installed from the Python Package Index, such as pandas or scikit-learn. (08. Modules, packages and environments)
Thompson sampling
A Bayesian bandit strategy that samples a reward rate from each arm's posterior distribution and assigns the next visitor to the highest draw. (49. Causal inference, GLMs and advanced experimentation)
Thousands separator
A character that groups the digits of a large number in threes, such as the comma in 1,950,934.24. (02. Strings and text)
Thread
A sequence of instructions that runs inside a process and shares the process's memory with other threads. (15. Performance and concurrency)
Three-valued logic
SQL's logic with three truth values, true, false and unknown, where unknown comes from comparisons with NULL. (30. SQL for data analysis)
Threshold
A cut-off value; a classifier flags an item when its score is at or above the threshold. (03. Control flow)
Threshold effect
A relationship that is flat over most values and changes sharply past one cut-off, such as churn rising only below 4 logins. (27. Exploratory data analysis)
Threshold tuning
Choosing the probability cut-off of a classifier that optimizes a metric or a business cost. (37. Model evaluation and tuning)
Throttling
Slowing down your own requests on purpose to stay under a rate limit. (16. APIs and web data)
Tick
A small mark with a label along an axis that shows a value position. (28. Visualization)
Tick formatter
An object that turns a tick's numeric value into its label text, such as 241k or 30%. (28. Visualization)
Tidy data
A table with one row per observation, one column per variable and one value per cell. (16. APIs and web data)
Time series
A sequence of measurements in time order, usually taken at a fixed interval, such as daily website visits. (40. Time series)
Time zone
The set of rules that gives the UTC offset of a region at every date, including its daylight saving time changes. (09. Standard library power tools)
Time-series split
Walk-forward validation: each split trains on earlier rows and validates on the rows that follow. (37. Model evaluation and tuning)
time.monotonic()
A clock that never goes backwards, suited to timeouts and expiry checks. (11. Decorators and context managers)
time.perf_counter()
A high-resolution clock for measuring durations; only the difference between two readings is meaningful. (11. Decorators and context managers)
timedelta
A datetime type that holds a duration, such as 1 day and 2 hours; the result of subtracting two dates or datetimes. (09. Standard library power tools)
timeit
The standard-library module that times small code snippets by running them many times. (15. Performance and concurrency)
Timeout
The longest time a client waits for a connection or an answer before it gives up with an error. (16. APIs and web data)
Timsort
The hybrid of merge sort and insertion sort behind Python's sorted() and list.sort(); stable, O(n log n) in the worst case and O(n) on data already in order. (17. Algorithms and data structures)
tmp_path
A built-in pytest fixture that gives each test a new, empty temporary folder as a pathlib.Path. (14. Testing with pytest)
Token
One unit of text after splitting, usually a word, such as battery or not. (41. NLP fundamentals)
Token bucket
A rate-limit scheme that refills tokens at a fixed rate and lets each request spend one, which allows short bursts. (16. APIs and web data)
Tokenization
Splitting a text into tokens, for example with str.split() or a regular expression such as [a-z0-9']+. (41. NLP fundamentals)
TOML
A simple configuration format with [tables] and key = value lines; Python reads it with tomllib. (08. Modules, packages and environments)
Tooltip
The small box that appears when you hover over a mark in an interactive chart, showing its values. (28. Visualization)
Topic
In topic modeling, a weighted list of words that appear together, such as battery charge holds days. (41. NLP fundamentals)
Topic modeling
Unsupervised learning that finds the themes of a corpus as groups of words that tend to appear together. (41. NLP fundamentals)
Topic stability
How similar the topics of two fits with different random starts are; stable topics come back, unstable ones change. (41. NLP fundamentals)
Topological sort
A linear ordering of a DAG's nodes in which every prerequisite appears before the nodes that depend on it, computed in O(V + E) time by Kahn's algorithm or DFS. (45. Algorithms and data structures II)
torch.no_grad()
A context manager that stops autograd from recording operations; used for weight updates by hand, evaluation and prediction. (42. Deep learning with PyTorch)
Total time (tottime)
In a profile, the time spent in a function's own code, without the functions it calls. (15. Performance and concurrency)
Traceback
The error report Python prints when a program fails; its last line names the error. (Start here)
tracemalloc
A standard-library module that traces the memory Python allocates and reports the current and peak sizes. (10. Iterators and generators)
Tracking URI
The address where MLflow stores its records, such as sqlite:///mlflow.db. (44. ML in production basics)
Trailing window
A window that ends at the current row and looks only backward in time. (25. pandas advanced)
Train mode
The default state of a module, set with model.train(), in which dropout is active and batch normalization uses batch statistics. (42. Deep learning with PyTorch)
Train-test contamination
Data leakage in which test or validation rows influence training, for example through preprocessing fitted on all rows. (33. Feature engineering)
Training callback
An observer of model training, such as a history recorder or early stopping, called by the training loop at each event. (22. Design principles and patterns)
Training error
The error of a model on the rows it was trained on; it is always optimistic. (37. Model evaluation and tuning)
Training set
The rows a model learns from. (18. Classes and objects)
Training–serving skew
A difference between the inputs a model saw in training and the inputs it receives in production, such as True instead of 1. (44. ML in production basics)
Transaction
A group of database changes that is saved together with a commit, or undone together with a rollback. (30. SQL for data analysis)
Transform
A middle stage of a pipeline that parses, cleans, filters or enriches items one at a time. (10. Iterators and generators)
transform (groupby)
A groupby method that computes a group result and repeats it on every row of the group, so the output has the input's length and index. (25. pandas advanced)
TransformedTargetRegressor
A scikit-learn meta-estimator that fits a regressor on a transformed target, such as log(price), and converts its predictions back. (34. The scikit-learn workflow)
Transformer (neural network)
A neural network architecture that reads every word in the context of every other word; the basis of modern language models and sentence embeddings. (41. NLP fundamentals)
Transformer (scikit-learn)
An estimator that learns parameters with fit and changes data with transform, such as StandardScaler or OneHotEncoder. (33. Feature engineering)
Transient error
A failure that may go away by itself, such as a dropped connection or a timeout, and is therefore worth retrying. (11. Decorators and context managers)
Transitive dependency
A dependency of one of your dependencies, such as threadpoolctl for scikit-learn. (08. Modules, packages and environments)
Transport
The part of an httpx client that sends a request over the network; MockTransport replaces it with a function. (16. APIs and web data)
Transpose
Swapping the axes of an array, so that rows become columns; a.T in NumPy. (23. NumPy)
Tree
A structure of nodes connected parent to child with no loops, such as a product catalog or a folder hierarchy. (17. Algorithms and data structures)
Tree-structured Parzen Estimator (TPE)
Optuna's default sampler; it splits past trials into good and bad ones and samples where good trials are dense. (37. Model evaluation and tuning)
TreeExplainer
The shap class that computes exact SHAP values for tree ensembles quickly by using the structure of the trees. (43. Interpretability)
Trend
The slow long-term direction of a time series, such as steady growth in visits over three years. (40. Time series)
Trial (Optuna)
One evaluation of the objective function with one set of suggested hyperparameter values. (37. Model evaluation and tuning)
Trie
A prefix tree whose edges are labeled with characters, allowing O(L) insertion, lookup and prefix autocomplete for strings of length L independent of dictionary size. (45. Algorithms and data structures II)
Trimmed mean
The mean after dropping a fixed share of the smallest and largest values. (29. Statistics and probability)
True negative (TN)
A negative row that the model correctly predicts as negative. (36. Classification)
True positive
An item that a classifier flags and that really belongs to the positive class. (03. Control flow)
True positive rate (TPR)
Another name for recall, TP / (TP + FN), used on the y-axis of a ROC curve; also called sensitivity. (36. Classification)
Truncate
To cut off the decimals of a number without rounding; int(21.7) truncates to 21 and int(-21.7) to -21. (01. Python basics)
Truncated axis
A value axis that does not start at zero; on a bar chart it exaggerates differences. (28. Visualization)
Trustworthiness
A score from 0 to 1 that checks whether the nearest neighbors of each point on a low-dimensional map were also near neighbors in the original data. (39. Unsupervised learning)
Truthiness
The way Python treats any value as true or false, for example in bool() or an if statement. (01. Python basics)
Truthy
A value that counts as True; almost every value that is not falsy, including "0" and "False". (01. Python basics)
try statement
The statement that runs a block of code and handles its exceptions with except, else and finally clauses. (06. Errors and debugging)
TSV
Tab-separated values: a text table like CSV that separates fields with a tab character. (07. Files and data formats)
TTL (time to live)
How long a cached value stays valid before it must be computed again. (11. Decorators and context managers)
Tukey's HSD
A post hoc test that compares all pairs of group means after ANOVA; scipy.stats.tukey_hsd. (29. Statistics and probability)
Tuple
A fixed, ordered group of values written in parentheses, such as (6, 50); module 04 explains tuples. (01. Python basics)
Two pointers
A pattern that walks a sorted sequence with two indices that move in the same direction or toward each other, in O(n). (17. Algorithms and data structures)
Two-sided test
A test that looks for a difference in either direction. (29. Statistics and probability)
Two-sum
The problem of finding two values in a collection that add up to a target, solved in one pass with a dict of seen values. (17. Algorithms and data structures)
Type
The kind of a value, such as int or str; it decides which operations the value supports. (01. Python basics)
Type alias
A name for a type, written type Sale = tuple[str, str, float] in Python 3.12+. (10. Iterators and generators)
Type annotation
Another name for a type hint: the : type or -> type part of a declaration. (12. Type hints)
Type argument
A type given in the brackets of a generic type, such as float in list[float]. (12. Type hints)
Type checker
A tool such as mypy that reads type hints and reports type errors without running the code. (11. Decorators and context managers)
Type conversion
Making a value of one type from a value of another type, such as int("42"); also called casting. (01. Python basics)
Type fix
Converting a column to the dtype its meaning needs, such as price text to float or date text to datetime. (26. Data cleaning)
Type hint
A note in the code, such as -> Iterator[str], that says what type a value, parameter or return value has; Python does not check it at run time. (10. Iterators and generators)
Type I error
A false positive: rejecting a null hypothesis that is true. (29. Statistics and probability)
Type II error
A false negative: failing to reject a null hypothesis that is false. (29. Statistics and probability)
Type inference
The checker working out the type of an expression from its value or from other hints, so you do not have to write it. (12. Type hints)
Type narrowing
The checker making a type more precise inside a branch after a check such as x is None or isinstance(x, str). (12. Type hints)
Type parameter
A placeholder for a type, declared in square brackets after a function or class name (def f[T]), that a type checker fills in at each use. (11. Decorators and context managers)
Type promotion
NumPy's rule for the result dtype of a mixed operation: two arrays give the smallest dtype that holds both (int8 with float32 gives float32); a Python number of the same kind takes the array's dtype. (23. NumPy)
Type variable
The placeholder name of a type parameter, such as T; old code creates it with T = TypeVar("T"). (12. Type hints)
TypedDict
A type that describes a dict with known string keys, each with its own value type; at runtime the value is a plain dict. (12. Type hints)
TypeError
The exception raised when an operation gets a value of the wrong type, such as "3" + 4. (01. Python basics)
typeshed
The project that holds the type hints of the standard library and many packages; mypy and pyright bundle it. (12. Type hints)
TypeVar
The pre-3.12 way to create a type variable, T = TypeVar("T"), used with Generic[T] for classes. (12. Type hints)
typing.NamedTuple
A class form of namedtuple with typed field names, such as class Sale(NamedTuple): revenue: float. (10. Iterators and generators)
typing.Self
The type hint for an object of the same class as the method's own object, as in def __iter__(self) -> Self. (10. Iterators and generators)

U

UMAP
Uniform Manifold Approximation and Projection: a nonlinear neighbor-preserving embedding from the umap-learn package that is fast and can place new rows with transform. (39. Unsupervised learning)
Unbiased estimator
An estimator that is right on average over many samples. (29. Statistics and probability)
UnboundLocalError
The error raised when a function reads a local variable before any value has been assigned to it, often because an assignment made an outer name local. (05. Functions)
Underfitting
A model that is too simple for the pattern in the data, so its error is high on both the training set and the test set. (35. Regression)
Underflow
A float result too close to 0 to be stored, which becomes 0.0, for example a product of thousands of probabilities. (32. Math for ML)
Undersampling
Removing rows of the common class from the training data to balance the classes. (37. Model evaluation and tuning)
Unhashable
Said of an object whose __hash__ is None, so it cannot be a set member or a dict key; a class that defines __eq__ without __hash__ is unhashable. (20. The Python data model)
Unicode
The world standard that gives every character of every writing system a number, its code point. (02. Strings and text)
Unicode normalization
Converting text to one standard form (NFC, NFD, NFKC or NFKD) so that equal-looking strings become equal. (02. Strings and text)
UnicodeDecodeError
The exception Python raises when bytes are not valid in the encoding used to decode them. (02. Strings and text)
UnicodeEncodeError
The exception Python raises when a character cannot be stored in the target encoding, such as ł in latin-1. (02. Strings and text)
Union type
A type that allows a value of one of several types, written with |, such as int | str. (12. Type hints)
Unit of analysis
The thing that one row represents in an analysis, such as an order line, an order, a customer or a day. (27. Exploratory data analysis)
Unit root
The property of a random-walk-like series whose shocks change the level for good, so the series has no mean to return to. (40. Time series)
Unit test
A test that checks one small unit of code, usually one function, in isolation. (14. Testing with pytest)
Unit vector
A vector of length 1, made by dividing a vector by its L2 norm; it keeps only the direction. (32. Math for ML)
Univariate analysis
Analysis of one variable at a time: its center, spread, shape and levels. (27. Exploratory data analysis)
Universal function (ufunc)
A NumPy function that works element-wise on arrays of any shape, such as np.sqrt, np.log or np.maximum. (23. NumPy)
Universal newlines
Python's text-mode behavior that turns \r\n and \n into \n when it reads, so code always sees \n. (07. Files and data formats)
Unpacking
Assigning the items of a sequence to several names in one statement, as in ip, method, path = parts. (02. Strings and text)
Unpivot
Turning wide data into long data by moving column names into a variable column; the Polars name for pandas melt. (31. Polars)
Unsafe fix
An automatic linter fix that can change what the code does; ruff applies it only with --unsafe-fixes. (13. Pythonic code)
unstack
A pandas method that moves an index level into the columns (long to wide). (25. pandas advanced)
Unsupervised learning
Machine learning on features without a target column; the algorithm looks for structure such as groups, directions or rare rows. (39. Unsupervised learning)
Uplift
The actual value of a metric divided by its baseline, the value expected without the intervention; 2x means double the usual. (Capstone 2. Sales analysis)
Upsampling
Resampling to a finer frequency; it creates empty rows that must be filled, by copying a level or splitting a flow. (40. Time series)
URL
A uniform resource locator: the address of a resource on the web, made of a scheme, a host, a path and an optional query string. (16. APIs and web data)
User representation
The readable text that __str__ returns for reports and end users; print() and f-strings use it. (20. The Python data model)
UTC
Coordinated Universal Time: the reference clock with no offset and no daylight saving time. (09. Standard library power tools)
UTC offset
The difference between a local clock and UTC, such as -05:00 for Chicago in summer. (09. Standard library power tools)
UTF-8
The character encoding that stores all of Unicode in 1 to 4 bytes per character; the standard on the web and in modern files. (02. Strings and text)
uv
A fast tool that installs Python, creates virtual environments and installs packages. (Start here)
Uvicorn
A common ASGI server for running FastAPI apps, started with uvicorn module:app. (44. ML in production basics)

V

Vacuous truth
The rule that a statement about all members of an empty group is true, which is why all([]) is True. (13. Pythonic code)
validate_data
The scikit-learn helper for custom estimators that converts input to an array, checks it, and records or compares n_features_in_ and feature_names_in_. (34. The scikit-learn workflow)
Validation
Checking that a value is allowed before you accept it, for example that n_neighbors is an int of at least 1. (18. Classes and objects)
Validation check
A rule that data must satisfy, written as code, such as a range, an allowed set of values or key uniqueness. (26. Data cleaning)
Validation curve
A table or plot of one model score for each value of a hyperparameter, used to choose that value. (20. The Python data model)
Validation loss
The error of a model on data it does not train on, measured after each epoch to watch for overfitting. (18. Classes and objects)
Validation set
Data held back from training that you use to compare model settings; the final test set stays untouched until the very end. (20. The Python data model)
Value
One piece of data, such as 21.7 or "S01". (01. Python basics)
Value object
A small, immutable object that is defined by its values, such as a money amount or a vector, and compares and hashes by those values. (20. The Python data model)
Value pattern
A dotted name in a pattern, such as Status.OK; it compares with that constant instead of capturing. (03. Control flow)
ValueError
The exception raised when a value has the right type but cannot be used, such as int("n/a"). (01. Python basics)
Var-keyword parameter
A **kwargs parameter, which collects any extra keyword arguments into a dict. (05. Functions)
Var-positional parameter
A *args parameter, which collects any extra positional arguments into a tuple. (05. Functions)
Variable
A name that refers to a value. (01. Python basics)
Variable-size window
A sliding window that grows on the right while a condition holds and shrinks from the left when it breaks, used to find the longest stretch with a property. (17. Algorithms and data structures)
Variance
The rule that says whether a generic type follows the subtype rule for its type arguments, for example whether a Box[int] counts as a Box[float]; a type is invariant or covariant (or contravariant). (12. Type hints)
Variance (of a model)
How much a model's predictions change when it is trained on a different sample of the data. (37. Model evaluation and tuning)
Variance (statistics)
The average squared distance of the values from their mean; the sample version divides by n − 1. (29. Statistics and probability)
Variance inflation factor (VIF)
A diagnostic 1 / (1 - R_j^2) measuring how much a feature's regression coefficient variance is inflated by linear dependence on the other features. (46. Linear algebra in depth)
Vector
A 1-dimensional array of numbers, such as one row of features or one column of prices. (23. NumPy)
Vector image
An image stored as shapes, such as SVG or PDF; it scales to any size without blur. (28. Visualization)
Vectorization
Writing an operation on whole arrays instead of a Python loop over elements, so that the loop runs in compiled code. (23. NumPy)
Vectorized operation
An operation that works on a whole column or array in one compiled loop, with no Python loop, such as `sales["revenue"] / sales["quantity"]`. (24. pandas fundamentals)
Version specifier
A rule that says which versions of a package are acceptable, such as >=3.1,<4 or ==3.1.1. (08. Modules, packages and environments)
View
A live, read-only window on the keys, values or items of a dict, returned by keys(), values() and items(). (04. Data structures)
View (array)
A NumPy array that shares the memory of another array, as a basic slice does; changing it changes the original. (23. NumPy)
Violin plot
A chart that draws a KDE on both sides of a center line to show the full shape of each group's distribution. (28. Visualization)
Virtual environment
A project folder, usually called .venv, that holds one Python interpreter and its own installed packages. (Start here)
Virtual subclass
A class registered with an ABC through register(), so that isinstance() and issubclass() accept it without inheritance. (19. Inheritance and polymorphism)
Vocabulary
A mapping from each known token of a text collection to an integer id. (18. Classes and objects)
Voting ensemble
An ensemble that fits several different models on the same data and combines their predictions with a fixed rule, without training a combiner. (38. Ensembles)

W

Wald interval
The simple proportion interval p̂ ± 1.96 √(p̂(1 − p̂)/n); unreliable for small samples or rare events. (29. Statistics and probability)
Wall-clock time
The time that passes on a real clock while code runs, including time spent waiting. (15. Performance and concurrency)
Walrus operator
The := operator, which assigns a value to a name and returns it in the same expression. (10. Iterators and generators)
Ward linkage
A linkage that merges the two clusters whose merge raises the inertia least, which gives compact clusters of similar size. (39. Unsupervised learning)
warm_start
A scikit-learn setting that keeps the already fitted parts of an ensemble and fits only the new ones on the next call to fit, for example extra trees. (38. Ensembles)
Waterfall chart
A bar chart that starts at one total, adds each contribution as a floating bar and ends at the next total. (Capstone 2. Sales analysis)
Waterfall plot
A SHAP plot that shows how one prediction goes from the base value to the output, one feature bar at a time. (43. Interpretability)
Weak learner
A simple model, such as a shallow tree, that is only a little better than guessing on its own but useful inside a boosting ensemble. (35. Regression)
Web API
An API that answers requests over the web with HTTP, usually with JSON bodies. (16. APIs and web data)
Web framework
A library that turns functions into web endpoints and handles requests and responses, such as FastAPI or Flask. (44. ML in production basics)
Web scraping
Extracting data from web pages that are made for people, with a program. (16. APIs and web data)
Weight (neural network)
A learned number that multiplies an input of a layer; training adjusts the weights to lower the loss. (42. Deep learning with PyTorch)
Weight decay
A regularization that shrinks every weight a little at each optimizer step, which keeps the weights small and reduces overfitting. (42. Deep learning with PyTorch)
Weight sharing
Using the same kernel weights at every position of the input, which makes convolutions detect a pattern anywhere with few parameters. (42. Deep learning with PyTorch)
Weighted average (classification)
The mean of a metric over the classes, weighted by each class's support. (21. Dataclasses, enums and slots)
weights_only
An argument of torch.load; weights_only=True loads only tensors and plain containers and blocks the arbitrary code that a malicious pickle could run. (42. Deep learning with PyTorch)
Welch's t-test
A two-sample t-test that does not assume equal variances; scipy's ttest_ind with equal_var=False. (29. Statistics and probability)
Welford's algorithm
A one-pass method that updates the count, mean and sum of squared differences with each new value, giving the running mean and variance. (18. Classes and objects)
What-if query
Changing one or more inputs of a row and asking the model for its new prediction; it describes the model, not what would happen in reality. (43. Interpretability)
Wheel
A ready-built package file (.whl) that an installer unpacks into site-packages. (08. Modules, packages and environments)
while loop
A loop that runs its block as long as its condition is true. (03. Control flow)
Whisker
The line of a box plot that reaches from the box to the furthest value within 1.5 times the IQR. (27. Exploratory data analysis)
White noise
A series of independent random values with mean 0 and constant variance; it has no autocorrelation to model. (40. Time series)
Whitespace
Characters that show as empty space: the space, the tab \t, the newline \n and a few rarer ones. (02. Strings and text)
Wide format
A table layout that spreads one variable across columns, such as one column per quarter. (25. pandas advanced)
Wilcoxon signed-rank test
A nonparametric test for one sample or for paired differences, based on ranks. (29. Statistics and probability)
Wildcard pattern
The pattern _, which matches any value and binds nothing; it works like else. (03. Control flow)
Wilson interval
A confidence interval for a proportion that stays within 0 and 1 and keeps close to its nominal coverage; the recommended default. (29. Statistics and probability)
Window
The set of rows that a window function uses to compute the value for the current row. (30. SQL for data analysis)
Window expression
An expression with .over(keys) that computes a value per group and writes it back to every row of that group. (31. Polars)
Window frame
The rows of a partition that a window function sees for the current row, such as ROWS BETWEEN 6 PRECEDING AND CURRENT ROW. (30. SQL for data analysis)
Window function
A function that computes a value for each row from a group of neighboring rows. (25. pandas advanced)
Winsorizing
Cleaning outliers by capping values at a lower and an upper limit instead of removing them. (20. The Python data model)
Wisdom of crowds
The observation that the average of many independent guesses is often better than most single guesses; it fails when the guesses share the same errors. (38. Ensembles)
with statement
A statement that sets up a resource, runs a block and always cleans up afterwards; with open(...) as f: closes the file even after an error. (07. Files and data formats)
Word boundary
The regex position \b between a word character and a non-word character, or at the start or end of the text. (09. Standard library power tools)
Worked example
A realistic task solved in small steps, each with code, its real output and a short explanation. (Start here)
Working directory
The folder that a program runs in; relative paths start from it. (Start here)
Worst case
The input that makes an algorithm do the most work; big-O often describes this case. (15. Performance and concurrency)
Wrapper function
The inner function a decorator returns; it runs extra code before and after it calls the original function. (11. Decorators and context managers)
Wrapper method
A feature selection method that fits a model on many feature subsets and keeps the subset with the best score, such as RFE or sequential selection. (33. Feature engineering)

X

xfail
A pytest marker for a test that is expected to fail; with strict=True an unexpected pass counts as a failure. (14. Testing with pytest)
XGBoost
A gradient boosting library with a scikit-learn style XGBClassifier and XGBRegressor, known for strong results on tabular data. (36. Classification)

Y

YAGNI
"You aren't gonna need it": do not add a feature or an abstraction until a real need appears. (22. Design principles and patterns)
Yates' continuity correction
A small adjustment that scipy applies by default to chi-square tests on 2×2 tables; it makes the test a little conservative. (29. Statistics and probability)
Year-over-year (YoY)
The change of a value from the same period one year earlier, which removes the seasonal pattern. (30. SQL for data analysis)
Year-to-date (YTD)
A running total that restarts at the start of each year. (30. SQL for data analysis)
yield
A keyword that hands one value to the caller and pauses the generator at that line until the next next() call. (10. Iterators and generators)
yield from
A statement that yields every item of another iterable, delegating to it; short for a for loop with yield. (10. Iterators and generators)

Z

Z-score
The distance of a value from the mean, measured in standard deviations: |x - mean| / std. (18. Classes and objects)
Zen of Python
A list of 19 short design rules for Python by Tim Peters; import this prints it. (13. Pythonic code)
Zero-based indexing
Counting positions from 0, so the first character of a string has index 0 and the last has index len(s) - 1. (02. Strings and text)
ZeroDivisionError
The exception raised when a program divides by zero. (01. Python basics)
zip()
A built-in that walks several iterables together and gives one tuple per position; strict=True rejects different lengths. (03. Control flow)
zoneinfo
The standard-library module whose ZoneInfo class loads a time zone from the IANA database by name. (09. Standard library power tools)