Chapter 02 of 16: Write useful observations

What counts as an example?

Arun MalikSeriesAIFoundations
Table of Contents
Builds on chapter 1. Specific dependencies are in the concept map.

We want to estimate preparation time. Before choosing a model, we need to decide what we will write down. A pile of receipts is not yet a useful lesson for a machine.

Give each observation a shape

Data is recorded information. It might be a number, a photograph, a sound recording, or a line of text. In our cafe, a note saying an order contained two sandwiches is data.

An example is one case used for learning or checking a model. For our task, one example is one completed order, with the information available when it arrived and its eventual preparation time. Choosing the unit matters: two lines from one receipt should not accidentally become two independent orders.

A dataset is a collection of examples organized for a task. Picture a notebook with one row per order. Rows need not always be tables; a folder of labeled fruit photographs can also be a dataset.

DatasetOne card is one completed order. The collection is a dataset.Order AOrder BOrder CInputs beside recorded answers
  1. Toy rowSandwiches: 2. Queue ahead: 3. Recorded preparation time: 8 minutes.
One card is one completed order. The collection is a dataset.

Separate the clues from the answer

A feature is an input property a model can use. The number of sandwiches and the queue length might be features for predicting preparation time. We choose clues that will actually be available when the next order arrives.

A target is the quantity or category we want the model to predict. Here it is preparation time in minutes. A label is the recorded target value attached to an example. For one order, the label might be 8 minutes. People also use “label” for a category such as apple, and sometimes use label and target interchangeably.

The notebook is like a set of practice questions with answers. The features are the question; the label is the answer supplied during training. When making a new prediction, we do not secretly include the answer among the clues.

Labeling is the work of attaching target values to examples. A person might identify fruit in photos; a clock might supply elapsed minutes. Either process can make mistakes. If two people disagree about when an order is “ready,” settle that definition before collecting thousands of timings.

A tidy notebook can still mislead

Data quality means how well recorded information serves the intended task. Check units, missing values, duplicates, and incorrect labels. Eight seconds and eight minutes must not quietly share a column.

Representative data includes the kinds of situations the model is expected to face. A notebook containing only quiet mornings will not teach us much about a busy lunch queue. More copies of morning orders do not repair that gap.

SamplingMore copies of a narrow sample do not add missing kinds of situations. Clean data and representative data are different requirements.Repeated examplesDifferent cases
More copies of a narrow sample do not add missing kinds of situations. Clean data and representative data are different requirements.

Data bias is a systematic skew in what is collected or how it is recorded. If a camera is poor at showing dark fruit skins, errors may cluster around those examples. Bias can also come from labels or later design choices. A neat spreadsheet is no promise of fair treatment.

Privacy concerns how information about people is collected, used, shared, and retained. We need preparation times, not customers' home addresses. Leave unnecessary personal details out, restrict access to what remains, and decide when to delete it. Removing names alone may not make a record anonymous.

Private notebookCollect the fields the task needs. Omit unnecessary personal information; control access and retention for what remains.Timing notebookOrder sizeElapsed minutesNo home address
Collect the fields the task needs. Omit unnecessary personal information; control access and retention for what remains.
Look at the clues: should “time order finished” be an input?

No. It would reveal information we do not have when the order arrives. Record it to calculate the training label, but do not feed it to a model that must predict earlier.