EvolutionCourse Hub

Dictionary

Every concept, in plain language

206 terms · examples drawn from the course

206 shown

A

Evaluation

The share of predictions that were correct. Misleading when one answer is very common.

ExampleA car-park model that always says 'full' is 96% accurate and never finds an empty space.

Accuracy trap

Also: accuracy paradox

Evaluation

When one outcome is rare, a model that always predicts the common outcome scores high accuracy and is useless. Accuracy cannot tell a useful option from a useless one.

ExampleContacting nobody is 73.5% accurate on churn and 92% accurate on the upsell data, and catches no one.

Taught inS2RelatedConfusion matrixHit rate at KS2; HW2 Part C
Aggregation

Also: summary statistic

Python tools

Reducing many values to one summary, such as a mean, sum, count, minimum or maximum.

Exampledf['left'].mean() is the share of customers who left: about 26.5%.

AI agent

Also: agent, LLM agent

Working with agents

An LLM that plans a step, uses a tool (runs code, queries data, calls an API), reads the result and decides what to do next, in a loop.

ExampleEarth Agent proposes the search space and objective, runs experiments on Earth through its API, reads the results and suggests the next experiment.

OptionalThe wider landscape

Named in 1956 as the umbrella for making machines act intelligently (rules, search, logic, learning). Today it usually means deep learning and generative AI.

ExampleWhen someone says 'AI', ask which circle they mean.

AUC (ROC AUC)

Also: area under the curve, ROC, roc_auc

Evaluation

The chance that the model scores a random real case above a random non-case. 0.5 is a coin flip, 1.0 is perfect. Good for comparing pipelines; hard to explain to the business.

ExampleOn the upsell data: random 0.50, rule 0.74, logistic regression 0.77.

Taught inS2RelatedRanking metric vs threshold metricHit rate at KS2; HW2 Parts C-D
Axis

Also: axis=0, axis=1

Python tools

The direction of an aggregation on a table. axis=0 runs down the rows and gives one answer per column; axis=1 runs across and gives one answer per row.

Exampleservices.sum(axis=1) counts how many services each customer has.

Taught inS0RelatedAggregationS0

B

Baseline

Also: no-brainer model, benchmark

Evaluation

The simplest sensible answer, used as the bar any real model must beat. A model is never good on its own, only better than something.

ExampleAlways predicting 'stays' is 73.5% accurate on our data and finds no leavers. In the smoothie story, always guessing the average is off by 85 calories.

Taught inS0S1RelatedAccuracyDummyClassifierS0; S1
Bias in training data

Also: data bias

Data quality and preparation

When historical data reflects unfair or unrepresentative decisions, a model learns them and applies them at scale.

ExampleA model trained on ten years of biased hiring decisions repeats the bias a thousand times a day.

Taught inS1RelatedRepresentativenessS1
Binning (cut and qcut)

Also: bands, buckets, cut, qcut

Python tools

Turning a number into bands. cut uses edges you choose; qcut makes bands with equal numbers of rows.

ExampleTenure bands 0-12, 13-24, 25-48 and 49-72 months make the churn pattern readable at a glance.

Boolean mask

Also: mask, filter

Python tools

An array or column of True/False values used to select rows. The mean of a mask is the share of True values.

Examplehigh = charges > 80 selects high payers; churned[high].mean() is the share of them who left.

Taught inS0Relatedloc and ilocNumPy arrayS0
Framing a project

The share of calls that must succeed for calling to pay for itself: cost of a contact ÷ value of a success. Above it, capacity, not cost, limits how many to call.

ExampleOffer ₪50, saved customer ₪2,000, one in four contacted leavers saved: 50 ÷ (2,000 × 0.25) = 10%.

OptionalSearch and optimization

Good partial choices (a group of columns, a model setting) that can be recombined into better wholes. When good solutions share building blocks, crossover pays off.

ExampleIn the room exercise, #1's depth, leaf and columns plus #6's learning rate give 0.82, better than both parents.

Business metric

Also: success metric, KPI

Evaluation

The number the business uses to judge success, agreed with the domain expert before modelling. It decides which pipeline wins.

ExampleHit rate of a 400-call list, or the shekel value of the list.

C

Calibration

Also: calibrated probabilities, CalibratedClassifierCV

Models and settings

Whether predicted probabilities match reality: of customers scored 30%, do about 30% really upgrade? Matters when probabilities are turned into money; ranking alone does not need it.

ExampleLogistic regression's top 10% average a predicted 31% and really upgrade at 29%: reasonably calibrated.

Taught inS2RelatedPredicted probability (score)Expected value of an actionS2 discussion; Reading: model families
Capacity

Also: contact capacity, budget

Framing a project

How many cases the business can act on in one round: calls, visits, offers. With a fixed capacity, the job is to rank everyone and act on the top of the list.

ExampleThe retention team can make about 400 calls a month; the upsell call centre about 600 per campaign.

Separating what no list could do from what the model got wrong. Leavers beyond the capacity are missed by any list, however good; the model's own errors are the wasted calls inside the list.

Example1,494 leavers, 400 calls: at least 1,094 leavers are out of reach. The model's errors are its 78 wasted calls.

Taught inS3RelatedCapacityHits and wasted callsError analysisS3; notebook 4.2
Checking across groups

Also: segment check

Data quality and preparation

Testing whether a pattern holds inside each segment, not only on average. Sometimes an overall pattern disappears or reverses within groups.

ExampleMonthly contracts leave more within every internet service type.

Evaluation

How evenly the labels are spread. With imbalance, a model can look accurate by always predicting the common label.

ExampleAbout 1 in 4 customers left; 96 of 100 car-park spaces are full.

Data quality and preparation

Cleaning is done once, before the split, on the whole dataset: duplicates, impossible values, columns you will not use. Preprocessing (impute, encode, scale) learns something from data, so it goes inside the pipeline and learns from training rows only.

ExampleRemoving the 22 duplicate rows is cleaning; filling missing charges with the training median is preprocessing.

Taught inS2RelatedDuplicate rowsImputationPipelineS2 discussion
OptionalThe wider landscape

Grouping similar rows together. k-means places k centres and assigns each row to the nearest one, repeating until stable.

ExampleSegmenting customers before anyone has defined the segments.

Taught inS1RelatedUnsupervised learningS1
Coefficient (weight)

Also: weight, coef_

Models and settings

