Why does AI need statistics
Say you have a hundred test scores, or a thousand height measurements. Looking at them one by one makes your head spin. But what if two numbers could sketch the whole picture? Just knowing roughly where the middle is and how spread out the values are lets you see the shape of the data at a glance. That is the eye of statistics, and it is the first eye AI uses when it reads data.
Where is the middle? The mean
In the last lesson we said a machine finds patterns in examples. To do that, it first has to be able to read what the data looks like. Plot the data as points on a number line, and the more points there are, the harder it is to take them in at a glance.
So the first question is roughly where these points sit. The most common way to find the middle is the mean, or average: add up all the values and divide by how many there are. If every point carried the same weight, the mean is the spot where the number line would balance perfectly level.
Tap the point choices one at a time to add them to the group. Each time a point is added, the mean marker moves to the new balance point.
Each time a point was added, the mean marker followed the balance point. When points crowd to the right, the mean is pulled to the right too. That is why the mean is good at telling you roughly where the data sits.
But the mean alone misses something. Even with the same middle, the way the points are laid out can be completely different.
How spread out? The spread
Here are two groups. Both have exactly the same mean. But one group huddles tightly around the middle, while the other is scattered widely. Since the means are equal, can we call them the same data?
No. In the tight group the values are all much alike, while in the wide group they are all over the place. How far the values stretch away from the middle like this is called the spread.
Tap the two groups in turn to compare them. The mean is the same, but the spread bars have different lengths.
The means were identical, but the spreads were plainly different. The spread bar in this picture shows the distance from the mean to the farthest point: short for the tight group, long for the wide one. In real statistics, the standard deviation, which measures how far points lie from the mean on average, is the measure used most often.
So the mean and the spread are a pair. Only by looking at where the middle is and how far the values scatter around it do you see the data properly.
One point far out: the outlier
The points are clustered together in one place, and the mean sits right in their middle. But what happens when a single point far off on its own comes in? A value standing apart from all the others like this is called an outlier.
Because the mean adds up every value and divides, even one faraway point counts in full. A single point can shift the middle a long way.
Tap to put the faraway point into the group. Because of that one point, the mean marker is yanked toward it.
Only one point came in, yet the mean was dragged from around thirty to nearly forty, even though all the other points stayed put. That is how looking at the mean alone can fool you.
Another kind of middle helps here: the median, the value that lands in the very center when the values are lined up in order of size. Even when a stray point comes in, it barely moves. If the mean and the median differ a lot, you can read that as a sign that an outlier is somewhere in the data.
Lots of data in two numbers
Now there are a great many points, far too many to look at one by one. But we have learned two numbers: the mean, which tells you the middle, and the spread, which tells you how scattered the values are.
With these two, whether there are a hundred points or a thousand, you can summarize the whole thing briefly: the middle is about here, and the scatter is about this much. This knack of boiling a lot down to a few numbers is where AI's handling of data begins.
Tap the compress button. The many points shrink down to just two numbers, the mean and the spread.
Countless points shrank into two numbers. Of course, shrinking loses something too: the exact position of each point disappears. Even so, the big character of the data remains, where it gathers and how widely it scatters.
These two numbers are used often in machine learning as well. For example, values with different units and sizes, such as height and weight, are each brought onto a similar scale by subtracting their own mean and dividing by their spread before they go into training. Doing this keeps one value from being treated as too important just because its numbers happen to be big.
Summary
To sum up: a lot of data is summarized with a few numbers. The mean is the middle, found by adding all the values and dividing by how many there are, and the spread tells you how far the values scatter from that middle. Even with the same mean, a different spread means completely different data.
A faraway outlier rocks the mean, so judge by looking at the median and the spread as well. Reading the middle and the scatter together: that is the eye of statistics.
Tap the key points in order to review. (the mean is the middle → the spread is how scattered the values are → same mean but different spread means different data → an outlier rocks the mean)
Now you have your first eye for reading data in numbers. A dizzying crowd of points has come into focus as two numbers, the middle and the scatter.
But the mean and the spread only summarize what has already happened. What will happen next cannot be known for certain. The next lesson, on probability, covers how to handle this uncertainty with numbers.