Dataset Construction

Filtering, joining, labelling and feature creation each introduce bias or leakage. What one training example represents, and how sampling decides what the model can learn.

Dataset Construction
▶ lab

Raw data becomes a dataset through filtering, joining, labelling and feature creation. Each stage is a decision, and each decision can introduce bias or leakage that no model can undo.

Q · The model is trained on "the data". Which pipeline produced that data, what did each stage decide, and where could the answer or a bias have entered?
What Is One Example?

One row is one user, or one transaction, or one user-day, or one query-document pair. Choosing the grain decides the snapshot date, the label window, and what counts as a duplicate.

Q · A row in the training set represents what, as of when, with a label observed over which window — and does the same entity appear more than once?
Sampling Strategies

Random, stratified, temporal and group-based sampling each preserve a different property of the population. Which property matters depends on what the model will meet in production.

Q · The full dataset is too large or too skewed to use as is. Which subset can be trained on without teaching the model a population that does not exist?
Selection Bias

The dataset only contains the cases that reached the step where the label was recorded. Approved loans have repayment labels; declined ones do not. The model learns about the selected, and is deployed on everyone.

Q · Which process decided that these rows have labels and those do not, and is the model going to be used on the rows that were never labelled?
Survivorship Bias

The table contains the customers, companies or machines that are still here. The ones that failed were deleted, archived or never joined, and the model learns what survivors look like.

Q · Who is missing from the table because they did not make it, and is the model being asked to predict the very thing that removed them?
Class Imbalance
▶ lab

When positives are one in a thousand, always predicting negative is almost perfectly accurate and completely useless. Imbalance decides the metric, the split, the threshold, and whether the probabilities can be trusted.

Q · Positives are rare. Which metric, split and threshold still say something about the decision, and what does rebalancing the training data do to the model's probabilities?
Label Quality

The label is the thing the model is trained to reproduce. Noisy, delayed, drifting, disputed or machine-generated labels put a ceiling on everything downstream, and the ceiling is invisible in the metric.

Q · Where did the labels come from, how wrong are they, when did they arrive, and has what they mean changed since the first row was labelled?