Datasets and sampling
Training data as a sample from an unknown distribution.
We assume the data comes from an unknown probability distribution over pairs . Our dataset is a sample: examples drawn independently and identically distributed (i.i.d.) from .
Everything we learn is an estimate based on this sample. A bigger sample gives a better picture of ; a biased sample gives a distorted one. If you only collect data from one hospital, a model may fail at another with different patients or equipment — this is called distribution shift.
Good sampling practice: make sure the data represents the situations where the model will be used, watch for duplicates that cross the train/test boundary, and keep classes reasonably balanced or account for imbalance.
Formula to remember
Bias–variance decomposition
Expected error = squared bias + variance + irreducible noise.