The number a linear model learns for each column. The sign gives direction (towards the outcome or away from it), the size gives strength, after scaling and given all the other columns. It describes the model, not the world.

ExampleTenure −1.4 (longer customers stay); month-to-month contract +0.6 (leans towards leaving).

OptionalThe wider landscape

A new user or item with no history for a recommender to learn from.

ExampleWhat do you recommend to someone who signed up a minute ago?

Taught inS1RelatedRecommender systemS1
Collinearity

Also: multicollinearity, correlated features

Data quality and preparation

Two or more columns carrying largely the same information. Predictions can still be fine, but weights split between the columns in confusing ways.

ExampleTotalCharges ≈ tenure × MonthlyCharges: the model gives TotalCharges +0.7 and MonthlyCharges −0.3.

Data quality and preparation

The scikit-learn tool that applies different preparation to different columns (numbers: impute and scale; categories: one-hot encode) and joins the results.

ExampleColumnTransformer([('num', numeric_steps, NUM), ('cat', OneHotEncoder(handle_unknown='ignore'), CAT)]).

Confusion matrix

Also: confusion_matrix

Evaluation

A table of the four possible outcomes of yes/no predictions: who we flagged and who we didn't, against what really happened. Every classification metric is a way of summarising these four numbers.

ExampleThe rule on 5,638 training customers: 789 leavers caught, 729 wasted calls, 706 missed leavers, 3,414 correctly left alone.

Control group (random hold-out)

Also: hold-out group, A/B test

Framing a project

A randomly chosen group that does not receive the action, kept to measure what the action really adds.

ExampleKeep a random 10% of eligible customers out of the September calls and compare their upgrade rate with those called.

Taught inS2RelatedSelection vs effectUplift modellingHW1 memo; HW2 Part F
Correlation

Also: Pearson correlation, chi-square test

Data quality and preparation

How strongly two columns move together, from −1 to 1. Pearson correlation suits two numeric columns; for a category against a yes/no outcome, compare the outcome rate per category or use a chi-square test.

ExampleTenure and TotalCharges are strongly correlated; churn rate by contract type shows the contract effect directly.

Critical path

Also: project steps

Framing a project

The seven steps of a simple ML project: frame the use, build the dataset, explore, design the evaluation, build the baseline, diagnose and improve, confirm and hand over.

ExampleSession 1 covers the first three steps; Sessions 2 and 3 cover the rest.

Taught inS0S1RelatedProject pyramid (levels 1-4)Programme; S1
Cross-validation

Also: CV, k-fold, cross_validate

Evaluation

Split the training data into K parts (folds). Train on K−1, validate on the one left out, rotate until every part has been the validation part once. Gives K honest scores instead of one, while the test set stays locked.

Example5-fold cross-validation on 5,628 churn customers: five scores between 0.68 and 0.85, mean 0.76.

Crossover

Also: recombination

Search and optimization

Building a child from two parents by taking each gene from one parent or the other. Good building blocks from different parents can meet in one child.

ExampleParent #3 gives depth 3, parent #1 gives learning rate 0.03: a combination neither parent had.

Crosstab

Also: contingency table, cross tabulation

Python tools

A table of counts for two columns at once. With normalize='index', each row shows shares that add up to 1.

Examplepd.crosstab(df['PaymentMethod'], df['Churn'], normalize='index'): electronic check payers leave far more often.

D

OptionalThe wider landscape

Complex models need very large datasets and compute; organisations without them should keep models simple.

ExampleGoogle can afford a deep network; a 5,000-row customer table usually can't.

Taught inS1RelatedDeep learningS1
DataFrame

Also: pandas DataFrame, df

Python tools

pandas' table: a set of named columns (Series) that share one row index.

Exampledf = pd.read_csv('telco_churn_teaching.csv') gives a DataFrame of 7,071 rows and 22 columns.

Taught inS0RelatedSeriesIndexS0
OptionalThe wider landscape

The line or surface a classifier draws between labels. Different algorithms are allowed different boundary shapes.

ExampleLinear model: one straight line. Decision tree: vertical and horizontal cuts. Neural network: a flexible curve.

Decision statement

Also: use statement

Framing a project

One sentence that says who uses a prediction, when, for how many, and for what goal. If a bracket stays empty, the project isn't ready.

ExampleEvery Monday we score active customers and the retention team calls the 100 most likely to leave in the next 30 days, so that we keep more revenue than the calls cost.

Decision tree

Also: DecisionTreeClassifier, tree

Machine learning basics

A model that learns a sequence of yes/no questions about the features. Without limits it can memorize the training data.

ExampleAn unlimited tree is 99.7% right on training customers and 72.6% on new ones; limited to depth 4 it gets about 79% on both.

Taught inS0RelatedOverfittingS0
Search and optimization

One choice the search is allowed to change. Together they make up the search space; each becomes one gene in a genetic algorithm.

ExampleModel family; C and class weight; depth, learning rate and leaf size; a yes/no switch for each of the 19 columns.

OptionalThe wider landscape

Neural networks with many layers that learn their own features from raw data. Strong on images, sound and text; needs much data and compute.

ExamplePixels to edges to shapes to 'cat'. On a modest business table, tree ensembles usually match it.

Default settings

Also: defaults, out-of-the-box settings

Models and settings

The values a library uses when you set nothing. A starting point chosen for typical data, not for yours; on small tables they often overfit.

ExampleGradient boosting with defaults: training 0.96, validation 0.77. With gentle settings: training 0.86, validation 0.81.

Distribution shift (drift)

Also: drift, data shift

Data quality and preparation

When the data a model meets in use differs from the data it learned from. Performance degrades quietly, with no error message.

ExampleThe users a model learned from were mostly older; the users it now serves are mostly young.

Taught inS1RelatedRepresentativenessS1
Working with agents

Three questions asked at every project step: what can I do myself (level 1), what must I raise with a data scientist or the business (level 2), and what can an AI agent take on.

ExampleSplitting the data: I implement it; I raise whether 'new data' means future months or new customers; an agent can write the code.

Taught inS0S1RelatedEscalation (level-2 decision)AI agentProgramme; S1 hands-on slides
dtype (data type)

Also: data type

Python tools

The type of the values in an array or column, such as int64, float64 or text (object or str). One wrong value can change the type of a whole column.

ExampleTotalCharges is read as text because 11 rows contain a blank space instead of a number.

Machine learning basics

