Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Statistics  ›  Lesson

Descriptive Statistics

Descriptive Statistics 14 minDescriptive statistics summarise a dataset by its centre, its spread and its shape, and outliers affect some summaries far more than others.

Descriptive Statistics

Before training anything, an ML engineer looks at the data. A single summary line, "the average rent is 30", can hide the fact that most flats rent for much less and one penthouse drags the number up. Descriptive statistics are the few numbers that tell you what a column really looks like.

The rule

Centre, spread, shape: report all three, and check the outliers.

The five rents are 14, 22, 26, 16 and 22 thousand.

Centre, a typical value:

  • Mean: the sum divided by the count. 100/5=20100 / 5 = 20.
  • Median: the middle value once sorted. Sorted: 14, 16, 22, 22, 26, so the median is 22. With an even count, average the middle two.
  • Mode: the most frequent value, 22.

Spread, how far values stray:

  • Range: maximum minus minimum, 26−14=1226 - 14 = 12.
  • Variance: the average squared distance from the mean. The distances are −6,2,6,−4,2-6, 2, 6, -4, 2; their squares add to 36+4+36+16+4=9636 + 4 + 36 + 16 + 4 = 96, so the variance is 96/5=19.296 / 5 = 19.2. (Dividing by n−1=4n - 1 = 4 instead gives 24, the sample variance, used when the data is a sample from something bigger.)
  • Standard deviation: the square root of the variance, 19.2≈4.38\sqrt{19.2} \approx 4.38, back in thousands of rupees.
  • Quartiles split the sorted data into four equal parts; the gap between the first and third is the interquartile range.

Shape: is the data symmetric, or does a long tail stretch one way?

Now add flat F, a penthouse at 80. The mean jumps to 180/6=30180 / 6 = 30, but the median stays at (22+22)/2=22(22 + 22) / 2 = 22. The median is robust: one extreme value barely moves it. The mean, range and variance are all pulled hard by F. Before training, outliers like F should be investigated: a real penthouse, or someone typing 8 as 80?

The shortcut

Sort first, then guess and correct. Sorting gives the median, minimum, maximum, range and mode at a glance. For the mean, guess a round number, add up the deviations from it, and correct the guess by their average.

Mean of 14, 22, 26, 16, 22 without a big sumStep 1 of 4
  1. Guess

    Guess 20.

Drills

Answer fast — trust the rule.

quick drill

What is the median of the rents 14, 22, 26, 16, 22?

quick drill

Flat F renting for 80 joins the five. What is the new mean?

quick drill

Which measure of centre is barely moved by flat F?

quick drill

What is the variance of the five rents, dividing by n?

quick drill

Guessing 21 for the mean, the deviations sum to −5. What is the mean?

Remember

  • Centre, spread, shape: report all three, and check the outliers.
  • Shortcut: sort first; for the mean, guess and correct by the average deviation.
  • Trap: quoting the mean of skewed data as "typical".

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWhich centre should the agency quote?

A sixth flat renting for 80 thousand joins the five flats. Explain what happens to the mean and the median, which one the agency should quote as a 'typical rent', and what spread measure it should report alongside.