Data: turning the world into a table of numbers

Beginner6 min readPart 8 of 9

Rows, columns, features and labels: how information is arranged so that a computer can find patterns in it.

You hear the word data all the time: big data, data protection, data centre. But what is it? And why does every AI lesson start with it?

What is data?

Data is information that has been written down or recorded, usually as numbers or words. The temperature at noon is a piece of data. So is the number of goals in a match, your height, or a list of songs you have played.

You have already seen that computers turn everything into numbers. Data is where those numbers come from.

Where does data come from?

Data in a table

The most common way to arrange data is a table, like a spreadsheet. Here is a tiny one about fruit:

features: what we measurelabel: the answerWeight (g)RednessSweetnessFruit15097apple12019banana16086apple11008bananaonefruit
Each row is one example. The columns on the left are the features we measure. The column on the right is the label, the answer we want.

In a table:

Look at the numbers. The apples are red and a little less sweet. The bananas are not red and are sweeter. Can you spot the pattern? You did it by looking at the data. That is exactly what a learning computer tries to do.

Words become numbers too

What if a column holds words, like colours? The computer turns them into numbers too, using a code: for example, 0 for red, 1 for green and 2 for yellow. Or it uses a separate yes-or-no column for each colour. Remember: if it is in a computer, it is numbers.

Features: choosing what to measure

Which measurements are useful? To tell apples from bananas, colour helps a lot. Which shop sold it does not. Picking good features is an important skill. Too few, and you cannot tell the answer. Too many unhelpful ones, and the useful pattern gets lost in the noise.

Good data and bad data

A computer can only find patterns that are in the data you give it. So the quality matters:

People say garbage in, garbage out. You cannot get good answers from bad data.

Data and privacy

Data about people, such as names, photos and where they go, is personal and needs great care. Responsible sites collect as little as possible. This site collects no personal data at all. Your game progress stays in your own browser.

Where this leads

Imagine you have a table with thousands of rows and the labels filled in. Could a computer work out the rule for itself? That is the idea of machine learning, and it is where this path is heading.

Words to know

Data
Recorded information, usually as numbers or words.
Table
Data arranged in rows and columns, like a spreadsheet.
Feature
One kind of measurement, shown as a column.
Label
The answer we want to know for each example.
Example
One row of a table: one thing that was measured.

Check yourself

  1. In a table, what does one row stand for?

    Show the answer

    One example, for instance one piece of fruit.

  2. What is the difference between a feature and a label?

    Show the answer

    A feature is something we measure. The label is the answer we want to predict.

  3. Why is it a problem if all your examples are red apples?

    Show the answer

    The computer will never learn that apples can be other colours. Data needs variety.

  4. What does "garbage in, garbage out" mean?

    Show the answer

    If the data you give a computer is poor, the answers it gives will be poor too.