scikit-learn's ready-made baseline. With strategy='most_frequent' it always predicts the most common label.

ExampleDummyClassifier(strategy='most_frequent') scores 0.735 on the test set.

Taught inS0RelatedBaselineS0
Duplicate rows

Also: duplicated, repeated records

Data quality and preparation

Rows that repeat: exact copies, or the same key (such as a customer ID) appearing more than once, sometimes with conflicting values.

ExampleThe teaching data has 22 exact copies and 6 customers who appear twice with different monthly charges.

E

Elitism

Also: elite

Search and optimization

Copying the best candidates unchanged into the next generation, so the best found so far can never be lost. Re-checking them costs nothing: their score is already known.

ExampleCandidate #3 (0.81) moves to generation 2 as it is; only the children cost new evaluations.

Elvis in the toast

Also: fresh toast, spurious pattern

Evaluation

A metaphor for finding patterns that aren't there. People see faces in toast; flexible algorithms find patterns in noise. Only fresh data exposes them.

ExampleA model trained on coin-flip labels scores 100% on what it studied and 49% on new data.

Taught inS1RelatedOverfittingGeneralizationS1(after Kozyrkov)
Models and settings

A model built from many models whose predictions are combined. Usually more accurate and stable than any single member.

ExampleA random forest averages hundreds of trees; gradient boosting adds hundreds of small trees one after another.

Taught inS2RelatedRandom forestGradient boostingS2 discussion; Reading: model families
Evaluation

Reading a model's mistakes row by row and segment by segment, instead of only its average score. It tells you whether a better model, better data or a business decision is needed.

ExampleInside the 400-call list, the 78 wasted calls look just like the 322 hits in every column we have, so the next step is a data request, not more tuning.

evaluate(params)

Also: churn_eval.py, objective function

Models and settings

One function that takes a candidate set of choices, builds the pipeline, cross-validates it and returns one honest number. Earth calls it thousands of times in the labs.

Exampleevaluate({'C': 1.0, 'columns': 'all'}) returns the cross-validated hit rate of a 400-call list.

Evaluation budget

Also: new evaluations, search budget

Search and optimization

How many new evaluations (and how much time) a search may spend. Re-checking a candidate whose score is already known costs nothing, so a fair comparison of methods gives each the same number of new evaluations.

Example40 new evaluations in class (about 20 seconds); thousands on Earth.

Expected value of an action

Also: EV, value of a call list

Framing a project

Chance of success × value of success − cost of acting. Ranking by expected value rather than by chance alone puts the most valuable customers first.

ExampleTwo customers equally likely to upgrade: call the Basic one first (₪50 a month) before the Standard one (₪30).

Taught inS2RelatedBreak-even precisionRanking policy (top N)S2; HW1 Part C
Framing a project

One row per change tested: change, hypothesis, result, decision. Keeps failed ideas from being tried again and makes every kept change explainable.

Example+ price_change | customers whose price rose leave more | −2 points, worse in 4 folds | not kept; needs a real price history.

Taught inS3RelatedOne change at a timeProject logS3; notebook 4.5

F

F1 score

Also: F1, F-measure

Evaluation

One number that balances precision and recall (their harmonic mean). Common on imbalanced data, but its fixed balance may not be the one the business needs.

ExampleWith a fixed list of 400 calls, the hit rate of that list says more than F1 does.

Taught inS2RelatedPrecisionRecallS2 discussion
False positive and false negative

Also: FP, FN, TP, TN, type I error, type II error

Evaluation

The two kinds of mistake. A false positive flags someone who is not a case (a wasted call); a false negative misses someone who is (a leaver we never called). True positives and true negatives are the correct cases.

ExampleCalling a happy customer costs a call; missing a leaver costs the customer. Which mistake hurts more is a business question.

Taught inS2RelatedConfusion matrixS2
Feature

Also: input, variable, column, X

Framing a project

A piece of information about each instance that the model can use as input. It must be known at the moment of prediction.

Exampletenure, Contract and MonthlyCharges are features; LastContactReason is not, because it is recorded after the outcome.

Feature engineering

Also: domain knowledge

Framing a project

Creating inputs that help the model, usually from domain knowledge. A new column is a hypothesis written in code.

ExampleThe smoothie: adding grams of fat, carbs and protein cut the error from 47 to 4 calories, and the model rediscovered nutrition labels.

Feature importance

Also: permutation importance, SHAP

Models and settings

A measure of how much a model relies on each column. Useful for checking a model, not a business rule, and it shifts with settings and correlated columns.

ExampleGradient boosting reports which columns its trees split on most; permutation importance measures how much the score drops when a column is shuffled.

Taught inS2RelatedCoefficient (weight)Feature selectionS2 discussion; Reading: model families
Feature selection

Also: ablation, feature pruning

Data quality and preparation

Choosing which columns go into the model. Done honestly by dropping a group, retraining under cross-validation and comparing; done carelessly, it is a source of leakage.

ExampleDrop the weakest columns and compare: if far fewer columns score the same, keep the smaller, cheaper model.

Taught inS2RelatedPreprocessing leakageFeature importanceS2 discussion; HW2 Part E
Feedback loop

Also: self-fulfilling model

Framing a project

When a model's decisions shape the data it is later retrained on. It keeps confirming its own choices and its blind spots become permanent.

ExampleIf the model picks who gets called each month, almost every upgrader in the data was called by the model, and customers it never called never get a chance to prove it wrong.

OptionalThe wider landscape

Retraining a model's parameters on your own examples. Powerful and costly; it turns the work into a supervised learning project.

ExampleTeaching a model a consistent house style from thousands of approved answers.

First look at a dataset

Also: shape, head, describe, value_counts

Python tools

Five commands to run on any new data before anything else: shape, head, dtypes (or info), describe and value_counts.

ExampleOn our data they reveal 7,071 rows, a money column stored as text, and that most customers are on monthly contracts.

fit and transform

Also: fit_transform, replay

Machine learning basics

fit learns from data (a median, the list of categories, the weights); transform or predict applies what was learned. In a pipeline, fit runs on training rows only and the same learned steps are replayed on every new row.

ExampleThe imputer learns the median monthly charge from training customers and fills gaps in new customers with that same number.

Evaluation

One of the K parts in cross-validation. In each round one fold validates and the others train.

ExampleWith 5 folds of about 1,125 customers, every customer is validated once by a model that never saw them.

