AI and ML FoundationsVol. 14A · Part XIV
0 / 0

Shelves / AI and ML Foundations

AI·150

Data Engineering for AI

Models are only as good as their data: the data-centric view of ML, ingestion from databases, events, files and the web, data cleaning (types, units, outliers, missing values), schema and statistical validation with Pandera, Great Expectations and Pydantic, annotation and labelling workflows with guidelines, inter-annotator agreement (Cohen's kappa), active learning, weak supervision and LLM-assisted labelling, exact and near-duplicate detection with hashing and MinHash/LSH, sampling and class imbalance, data leakage in all its forms and how to detect it, dataset versioning (DVC, lakeFS, Delta/Iceberg), lineage and dataset cards, LLM-scale pretraining and fine-tuning data pipelines, privacy and licensing, with code in Python, SQL, Rust, Go and Java.

28 topics · ~21 min read · 31-question quiz
Updated Suggest a correction

Start here: models are only as good as their data

In practice, most of the work, and most of the failures, in machine learning are about data: collecting it, cleaning it, labelling it, validating it, and keeping the data a model sees in production the same as the data it learned from. The data-centric view says that improving data is often a bigger lever than changing the model.

Bad labels cost more than missing data

Handwritten digits (1,797 images); some of the training labels were replaced with random digits before training:

Text
clean labels:                      96.8%
10% of labels randomised:          91.4%
30% randomised:                    87.2%
50% randomised:                    80.8%
clean labels, but only half the data: 94.7%

Ten percent wrong labels hurt more than throwing away half the data. Label quality (clear guidelines, double-labelling hard cases, auditing disagreements) is often the cheapest accuracy you can buy.

Train/serve skew: same model, different data

A demand model learned orders from temperature in °C. Months later, an upstream weather service switched to °F without anyone telling the ML team:

Text
error with °C, as trained:            12.4 orders per day (mean absolute error)
error after the switch to °F:         86.3 orders per day

Nothing crashed. The model happily accepted 95 "degrees" and produced confident, wrong forecasts. Tree models just treat anything above the hottest day they saw as "very hot"; a linear model would have forecast negative orders. This is training–serving skew, and it's silent.

Validation catches it

A simple check of each incoming batch against the training data's ranges and averages:

Text
°C batch:  ok
°F batch:  temp_c: 100% outside training range [20.0, 42.0]
           temp_c: mean shifted by 9.0 standard deviations

Data validation (schemas, types, ranges, missing-value rates, distribution shift) at every boundary, before training and before serving, turns silent failures into alerts. Tools like Great Expectations, Pandera, TFDV or a few lines of pandas do the job.

Duplicates that hashing misses

Menu lines from three suppliers:

Text
0.81  'Dal tadka with jeera rice and papad, ₹120'  ~  'Dal tadka with jeera rice & papad, ₹120'
0.72  'Dal tadka with jeera rice and papad, ₹120'  ~  'dal tadka with jeera rice and papad - Rs 120'
exact-hash deduplication found: 0 duplicates

Comparing overlapping three-character chunks (Jaccard similarity) found what exact matching missed. Near-duplicates inflate evaluation (chapter 149) and over-weight repeated content in training; large text datasets are deduplicated with scalable versions of exactly this (MinHash with locality-sensitive hashing).

How deep to go in data engineering for AI

Volume 17 defines six mastery levels. For this chapter they look like this; the chapter aims at L3 everywhere, and its lab at L4.

Level What you can do
L1 Explain why data quality, labels and consistency drive model quality
L2 Clean data, split correctly, validate schemas and ranges, deduplicate
L3 Explain labelling strategies, drift and skew types, feature stores and data versioning
L4 Diagnose label noise, skew, drift and contamination from data and model behaviour
L5 Design data pipelines for ML: ingestion, validation, labelling, lineage and versioning
L6 Run data platforms and governance (quality SLAs, privacy, consent) for many ML teams

Data-centric AI

In most applied projects, improving the data (more relevant examples, cleaner labels, better coverage of rare cases, consistent definitions) beats tweaking the model. Large-model results reinforce this: data quality, deduplication and mixture decisions are among the biggest levers in pre-training and fine-tuning.

sourcesDB · logs ingest clean validate label dedup+split datasetv12 lineage · metadata · data quality metrics train · eval production feedback: new data, errors, user corrections
A data pipeline for machine learning. Raw sources are ingested, cleaned, validated against schemas and expectations, labelled, deduplicated and split, then versioned as an immutable dataset snapshot with lineage. Training and evaluation consume a specific version, and production feedback flows back as new raw data.

Data ingestion

Source Patterns
Operational databases Batch extracts (SQL), change data capture (Debezium → Kafka) for freshness; never train directly on a live OLTP replica under load
Events / logs Kafka, Kinesis, Pub/Sub → object storage (Parquet) → lakehouse tables
Files CSV, JSON, Parquet, images, audio, PDFs; object storage (S3, GCS, ADLS) as the landing zone
Documents PDF/HTML/Office parsing, OCR, layout extraction for RAG and fine-tuning corpora (chapter 161)
Web Crawling with robots.txt respect, rate limits, licence checks; Common Crawl for pre-training
APIs / SaaS Connectors (Airbyte, Fivetran), pagination, incremental cursors
Synthetic Generated by simulators or LLMs (with quality filtering and contamination checks)

Store raw data immutably (bronze), then cleaned (silver) and feature/training-ready (gold) layers: the medallion pattern on a lakehouse (Delta Lake, Apache Iceberg, Hudi). Columnar formats (Parquet) and engines (Spark, DuckDB, Polars, Trino) make large scans cheap.

SQL
-- Point-in-time correct training set: features as they were when each label was observed
SELECT l.user_id, l.label_time, l.churned,
       f.orders_30d, f.avg_basket, f.support_tickets_90d
FROM labels l
ASOF JOIN user_features f                      -- DuckDB / Snowflake-style as-of join
  ON l.user_id = f.user_id AND f.feature_time <= l.label_time;

Cleaning

Common problems and fixes:

  • Types and parsing: numbers as strings, mixed date formats, locale decimal commas, encodings (UTF-8 vs Latin-1 mojibake). Parse explicitly; fail loudly.
  • Units and scales: grams vs kilograms, cents vs dollars, UTC vs local time. Normalise and document.
  • Missing values: understand why they're missing (not collected, not applicable, failed join). Impute with care plus indicator columns (chapter 148); drop only if missingness is random and rare.
  • Outliers: distinguish data errors (age 999) from real extremes (a whale customer). Clip, winsorise or keep with robust models.
  • Duplicates and inconsistent categories: "USA", "U.S.", "United States"; trailing spaces; case.
  • Text: normalise Unicode (NFC/NFKC), strip boilerplate HTML, fix broken encodings (ftfy), detect language, remove PII where required.
  • Images/audio: corrupt files, wrong orientation (EXIF), inconsistent sample rates.

Cleaning code belongs in versioned, tested pipelines, not notebooks that someone runs once.

Python
import pandas as pd, numpy as np

raw = pd.DataFrame({
    "country": ["USA", "U.S.", "india ", "India", None],
    "amount": ["1,200.50", "99", "n/a", "45.5", "300"],
    "ts": ["2026-03-01T10:00:00Z", "2026-03-01 15:30", "01/03/2026", "2026-03-02T08:00:00+05:30", "2026-03-02"],
})
COUNTRY = {"usa": "US", "u.s.": "US", "india": "IN"}
clean = raw.assign(
    country=raw["country"].str.strip().str.lower().map(COUNTRY),
    amount=pd.to_numeric(raw["amount"].str.replace(",", "", regex=False), errors="coerce"),
    ts=pd.to_datetime(raw["ts"], utc=True, format="ISO8601", errors="coerce")         # ISO first
       .fillna(pd.to_datetime(raw["ts"], utc=True, format="%d/%m/%Y", errors="coerce")),  # then the known DD/MM source
)
clean.isna().sum()          # count what failed to parse instead of silently guessing
# Trap: format="mixed", dayfirst=True would also flip ISO "2026-03-01" into 3 January.
# Parse each known format explicitly and treat anything left over as an error.

Validation

Data validation catches problems before they silently poison a model: a source system changes a column's units, an upstream join drops half the rows, a feature becomes constant.

Levels:

  1. Schema: columns, types, nullability, allowed categories.
  2. Value constraints: ranges, regex formats, uniqueness, referential integrity.
  3. Statistical: distributions, missing rates, cardinality and correlations compared with a reference (training) dataset; alerts on drift.
  4. Semantic / cross-field: end_date ≥ start_date; totals equal sum of parts.
  5. Label sanity: class balance, label-feature relationships that should exist.

Tools: Pandera (DataFrame schemas in Python, also Polars), Great Expectations (expectation suites with data docs), Pydantic (record-level validation for JSON/APIs and LLM outputs, chapter 167), dbt tests (SQL), TFX Data Validation, Deequ (Spark, Scala/Java), Soda.

# Python: Pandera schema for a training table
import pandera.pandas as pa
schema = pa.DataFrameSchema({
    "user_id": pa.Column(int, unique=True),
    "age": pa.Column(float, pa.Check.in_range(13, 110), nullable=True),
    "country": pa.Column(str, pa.Check.isin(["US", "IN", "GB", "DE"])),
    "amount": pa.Column(float, pa.Check.ge(0)),
    "churned": pa.Column(int, pa.Check.isin([0, 1])),
}, checks=pa.Check(lambda df: df["churned"].mean() < 0.5, error="churn rate implausible"))
schema.validate(df, lazy=True)   # lazy=True reports all failures at once

Annotation and labelling

Supervised learning needs labels, and labels are expensive, noisy and often ambiguous.

The labelling workflow

  1. Define the task precisely: label taxonomy, edge cases, examples of each class and of hard negatives. Write annotation guidelines and revise them as disagreements surface.
  2. Pilot: label a small batch with several annotators; measure agreement; refine guidelines.
  3. Scale: in-house experts, vendors, crowdsourcing; tools such as Label Studio, Argilla, Prodigy, CVAT (images/video), Labelbox, Scale.
  4. Quality control: gold questions with known answers, overlap (multiple annotators per item), adjudication by experts, annotator-level accuracy tracking.
  5. Version labels and guidelines together; record who labelled what, when, under which guideline version.

Inter-annotator agreement

Raw agreement overstates quality because some agreement happens by chance. Cohen's kappa corrects for chance between two annotators:

κ = (p_o − p_e) / (1 − p_e)

where p_o is observed agreement and p_e is agreement expected from each annotator's label frequencies. κ > 0.8 is strong, 0.6–0.8 substantial, < 0.4 weak (usually means the guidelines or task definition need work). Fleiss' kappa and Krippendorff's alpha generalise to many annotators and missing labels.

Python
def cohen_kappa(a, b):
    a, b = np.asarray(a), np.asarray(b)
    labels = np.union1d(a, b)
    p_o = np.mean(a == b)
    p_e = sum(np.mean(a == l) * np.mean(b == l) for l in labels)
    return (p_o - p_e) / (1 - p_e)

ann1 = ["pos", "pos", "neg", "neg", "pos", "neu", "neg", "pos", "neu", "neg"]
ann2 = ["pos", "neu", "neg", "neg", "pos", "neu", "pos", "pos", "neg", "neg"]
cohen_kappa(ann1, ann2)       # 0.53: 70% raw agreement, but only moderate beyond chance

Reducing labelling cost

Technique Idea
Active learning Label the examples the model is least certain about (uncertainty sampling), or most diverse; often reaches target accuracy with a fraction of the labels
Weak supervision Write noisy labelling functions (rules, keyword lists, heuristics, other models); combine them with a label model (Snorkel)
Semi-supervised / self-training Train on labels, pseudo-label confident unlabelled examples, retrain
Transfer learning Start from a pre-trained model; few labels needed (chapter 163)
LLM-assisted labelling An LLM pre-labels; humans review and correct; measure LLM–human agreement on a gold set before trusting it; watch for systematic bias
Programmatic data generation Synthetic examples for rare classes, with human spot checks

Label noise

Some fraction of labels are wrong in nearly every dataset (well-known benchmarks contain measurable label errors). Effects: models learn the noise; evaluation is distorted. Mitigations: multiple annotators with adjudication, confident learning (find examples where a cross-validated model confidently disagrees with the label; library cleanlab), noise-robust losses, and reviewing the highest-loss training examples.

Deduplication

Duplicates cause:

  • Leakage: the same (or nearly the same) example in train and test inflates scores.
  • Memorisation and bias: models over-weight repeated content; LLMs regurgitate duplicated text verbatim.
  • Wasted compute.

Levels:

  1. Exact: hash normalised content (SHA-256 of lower-cased, whitespace-collapsed text; perceptual hashes for images).
  2. Near-duplicate: MinHash + locality-sensitive hashing (LSH): represent a document by its set of word shingles (n-grams); the probability two MinHash signatures agree on a position equals their Jaccard similarity |A ∩ B| / |A ∪ B|; LSH bands bucket likely-similar documents so you avoid comparing all pairs. SimHash for Hamming-distance near-duplicates.
  3. Semantic: embed and cluster (chapter 159); remove items within a cosine threshold (SemDeDup).
documenttext shingles5-gram set MinHash sig128 values 32 bands × 4hash → bucket same bucket →candidate pair P(signatures agree at one position) = Jaccard(A, B) P(candidate) = 1 − (1 − s⁴)³² : steep S-curve around s ≈ 0.42 verify candidates exactly; remove all but one per cluster
Near-duplicate detection with MinHash and locality-sensitive hashing. Each document becomes a set of shingles; many hash functions produce a short signature whose agreement rate estimates Jaccard similarity. Signatures are split into bands, and documents that share any identical band land in the same bucket and become candidate pairs, so only a tiny fraction of all pairs is ever compared exactly.
Python
import hashlib, re

def shingles(text, n=5):
    toks = re.findall(r"\w+", text.lower())
    return {" ".join(toks[i:i + n]) for i in range(max(1, len(toks) - n + 1))}

def minhash(sh, num_perm=128):
    sig = []
    for i in range(num_perm):                       # one salted hash per "permutation"
        sig.append(min(int.from_bytes(hashlib.blake2b(f"{i}:{s}".encode(), digest_size=8).digest(), "big")
                       for s in sh))
    return np.array(sig, dtype=np.uint64)

a = "The quick brown fox jumps over the lazy dog near the river bank today"
b = "The quick brown fox jumps over the lazy dog near the river bank this morning"
c = "Completely different sentence about training large language models efficiently"
A, B, C = shingles(a), shingles(b), shingles(c)
jac = len(A & B) / len(A | B)
est = np.mean(minhash(A) == minhash(B))
round(jac, 2), round(est, 2), np.mean(minhash(A) == minhash(C))   # 0.75, ≈ 0.74 (estimate), 0.0

At scale use libraries (datasketch in Python, text-dedup, Rust implementations in data pipelines such as those used to build open pre-training corpora).

Sampling

  • Random sampling for unbiased estimates; stratified sampling to keep class or segment proportions (rare classes in test sets).
  • Class imbalance for training: class weights in the loss; oversampling the minority (with care: duplicates before splitting leak); undersampling the majority; SMOTE-style synthetic samples (works for some tabular problems, rarely better than class weights with GBDTs); focal loss. Then recalibrate probabilities, because resampling shifts them.
  • Importance sampling / reweighting when training distribution differs from deployment.
  • Data mixtures for LLMs: proportions of web, code, books, math, multilingual data, often with upsampling of high-quality sources (chapter 158).
  • Reservoir sampling for uniform samples from a stream of unknown length.
Python
def reservoir_sample(stream, k, rng):
    sample = []
    for i, item in enumerate(stream):
        if i < k: sample.append(item)
        else:
            j = rng.integers(0, i + 1)          # keep item with probability k/(i+1)
            if j < k: sample[j] = item
    return sample

Leakage

Leakage is information in training (or evaluation) that wouldn't be available at prediction time, or that ties test examples to training examples. It produces models that look excellent offline and fail in production.

Leakage type Example Detection / prevention
Target leakage Feature "account_closed_date" when predicting churn; "treatment given" when predicting diagnosis Ask for every feature: is it known at prediction time? Suspiciously high importance
Temporal leakage Random split on time series; aggregates computed over the full period Time-based splits; point-in-time (as-of) joins
Train–test contamination Duplicates/near-duplicates across splits; same patient in both; benchmark text in LLM pre-training data Dedup across splits; group splits; n-gram overlap checks for LLM benchmarks
Preprocessing leakage Scaler, imputer, target encoder or feature selection fitted on all data Pipelines fitted inside CV folds
Label proxies ID numbers or file paths correlated with labels; image watermarks; scanner type in medical images Inspect feature importance and saliency; ablate suspect features
Evaluation leakage Tuning many times on the test set Locked test set; fresh holdout
Python
# A quick leakage smell test: a single feature that alone predicts the label almost perfectly
from sklearn.model_selection import cross_val_score
from sklearn.tree import DecisionTreeClassifier
def single_feature_auc(df, target):
    out = {}
    for col in df.columns.drop(target):
        X = df[[col]].fillna(-999)
        out[col] = cross_val_score(DecisionTreeClassifier(max_depth=3), X, df[target],
                                   cv=5, scoring="roc_auc").mean()
    return pd.Series(out).sort_values(ascending=False)   # investigate anything near 1.0

Versioning and lineage

You can't reproduce a model without the exact data it was trained on. Data versioning gives immutable, addressable dataset snapshots; lineage records how each dataset and model was produced.

Tool Approach
DVC Git for metadata (.dvc pointer files with content hashes), object storage for data; pipelines with cached stages
lakeFS Git-like branches, commits and merges over an object store
Delta Lake / Apache Iceberg / Hudi Table formats with snapshots, time travel (VERSION AS OF), schema evolution
Hugging Face Datasets Hub Git-LFS/Xet-backed dataset repos with dataset cards
MLflow / W&B Artifacts Log dataset versions as inputs to runs, linking data → model
OpenLineage / Marquez, DataHub Cross-system lineage graphs: which job read which table, produced which output
Shell
# DVC: version a dataset alongside code
dvc init
dvc add data/train.parquet                 # writes data/train.parquet.dvc (hash pointer)
git add data/train.parquet.dvc .gitignore && git commit -m "train set v12"
dvc remote add -d store s3://ml-data/dvc && dvc push
git checkout v11 && dvc checkout           # restore the exact data of an older version
SQL
-- Iceberg / Delta time travel: train on exactly the snapshot recorded with the model
SELECT * FROM training.events FOR VERSION AS OF 4815;        -- Iceberg (Spark/Trino syntax)
SELECT * FROM training.events VERSION AS OF 12;              -- Delta Lake

Document datasets with dataset cards / datasheets: purpose, sources, collection process, licences, preprocessing, known biases and gaps, intended uses and out-of-scope uses, PII handling, and maintenance plan.

Data pipelines at LLM scale

Pre-training and fine-tuning corpora follow the same principles at larger scale:

  1. Collect: web crawls (Common Crawl), code (with licence filtering), books, papers, curated domains.
  2. Extract: HTML → text (trafilatura, resiliparse), PDF parsing, code file filtering.
  3. Filter: language ID, quality heuristics (length, symbol ratios, repetition), model-based quality classifiers, toxicity and PII filters, removing boilerplate.
  4. Deduplicate: exact URL/content hashes, MinHash near-dedup, semantic dedup.
  5. Decontaminate: remove overlap with evaluation benchmarks (n-gram matching) so scores remain meaningful.
  6. Mix and tokenize: choose source proportions; tokenize into shards (chapter 155).
  7. Document provenance, licences and opt-outs.

Fine-tuning data (instructions, conversations, preferences) is much smaller and quality-dominated: a few thousand excellent, diverse, correctly formatted examples often beat hundreds of thousands of noisy ones (chapter 163).

  • PII: detect and remove or mask (names, emails, phone numbers, IDs) with tools such as Presidio; minimise what you collect; apply retention limits.
  • Consent and purpose limitation: GDPR, India's DPDP Act and similar laws restrict reusing personal data for new purposes such as model training without a lawful basis.
  • Licences and terms: web content, code and datasets carry licences; respect robots.txt and opt-out signals; track provenance per source.
  • Differential privacy for formal guarantees on aggregate statistics or model training (DP-SGD), with accuracy costs.
  • Synthetic data can help share patterns without records, but can still leak if generated from memorised data.

Lab: label noise, skew, validation and near-duplicates

pandas 3.0 and scikit-learn 1.9 on the lab machine. Data: scikit-learn's bundled load_digits (1,797 8×8 images; 60/40 stratified split) and a synthetic demand dataset (3,000 days: orders = 500 − 6 × °C + 40 × weekend − 60 × rain + noise).

Experiment 1: label noise

Training labels Test accuracy (scaled logistic regression)
clean (1,078 images) 96.8%
10% randomised 91.4%
30% randomised 87.2%
50% randomised 80.8%
clean, first half only (539) 94.7%

"Randomised" draws a new label uniformly from 0–9, so about 1 in 10 of those flips lands back on the right digit. Models are surprisingly robust to random noise (80.8% even with half the labels scrambled) because the noise averages out; systematic label errors (one annotator always confusing 4 and 9) are far more damaging, since they teach a consistent wrong rule. Tools such as cleanlab estimate which training labels are likely wrong from a model's own out-of-fold predictions.

Experiment 2: skew

Serving data MAE (orders/day)
°C, as in training 12.4
°F (upstream changed units) 86.3

GradientBoostingRegressor predicts a constant beyond the training range, so every °F day looked like the hottest day ever seen (fewest orders), capping the damage at 86 instead of something absurd. That's luck, not safety. The same failure appears with silently changed category codes, a feature computed with a different window in serving than in training, missing values encoded as 0 in one path and NaN in the other, or different text normalisation.

Experiment 3: batch validation

Python
lo, hi = ref[c].quantile(0.001), ref[c].quantile(0.999)
out = ((frame[c] < lo) | (frame[c] > hi)).mean()               # fraction outside training range
shift = abs(frame[c].mean() - ref[c].mean()) / ref[c].std()    # standardised mean shift
Text
°C batch: ok
°F batch: temp_c: 100% outside training range [20.0, 42.0]; temp_c: mean shifted by 9.0 standard deviations

Production versions add per-feature population stability index (PSI) or Kolmogorov–Smirnov tests, missing-value rates, category cardinality checks, and alert thresholds tuned to avoid noise. Run them on training data (to catch broken pipelines before a bad model is trained) and on served features (to catch skew and drift), and log served features so training sets can be built from what the model actually saw.

Experiment 4: near-duplicate detection

Pair 3-gram Jaccard
"…jeera rice and papad, ₹120" vs "…jeera rice & papad, ₹120" 0.81
"…and papad, ₹120" vs "dal tadka … papad - Rs 120" (lower-case) 0.72
exact hashes 0 duplicates found

All-pairs comparison is O(n²); MinHash approximates Jaccard with a short signature per document and LSH buckets candidates so only likely pairs are compared, which is how pre-training corpora with billions of documents are deduplicated. Normalisation before hashing (lower-case, Unicode NFKC, collapse whitespace, unify currency) catches many duplicates cheaply too.

Try it yourself

  1. Introduce systematic noise (relabel 30% of the 4s as 9s) and compare with 30% random noise.
  2. Use cleanlab (or out-of-fold predictions with a confidence threshold) to find the flipped labels and measure how many it recovers.
  3. Add PSI per feature to the validator and choose an alert threshold that ignores natural week-to-week variation.
  4. Implement MinHash with 64 permutations and LSH bands for 10,000 synthetic menu lines, and measure recall of near-duplicates against brute force.

Revision sheet: data engineering for AI

Key ideas

  • Data-centric ML: quality, coverage, consistency and labels often matter more than the model.
  • Ingestion: databases (CDC), events, files, APIs, web; point-in-time correctness (features "as of" prediction time).
  • Cleaning: types, units, outliers, missing values (and why they're missing), deduplication.
  • Labelling: guidelines, multiple annotators, agreement metrics, active learning, weak supervision, label auditing.
  • Validation: schemas, ranges, distributions, drift (covariate, label, concept), skew between training and serving.
  • Features: feature stores for consistent training/serving computation; offline and online stores.
  • Versioning and lineage: data versions (DVC, lakeFS, Delta/Iceberg time travel), recorded transforms, reproducible datasets.
  • Privacy and governance: consent, PII handling, retention, access controls.

Numbers to remember

  • Lab: 10% random label noise cost 5.4 points; halving clean data cost 2.1.
  • Lab: a unit change in one input raised MAE from 12.4 to 86.3 with no error raised.
  • Lab: exact hashing found 0 of 2 near-duplicate pairs that 3-gram Jaccard found (0.81, 0.72).

Pitfalls

  • Trusting labels without auditing; systematic annotator errors.
  • Features computed differently in training and serving.
  • Validation only at training time, never at serving time.
  • Random splits that put duplicates or the same entity on both sides.
  • Building training sets with information from after the prediction time.
  • No dataset versions, so results can't be reproduced.

Glossary

  • Concept drift: the relationship between inputs and target changes.
  • Covariate shift: input distribution changes, relationship stays.
  • PSI: population stability index, a drift score.
  • Point-in-time join: joining features as they were at each event's time.
  • Weak supervision: labels from heuristics and noisy sources, combined statistically.