Topic 07

Kinds of Data

Concept

The delivery table is tidy: amounts and short words in neat columns. But Plateful's data doesn't stop at tables. There are tens of thousands of dish photos, a mountain of review texts, recordings of support calls. Iris asks the natural next question: can a model learn from those too, or only from spreadsheet material?

It can learn from all of it — under one strict condition. A model, as Chapter 1 left it, is a file of numbers plus a fixed calculation, and a calculation can chew numbers and nothing else. So every kind of data, however rich, must become numbers before a model can touch it. This page sorts the kinds of data and shows that single trick working underneath every one of them.

Four kinds of data — and what each becomes at the numbers border
Number
distance = 3.2 km → already a number; crosses as-is.
Category
cuisine = Thai → encoded as numbers before crossing.
Text
"Cold and late…" → words turned into lists of numbers.
Image
dish photo → a grid of pixels; each pixel is numbers already.

Numbers and Categories

Inside a table, features come in two flavors. Some are amounts you could do arithmetic on — distance, price, minutes since the restaurant opened. These are numerical features. Others are choices from a fixed set — cuisine type, city district, day of the week. Those are categorical features: there is no "average" of Thai and Italian, no sense in which Tuesday is twice Monday. Real tables mix both freely.

Neither flavor outranks the other. "Cuisine = Thai" can predict cooking time better than any amount in the table — a wok dish leaves the kitchen faster than a slow-roasted one. The difference is purely in handling: numbers are ready for the model as they stand, while categories need a conversion step first. That step is where this page is headed.

Text, Images, Audio

Beyond the table live the richer kinds. A review is a sequence of words, free-form and any length. A dish photo is a grid of colored dots — each dot is called a pixel, and a phone photo holds millions of them. A support call is a sound wave, measured thousands of times per second. Each of these carries far more information than a table cell, and far less order.

That combination — rich but unruly — kept these kinds at the edge of machine learning for decades. Models ate tables while photos sat in folders. What changed is a Chapter 8 story: deep learning is the machinery that finally made pixels and words practical to learn from. Here, what matters is that the same border rule applies to all of them.

Everything Becomes Numbers

Picture a customs form. Whatever you're shipping — a violin, a crate of mangoes, a wedding dress — it must be declared in the form's fixed fields before it crosses the border. The model's border works the same way, and its form has exactly one field type: numbers. Anything that wants in gets translated first; the field never bends to fit the cargo.

Each kind crosses in its own way. Numerical features walk through unchanged. Categories get encoded — assigned numeric representations, and with some care, because numbering the districts 1 through 12 would quietly teach the model that district 12 is somehow "more" than district 1. (There are standard ways around this; the details are the data team's craft, not yours.) Pixels are numbers already — a photo is numbers wall to wall. And words get turned into lists of numbers; the deep version of that trick, called embeddings, waits for Chapter 8. However it happens, the model on the far side only ever sees numbers.

What This Means for Your Ideas

This border explains half the data team's vocabulary. When you hear "encoding", "preprocessing", or "preparing the features", it is all the same activity: getting some kind of data into numeric shape without losing what matters about it. Nobody is being obscure — they are filling out customs forms.

It also gives you a question to ask about any product idea. "Can we use X to predict Y?" starts with: can X be turned into numbers without losing the thing that carries the signal? For Iris's idea of predicting complaints from review text, the answer is yes — text crosses the border routinely now — but the crossing costs more effort than table columns do. Usually the answer is yes at some cost; knowing that the cost exists, and where it lives, already puts you ahead of most people in the meeting.

Common Confusions
  • "Computers understand text and images directly." They compute with numbers, full stop. Text and images are converted into numbers first, every time — the conversion is just invisible from outside.
  • "Categorical data is worse than numerical data." Different, not worse. "Cuisine = Thai" can carry more signal than any amount in the table; it only needs an encoding step before the model can use it.
  • "Photos and text need a completely different kind of machine learning." Different preparation, same learning idea — examples in, patterns out. Deep learning (Chapter 8) is what made these kinds practical, not a separate field.
Why It Matters
  • "Encoding" and "preprocessing" stop being jargon: it is all the numbers border, and you now know why the border exists and what has to happen at it.
  • This page sets up Chapter 8's payoff — neural networks are the machinery that made pixels and words first-class citizens, and you'll arrive there already knowing why that was hard.

Knowledge Check

In Plateful's table, "city district" can be Old Town, Riverside, or Harbor. What kind of feature is it?

  • Numerical, because each district could be given a number
  • Categorical — a choice from a fixed set
  • A label, since the team chose to record it
  • Text data, because the values are written in letters

Before a model can learn from a dish photo, what must the photo become?

  • A written description of the dish, typed up by the data team
  • A grid of numbers — the color values of its pixels
  • A smaller image, since models cannot handle millions of pixels
  • A new row in the delivery-time table

Why does the data team talk about "encoding" categories instead of just numbering them 1, 2, 3…?

  • Because a model can only handle a small number of categories
  • Because categories should stay as words if at all possible
  • Because careless numbering invents a false order — as if district 12 were "more" than district 1 — and the model learns it
  • Because encoded categories always lose most of their information

Which kinds of data did deep learning turn from research problems into everyday model food?

  • Numerical and categorical columns in tables
  • Small datasets with only a few hundred rows
  • Images, text, and audio
  • Labels, which earlier models could not use

You got correct