Taught inS2RelatedCross-validationS2
Formulation card

Also: problem formulation

Search and optimization

The optimization problem written down by people before any search starts: decision variables, objective, constraints, budget, stop rule, what is fixed and never searched, and how the winner will be protected from optimism. Earth needs exactly this.

ExampleFixed by people: the decision, the population, the label, the metric, the validation scheme and the test set.

Freezing the choice

Also: frozen pipeline

Framing a project

Fixing the pipeline and the policy, out loud and in writing, before opening the test set. After that, the test result is reported as it is, never used to reopen the search.

ExampleFrozen: gentle boosting, rank and call the top of the list. Test, 101 calls: 0.85.

Fresh folds (re-check)

Also: re-check on fresh folds

Evaluation

A new cross-validation split that played no part in choosing a winner, used to re-score it. The drop from the score that picked it to the fresh score measures how much of the win was luck.

ExampleThe top 5 of 40 random candidates: 0.801 on the folds that chose them, 0.790 on fresh folds (seed 7).

G

Search and optimization

One position in a genome, holding the value of one decision variable. Genes that do not apply to a candidate (C for a tree) are carried along unused.

ExampleThe "max depth" gene holds 3; the "TotalCharges" switch gene holds 1 (column in).

Taught inS3RelatedGenomeDecision variableS3
Generalization

Also: one job

Evaluation

How well a model does on data it has never seen. Machine learning has one job: succeed on new data.

ExampleDay 61: for days 1 to 60 you look the dose up; a model is only useful if the pattern still holds on day 61.

Genome

Also: chromosome, individual, candidate

Search and optimization

One candidate written as a list of genes, one per decision variable. For us, a genome describes a whole pipeline.

ExampleBoosting · depth 3 · learning rate 0.05 · leaf 40 · 19 column switches on.

Gradient boosting

Also: GBM, boosting, HistGradientBoostingClassifier

Models and settings

A tree ensemble built step by step: each new small tree corrects the mistakes of all the trees before it, and its contribution is scaled down by a learning rate. Usually the strongest family on tables with enough data; needs careful settings on small data.

ExampleHistGradientBoostingClassifier with default settings overfits the 4,800 upsell customers; gentler settings match logistic regression.

Group split

Also: GroupKFold

Evaluation

A split that keeps all rows of the same customer (or store, or patient) on one side. Otherwise the model meets people it trained on in the exam.

ExampleSession 1's duplicates put 10 customers in both training and test; we drop them from training. With many repeats, use GroupKFold.

groupby (split, apply, combine)

Also: split-apply-combine

Python tools

Split rows into groups, compute a summary for each group, and combine the results into one table.

Exampledf.groupby('InternetService')['left'].agg(['mean', 'size']): fibre about 42% left out of 3,113 customers.

H

Handover note

Also: model handover

Framing a project

Five to eight lines for the person who will run the model: what it does, expected performance with its uncertainty and baseline, inputs and what must be true of them, known limits, what to watch and who owns it.

ExampleKnown limits: reaches almost only month-to-month customers; predicts who leaves, not who a call would save.

Taught inS3RelatedMonitoringFreezing the choiceS3; notebook Confirm
Hit rate at K

Also: precision at K, hit rate of the call list, hit_rate_at_k

Evaluation

Rank everyone by score, take the top K, and measure the share of real cases among them. Precision at the team's capacity: the metric that matches a fixed call list.

ExampleTop 400 by score: random 27%, rule newest first 65%, rule fibre first 76%, logistic regression 76%.

Hits and wasted calls

Also: wasted call, compare_hits_vs_wasted

Evaluation

The two groups inside an action list. Hits are customers on the list who really are cases (called, and left). Wasted calls are customers on the list who are not (called, and stayed): the model's false positives.

ExampleGentle boosting's 400 calls: 322 hits, 78 wasted calls. Tenure 3.3 vs 3.7 months, charges ₪80 vs ₪78: nothing separates them.

Hyperparameter

Also: setting, knob

Models and settings

A setting chosen before training that shapes how the model learns: how strongly to simplify, how deep a tree may grow, how many trees. Chosen by comparing validation results, never test results.

ExampleC for logistic regression; max_depth for a tree; learning_rate and number of trees for gradient boosting.

I

Identifier

Also: ID, key

Data quality and preparation

A column that names a row, such as a customer ID. It carries no meaning about the outcome, but a flexible model can memorize it.

ExamplecustomerID is kept as a key for joins and duplicate checks, never used as a feature.

Taught inS1S0RelatedDuplicate rowsFeatureS1
Implausible values

Also: outliers, sanity checks

Data quality and preparation

Values that can't be right: impossible ranges, wrong units, misread formats. A domain expert often spots them in seconds.

ExampleDates in the year 0040 that were really two-digit years; a negative age; a premium plan billed at 0.

Taught inS1RelatedFive data quality checksS1
Imputation

Also: SimpleImputer, fillna

Data quality and preparation

Filling missing values with a learned substitute: the median or mean, the most common value, a value from similar rows, or a rule from domain knowledge.

ExampleSimpleImputer(strategy='median'); but tenure 0 means TotalCharges 0, where a median would be wrong.

Index

Also: row labels

Python tools

The row labels of a DataFrame or Series. Operations line rows up by index, not by position.

ExampleAfter filtering, the index keeps the original row numbers, which is why loc and iloc can give different rows.

Taught inS0Relatedloc and ilocS0
Inference (scoring)

Also: scoring, prediction

Machine learning basics

Using a trained pipeline on new rows to produce predictions. Every learned step is replayed exactly as it was learned.

ExampleEach month the pipeline scores all current customers and the top 400 go to the retention team.

Taught inS2Relatedfit and transformPipelineS1 discussion; S2
Instance (row)

Also: row, example, observation

Framing a project

One example the model learns from or makes a prediction for: one row of the dataset.

ExampleOne customer in our data; one email in a spam filter.

Taught inS1S0RelatedUnit of analysisS1

K

Python tools

The running Python process behind a notebook. It holds everything in memory: variables, imported libraries, loaded data.

ExampleRestarting the kernel wipes memory, which is how you find cells that depend on something run earlier.

Taught inS0RelatedNotebook (Jupyter)S0

L

Label (target)

Also: target, ground truth, y

Framing a project

The answer the model learns to predict. Someone has to define it: what counts, over which window, from which moment.

