Populations and Samples
The part and the whole.
Suppose you want the average height of every adult in a country. You can't measure millions of people. So you measure a few thousand, chosen at random, and use them to estimate the whole country. That's the central idea of statistics.

- Can't measure everyone
- Measure a random few
- Estimate the whole
Two words to know
The population is everyone, or everything, you care about. A sample is the part you actually measure. A number that describes the population, like its true average, is called a parameter. The same number computed from a sample is called a statistic. We use statistics to estimate parameters.
Random is the key
A sample only works if it's chosen fairly. If you measured heights only at a basketball club, your estimate would be far too tall. That's called sampling bias. In machine learning, your training data is a sample. If it's biased, your model will be biased too.
| key | value |
|---|---|
| Fair sample | chosen at random |
| Biased sample | basketball club heights |
| Training data | is a sample |
| Biased data | biased model |
Summary
The population is everything, the sample is what we measure, and a fair random sample lets us estimate the whole. Next, NumPy, the tool for working with numbers in Python.
Key takeaways- Population vs sample
- Parameter vs statistic
- Avoid sampling bias