ExampleChurn = 'left within the month before the snapshot' in our data; our project needs 'cancels within 30 days of the scoring Monday'.

Taught inS1S0RelatedLabel definitionFeatureS1
Label definition

Also: target definition

Framing a project

The precise rule for what counts as a positive example, including ambiguous cases. It is a business decision, not a fact found in the data.

ExampleDoes a downgrade count as leaving? A customer who cancels and returns two weeks later? Someone has to rule.

Taught inS1RelatedLabel (target)Label noiseS1
Label noise

Also: noisy labels

Data quality and preparation

Errors or inconsistencies in the recorded answers.

Example'Spam' is whatever users moved to the spam folder; bakery sales undercount demand on sold-out days.

Taught inS1RelatedLabel definitionS1
Leading candidate

Also: deployed candidate, current best pipeline

Models and settings

The pipeline you would deploy if you had to choose now. Error analysis, improvements and the final check all belong to it, because a different model gives a different list.

ExampleGentle boosting led after the morning. Its 400-call list shares only 272 customers with logistic regression's list.

Learning rate

Also: eta, step size

Models and settings

How big a step each training update takes. In gradient boosting: how much each new tree may correct. Smaller is more careful but needs more trees.

Examplelearning_rate=0.03 with 300 trees instead of the default 0.1 with 100.

Taught inS2RelatedGradient boostingHyperparameterS2 discussion; HW2 Part D
OptionalWorking with agents

Autonomous (the agent does it and reports), semi-autonomous (the agent proposes, a person approves), manual (a person decides). Autonomy follows reversibility.

ExampleTrying hyperparameters is autonomous; defining success is manual.

loc and iloc

Also: selection, indexing

Python tools

Two ways to select rows and columns: loc by label or condition, iloc by position.

Exampledf.loc[df['tenure'] == 0, ['customerID', 'TotalCharges']] selects brand-new customers and two columns.

Taught inS0RelatedBoolean maskIndexS0
Logistic regression

Also: LogisticRegression

Machine learning basics

A simple, fast classification model that combines the features with learned weights and outputs a probability.

ExampleOn our split it reaches about 80% test accuracy, against 73.5% for the baseline.

Loss function

Also: loss, objective, log-loss, cost function

Machine learning basics

The error a learning algorithm minimises during training, built into the algorithm (for logistic regression, log-loss). It is not the business metric; the data scientist makes sure the two point the same way.

ExampleThe model is trained to reduce log-loss; the retention team judges it by how many of its 400 calls reach a leaver.

M

Machine learning basics

A way of getting a recipe that turns inputs into outputs: instead of a person writing the rules, an algorithm stitches them together from examples with answers.

ExampleNobody writes rules for spam; the filter learns them from emails people marked as spam.

Python tools

Replacing values using a dictionary. Anything missing from the dictionary becomes NaN, which works as an alarm.

Exampledf['PaperlessBilling'].map({'Yes': 1, 'No': 0}) turns text into 1/0.

Method chaining

Also: chaining

Python tools

Writing a sequence of pandas steps as one expression, one step per line, so the whole recipe reads top to bottom.

Examplepd.read_csv(path).assign(TotalCharges=...) builds the cleaned table in one readable block.

Taught inS0RelatedDataFrameS0
Data quality and preparation

A blank can mean 'not yet', 'unknown' or 'not applicable'. Filling it with 0, the average, or dropping the row are three different claims about the world.

ExampleBlank TotalCharges belong to customers in their first month: set to 0 ('no bill yet'), never to the average.

Missing value (NaN)

Also: NaN, null, NA

Data quality and preparation

A value that isn't there. pandas shows it as NaN. Missing data can also hide as a blank space, a zero or a placeholder word.

Exampleisna() finds nothing in TotalCharges because the blanks are spaces; converting to numbers reveals 11 missing values.

Missing-value flag

Also: missing indicator, add_indicator, was-missing flag

Data quality and preparation

An extra 0/1 column saying whether a value was missing, kept alongside the filled value. Useful when the fact that something is missing carries information.

ExampleUpsell data: customers whose handsets don't report usage upgrade about twice as often; the flag keeps that signal.

Taught inS2RelatedImputationMissing is not zeroS2 discussion; HW2 Part E
Framing a project

Two kinds of finding in error analysis. A better model or better data can fix mistakes inside the list; who is on the list at all (value per customer, fairness, strategy) is a business decision to raise.

ExampleBoard, Cycle 4. MODEL CAN FIX: 78 wasted calls → data request. BUSINESS DECIDES: 0 of 172 long-contract leavers reached → raise with the retention lead.

Model family

Also: algorithm family

Models and settings

A group of algorithms that learn the same kind of shape: linear models (logistic regression), trees, tree ensembles (random forest, gradient boosting), neural networks. Choosing a family is choosing what patterns the model can express.

ExampleOn a table of a few thousand customers, a linear model and gentle gradient boosting perform about the same.

Taught inS2RelatedLogistic regressionDecision treeGradient boostingS2; Reading: model families
Monitoring

Also: model monitoring

Framing a project

Checking a deployed model regularly: its real hit rate, the mix of the data it scores, missing values. With a rule for when to retrain, and an owner.

ExampleEach month: hit rate of last month's list, the share of contract types, missing values; retrain if the hit rate falls below the rule.

Search and optimization

A small random change to a child's genes. Most mutations make things worse; some bring in values no parent had, which keeps the search from getting stuck.

ExampleMin leaf 40 → 20 in the child.

Taught inS3RelatedCrossoverElitismS3

N

OptionalThe wider landscape

Layers of simple mathematical units connected by learned weights. Allows very flexible decision boundaries.

ExampleThe squiggly boundary in the wine example.

Taught inS1RelatedDeep learningS1
Notebook (Jupyter)

Also: Jupyter, Colab notebook

Python tools

An interactive document that mixes code cells, their outputs and text. Cells can run in any order; the number in brackets shows the order they actually ran.

ExampleA variable defined in a lower cell works in an upper one only because it was run earlier. Restart and run all to check the notebook really works top to bottom.

Taught inS0RelatedKernelS0
NumPy array

Also: ndarray, array

Python tools

A grid of values that all share one type, stored so that whole-array operations run in fast compiled code.

Examplechurned = (df['Churn'] == 'Yes').to_numpy() gives an array of True/False values, one per customer.

O

One change at a time

Also: controlled experiment

Evaluation

Testing one idea by changing one thing only and keeping the folds, the metric and everything else fixed, then reading the difference fold by fold. If you change two things and the score improves, you don't know why.

ExampleAdd price_change to gentle boosting, same folds: 0.812 → 0.792, worse in 4 folds, a tie in 1. Not kept.

Taught inS3RelatedPaired comparisonExperiment logS3; notebook 4.5
One-hot encoding

Also: dummy variables, get_dummies

Data quality and preparation

Turning a category into several 0/1 columns, one per value, so a model can use it without inventing an order.

ExampleContract becomes Contract_One year and Contract_Two year; month-to-month is the row with both zeros.

Taught inS0RelatedFeatureS0
Optimization problem

Also: optimisation

Search and optimization

Choosing the values of some decision variables to make an objective as good as possible, while respecting constraints, within a budget. Tuning a pipeline is one: the variables are the choices, the objective is the validated metric.

ExampleMaximize the hit rate of a 400-call list over model family, settings and columns, using columns known at prediction time, in 40 new evaluations.

Out-of-fold score

Also: cross_val_predict, OOF

Evaluation

A score for each training row from the model that did not see that row during training. Lets you judge the whole training set honestly.

Examplecross_val_predict gives every churn customer a probability from a model trained on the other four folds.

Taught inS2RelatedCross-validationS2
Overfitting

Also: memorizing

Evaluation

When a model memorizes quirks of its training data instead of learning patterns that hold on new data. Great on what it studied, poor on anything else.

ExampleThe unlimited decision tree, or the student who learns that 8 divided by 4 is infinity by turning the 8 on its side.

P

Paired comparison

Also: same-fold comparison, fold-by-fold comparison

Evaluation

Comparing two pipelines on the same folds, fold by fold: count the wins and ties and look at the difference per fold. Much of the noise is shared by both pipelines, so this is fairer than comparing two means with their spreads.

ExampleLogistic regression vs gentle boosting on the same five folds: boosting wins 4, ties 1, mean difference +0.052.

Parameter

Also: learned parameter

Models and settings

A value the algorithm learns from data during training: the weights of a logistic regression, the questions and cut-offs of a tree.

ExampleLogistic regression learns a weight of −1.4 for scaled tenure.

Pipeline

Also: make_pipeline

Machine learning basics

Preparation steps and a model packaged as one object, so new data is treated exactly the same way as training data. Covered properly in Session 2.

Examplemake_pipeline(StandardScaler(), LogisticRegression()) scales and models in one fit.

Pipeline component

Also: step, transformer

Machine learning basics

One step of a pipeline: filling gaps, flagging missing values, scaling, encoding categories, selecting columns, or the model itself. Components are what a search may change.

ExampleSwap median for mean imputation, or logistic regression for gradient boosting, and keep everything else fixed.

Taught inS2RelatedPipelineSearch spaceS2; HW2 Part E
Pivot table

Also: pivot_table

Python tools

A two-way summary: rows by one column, columns by another, any aggregation in the cells.

ExampleShare who left by contract type within each internet service: the monthly-contract effect holds in every group.

Taught inS0S1RelatedCrosstabChecking across groupsS0; S1 notebook Cycle 6
Precision

Also: positive predictive value

Evaluation

Of everyone we flagged, the share that really are cases: caught ÷ calls. Protects the team's time.

ExampleThe rule calls 1,518 customers and 789 of them leave: precision 52%.

Lowering the threshold flags more people: recall goes up, precision goes down. Raising it does the opposite. Where to stand is a business decision about costs and capacity.

ExampleChurn model: threshold 0.3 gives about 2,140 calls (precision 0.54, recall 0.78); 0.7 gives about 350 calls (0.76, 0.18).

Predicted probability (score)

Also: predict_proba, score

Machine learning basics

The model's estimate of how likely each label is. predict() turns it into a label using a cut-off of 0.5 unless told otherwise.

ExampleA month-to-month fibre customer scores 0.68 'likely to leave'; the retention team might call the top 100 scores whatever the cut-off.

Taught inS0S1RelatedThreshold (cut-off)S0
Preparation log

Also: decision log

Data quality and preparation

A written record of every data fix: what, how many rows, what was done, and why. Every fix is a decision.

Example'Blank TotalCharges, 10 rows, set to 0, all tenure 0: no bill yet.'

Preprocessing leakage

Also: pipeline leakage

Data quality and preparation

Learning a preparation step (a median, a scale, a column selection) on rows that are later used to validate or test. The validation score becomes optimistic. Prevented by putting every learned step inside the pipeline.

Example2,000 columns of pure noise: selecting the best 20 on all rows gives AUC 0.59; the same selection inside the pipeline gives 0.49, a coin flip.

Framing a project

One line per cycle recording what was decided and why. It becomes the project file that later sessions build on.

Example'Test set locked: 20%, stratified, seed 42.'

Taught inS1RelatedPreparation logProgramme; S1 notebook
Framing a project

Four levels of ML projects: routine application, applied DS decisions, specialist ML, research. The programme trains full capability at level 1 and foundations of level 2.

ExampleBuilding a churn model on agreed data is level 1; choosing how to define churn when the business disagrees is level 2.

Machine learning basics

The project is the business need and its limits. The pipeline is every step that turns a raw record into a score, learned on training data and replayed on new rows. The model is one component of the pipeline: the algorithm that learns from examples.

ExampleProject: a list of 400 customers every month. Pipeline: impute, encode, scale, logistic regression. Model: logistic regression.

Taught inS2RelatedPipelinePipeline componentModelS2 discussion; HW2 Part A
Prompting

Also: prompt engineering

OptionalThe wider landscape

Steering an LLM with instructions and examples in the request. Cheapest way to adapt it; can be fragile.

ExampleAdding three examples of good answers to the request.

R

Random forest

Also: RandomForestClassifier

Models and settings

A tree ensemble of many deep trees, each built on a random sample of rows and columns, whose votes are averaged. Robust with little tuning.

ExampleRandomForestClassifier(n_estimators=300) is a common second model after logistic regression.

Taught inS2RelatedEnsembleGradient boostingReading: model families
Random seed

Also: random_state, seed

Python tools

A fixed starting number for a random generator, so that 'random' results come out the same every run.

Examplerandom_state=42 makes the train/test split identical each time, so results can be compared.

Taught inS0S1RelatedTrain/test splitS0

Threshold metrics (accuracy, precision, recall, F1 at a cut-off) judge one yes/no policy. Ranking metrics (AUC, hit rate at K) judge how well the scores order customers. With a fixed capacity, ranking metrics match the decision.

ExampleOn the upsell data, logistic regression at threshold 0.5 flags only 41 customers (recall 5%), yet its top-10% list reaches 29% upgraders.

Ranking policy (top N)

Also: top-N policy, decision policy

Framing a project

Instead of a threshold, rank every customer by score and act on the top N, where N is the capacity. Always gives exactly the list the team can handle.

ExampleNo threshold gives exactly 400 calls; ranking and cutting at 400 always does.

Recall

Also: sensitivity, true positive rate

Evaluation

Of all real cases, the share we flagged: caught ÷ all leavers. Protects the customers.

ExampleThe rule reaches 789 of 1,495 leavers: recall 53%.

Recommender system

Also: recommender

OptionalThe wider landscape

A model that predicts the missing cells of a user-by-item table and shows each user their best few. Content-based, collaborative or hybrid.

Example'Customers also bought'. Traps: cold start, popularity bias, feedback loops.

Taught inS1RelatedCold startS1
Machine learning basics

A supervised task where the answer is a number. (In statistics the word means fitting a line; in ML it just means a numeric answer.)

ExampleCalories in a smoothie; tomorrow's demand for a bakery item.

Regularization

Also: C, L1, L2, shrinkage, penalty

Models and settings

A penalty that keeps a model simple by shrinking its weights or limiting its growth, to reduce overfitting. In scikit-learn's logistic regression, C is the inverse: smaller C means stronger regularization.

ExampleC=0.01 gives small, cautious weights; C=10 lets weights grow large.

Taught inS2RelatedHyperparameterOverfittingScaling (standardization)S2; Reading: model families
OptionalThe wider landscape

Learning by trial and error from a score for actions, often delayed, where actions change what the learner sees next.

ExampleA system learning the game Breakout discovers a tunnel strategy nobody taught it.

Taught inS1RelatedSupervised learningS1
Repeated cross-validation

Also: fold seed, repeated k-fold

Evaluation

Running cross-validation again with differently shuffled folds (a new fold seed). If a ranking holds across seeds, it is not an accident of one split.

ExampleFold seeds 1, 2 and 3: logistic regression 0.755, 0.770, 0.770 against boosting 0.815, 0.800, 0.805. Boosting stays ahead every time.

Taught inS3RelatedPaired comparisonRandom seedCross-validationS3; notebook Cycle 1
Representativeness

Also: sampling bias

Data quality and preparation

Whether the training data looks like the world the model will be used in. The training data is the only world a model knows.

ExampleUsers from an island near Antarctica, then a launch in New York; or data from before a price change.

Retraining

Also: model refresh

Framing a project

Fitting the pipeline again on fresh data at regular intervals and re-checking it against the success bar. A model in production is a service, not a finished product.

ExampleRetrain every month on the latest labelled month; if the new pipeline misses the bar, go back and fix it.

Taught inS2RelatedDistribution shift (drift)PipelineS2 discussion

S

Scaling (standardization)

Also: standardization, normalization, StandardScaler

Data quality and preparation

Rescaling each number column to a comparable range, usually mean 0 and standard deviation 1. Matters for models that add up weighted columns or apply regularization; trees don't need it.

ExampleTenure (0-72 months) and monthly charges (₪20-120) become comparable before logistic regression.

Search objective

Also: objective to maximize

Search and optimization

The single number a search tries to maximize, with how it is measured. It is the business metric under honest validation, not the loss the algorithm minimizes during training.

ExampleHit rate of a 400-call list, 5-fold stratified cross-validation, seed 42: what evaluate() returns.

Models and settings

Everything a search is allowed to change: pipeline components, model families and their hyperparameters. The project, the data decisions, the metric and the validation scheme stay fixed.

ExampleImputation {median, mean}, missing flag {yes, no}, model {logistic regression, gradient boosting}, max_depth {2..8}.

Segment table

Also: segment_table

Evaluation

For each group of customers: how many there are, their churn rate, how many left, how many we call and how many leavers we reach. Shows who the list serves and who it never touches.

ExampleContract: month-to-month 400 calls, 322 of 1,322 leavers reached; one-year 0 of 136; two-year 0 of 36.

Selection (genetic algorithm)

Also: tournament selection, parent selection

Search and optimization

Choosing parents for the next generation. Fitter candidates are picked more often, but weaker ones still get a chance, which keeps variety in the population.

ExampleTournament selection: draw three candidates at random; the best of the three becomes a parent.

Selection vs effect

Also: selection bias, treatment effect

Framing a project

When the people who received an action were chosen, not random, a difference in outcomes mixes who was chosen with what the action did. The two cannot be separated without a comparison group.

ExampleJune: one in four called customers upgraded, against fewer than one in twenty of the others. Marketing chose likely upgraders, so the gap does not prove the calls work.

Taught inS2RelatedControl group (random hold-out)Uplift modellingHW1 Part C; S2 debrief
OptionalThe wider landscape

Hiding part of the data and learning to fill it in, so the data labels itself. How LLMs are pre-trained.

Example'The patient missed the ___ because of rain' teaches the model 'appointment' with no human labelling.

Python tools

A single pandas column: values of one type, with a name and a label for each row.

Exampledf['Contract'] is a Series; df[['tenure', 'Churn']] is a DataFrame.

Taught inS0RelatedDataFrameS0
Sigmoid (S-curve)

Also: logistic function

Models and settings

The function that turns any number into a probability between 0 and 1. Logistic regression adds up weighted evidence and passes the total through it.

ExampleA large positive sum gives a probability near 1; zero gives 0.5; a large negative sum gives near 0.

Spread across folds

Also: fold variance, standard deviation across folds

Evaluation

How much the K cross-validation scores differ. A difference between two pipelines smaller than this spread is not a difference yet.

ExampleLogistic regression: 0.76 ± 0.06 across folds, while four values of C differed by 0.01: no winner.

Machine learning basics

Using data to make one or a few important decisions carefully, with uncertainty on the table.

ExampleDeciding whether to open a new branch, or whether a model is safe to launch.

Taught inS1RelatedDescriptive analyticsS1
Stop rule (termination criteria)

Also: termination criteria, stopping rule, plateau

Search and optimization

When a search ends: the budget is spent, there has been no improvement for a few generations, a good-enough target is reached, or time is up, whichever comes first. Decided before the search, like the metric.

ExampleStop after 60 new evaluations, or earlier if the best score has not improved for 2 generations.

Stratified k-fold

Also: StratifiedKFold

Evaluation

Cross-validation in which every fold keeps the same share of each class as the whole training set, so no fold is accidentally easy or hard.

ExampleEach churn fold keeps 26.5% leavers; StratifiedKFold(5, shuffle=True, random_state=42).

Success bar

Also: bar

Evaluation

How much better than the baseline a model must be to justify building and maintaining it. Write it down before seeing any model results, or you will bargain with yourself.

Example“A model is worth it only if its 400-call list beats the best rule (about 76%) by at least 5 points.”

Taught inS2RelatedBaselineBusiness metricS2
Supervised learning

Also: learning with labels

Machine learning basics

Learning from examples that come with the correct answer attached. The most common and most reliable framing when labels can be had.

ExamplePast customers with a known outcome (left or stayed) teach the model to score current customers.

T

Target leakage

Also: leakage, data leakage

Data quality and preparation

When a feature contains information that only exists after the outcome. The model looks brilliant in testing and fails in real use.

ExampleLastContactReason: for most leavers the last contact was the cancellation call itself; 96% of 'Cancellation request' customers left.

Test set (the final exam)

Also: holdout set, locked test set

Evaluation

Data set aside before exploring or modelling and opened once, at the very end. Anything you look at stops being a fair exam, including for you.

Exampletest_locked.csv is saved in Session 1 and opened in Session 3.

Machine learning basics

A deliberately plain description of machine learning: it makes many small, repeated decisions by putting a label on each thing that comes in.

ExampleEmail in, 'spam' out. Frame of a game in, 'move left' out. Patient on day 61 in, '34 mg' out.

Taught inS1RelatedMachine learningS1
Threshold (cut-off)

Also: cut-off, decision threshold

Evaluation

The score above which a prediction counts as positive. Where to put it is a business decision about the cost of each mistake.

ExampleLower the threshold and the team catches more leavers but also calls more customers who would have stayed.

Time-based split

Also: forward-chaining, TimeSeriesSplit, rolling validation

Evaluation

Train on earlier periods and validate on later ones, so the model never learns the future to predict the past. Needed whenever rows come from different dates.

ExampleWith monthly snapshots: train on January to April, validate on May, then roll forward.

Traditional programming

Also: rules-based system

Machine learning basics

A person writes the recipe (the rules) by hand; the computer applies it to data to get answers.

ExampleA VAT calculation: the rule is known and fixed, so there is nothing to learn.

Taught inS1RelatedMachine learningS1
Models and settings

The difference between a pipeline's score on the rows it trained on and on rows it never saw. A large gap is the signature of overfitting.

ExampleUpsell data: an unlimited tree hits 77% on training customers and 15% on validation customers.

Taught inS2RelatedOverfittingUnderfittingHW2 Part D
Train/test contamination

Also: data snooping

Evaluation

Any way information from the test (or validation) rows reaches training: shared customers, preparation learned on all rows, or choices made by looking at test results. A form of leakage.

Example10 customers sat in both the training data and the locked test set until they were removed.

Tree depth and leaf size

Also: max_depth, min_samples_leaf

Models and settings

The two main brakes on a tree. max_depth limits how many questions in a row; min_samples_leaf sets the smallest group a final box may describe. Without them, a tree memorises the training rows.

Examplemax_depth=3 gives a readable flowchart; no limit gives a perfect training score and poor validation.

Taught inS2RelatedDecision treeOverfittingHyperparameterS2 discussion; HW2 Part D
Type 3 error

Also: wrong question

Framing a project

Giving the right answer to the wrong question. The most expensive mistake in data science; no algorithm can fix it.

ExampleThe car park model answered 'is this space full?' with 96% accuracy when the real question was 'where are the empty spaces?'.

Taught inS1RelatedDecision statementS1(the car park story)
Type conversion (coercion)

Also: to_numeric, astype

Python tools

Turning a column into another type. With errors='coerce', values that can't be converted become NaN instead of stopping the code.

Examplepd.to_numeric(df['TotalCharges'], errors='coerce') turns 11 blank spaces into NaN.

U

Models and settings

A model too simple to capture real patterns: mediocre on training data and on new data. The opposite failure of overfitting.

ExampleA tree with depth 1 asks a single question and misses most of the signal.

Taught inS2RelatedOverfittingHyperparameterS2 discussion; Reading: model families
Unseen category

Also: handle_unknown

Data quality and preparation

A category value that appears in new data but never in training. The pipeline must decide what to do with it instead of crashing.

ExampleA new payment method “Crypto wallet” arrives; OneHotEncoder(handle_unknown='ignore') simply leaves all its columns at 0.

OptionalThe wider landscape

Learning from data without answers: the algorithm finds structure, such as groups, and people decide what the groups mean.

ExampleClustering photos of two cats may group them by sunny versus cloudy, not by cat.

Uplift modelling

Also: treatment-effect modelling, persuadability

OptionalFraming a project

Predicting who will respond because of an action, rather than who will respond anyway. Needs data from a randomized comparison. A level 2 topic: recognise when it is needed and raise it.

ExampleCall the customers the call would convince, not the ones who would upgrade on their own.

V

Validation set

Also: practice exam

Evaluation

Data used to compare options and tune a model: the practice exams. In this course it is carved out of the training part with cross-validation (Session 2).

ExampleComparing tree depths 3, 4 and 6 on validation data, never on the test set.

Vectorization

Also: vectorized operation

Python tools

Applying an operation to a whole array or column at once instead of looping over values one by one. Shorter code, far faster.

Examplechurned.mean() instead of a for-loop: about 150 times faster on a million customers.

Taught inS0RelatedNumPy arrayS0

X

XGBoost, LightGBM, CatBoost

Also: XGBoost, LightGBM, CatBoost

Models and settings

Popular, fast libraries of gradient boosting. They differ in speed and in how they handle categories (CatBoost and LightGBM natively; XGBoost with an option). You will meet them in Earth.

ExampleXGBoost's n_estimators, learning_rate and max_depth play the same roles as scikit-learn's max_iter, learning_rate and max_depth.

Taught inS2RelatedGradient boostingS2 discussion; Reading: model families