Chapter 9: Role of Data and Information

The canteen in a school in Jaipur sells idli, poha and lemon rice. Every afternoon, the cook writes on a slip of paper how many plates of each item were sold that day, and drops the slip into a box. By the end of the month the box is full of slips. Look at any one slip on its own and it tells you almost nothing — a few item names and a few counts, with no order and no meaning.

Then a teacher empties the box and arranges all the slips into a single table, one row for each day of the week. Suddenly a pattern shows up. Some days are busy, some are quiet, and one item sells far better than the others. The cook now knows what to prepare more of, and what to stop making.

Nothing new was added. The same numbers were simply organised until they began to mean something. That small jump — from a pile of numbers to something you can act on — is the idea this whole chapter is built around. See Fig. 9.0-1.

Diagram

Fig. 9.0-1 – on the left, a heap of loose paper slips with scattered item names and counts, labelled “raw data”; a curved arrow in the middle labelled “organise, add context”; on the right, the same values shown as a neat day-wise table with a small bar chart beside it, labelled “information”

NoteCuriosity Corner

Q1. If data and information are made of the same numbers, what exactly is the difference between them? Q2. A song, a photograph, a temperature reading and a text message are all very different things. Can all of them be called data? Q3. Sound reaches our ears as a smooth, continuous wave. How does a computer store something continuous when it can only hold 0s and 1s? Q4. Why does an artificial intelligence system need such a large amount of data, when an ordinary calculator needs none? Q5. What can go wrong later if the data collected at the start is the wrong data?

This chapter will answer each of these five questions as you read through it.

9.1 What Is Data?

Think about an ordinary school morning. The class teacher marks who is present and who is absent. The sports teacher notes down how long each student took to run one round of the ground. The lab assistant writes the room temperature in a register before the practical begins. None of these people are trying to prove anything yet. They are simply recording what happened.

Everything they wrote down is data — raw facts and figures that have been collected but not yet made sense of. Data is what you have before anyone has studied it, arranged it or drawn a conclusion from it.

NoteDefinition

(Data is raw, unprocessed facts and figures that have been collected and can be stored and analysed later.)

Data comes in many forms

It is easy to assume that data means numbers. It usually does not stop there. A voice note is data. A photograph of a classroom noticeboard is data. The names in the attendance register are data. A reading from a thermometer is data. All of them are recordings of something real, kept in a form that can be stored and studied later. Fig. 9.1-1 shows a few everyday sources feeding into the same idea.

Diagram

Fig. 9.1-1 – four small labelled sources on the left — a thermometer, an attendance register page, a mobile phone camera, and a microphone — with arrows all pointing into one common box in the centre labelled “DATA (raw facts, not yet organised)”

Data also arrives in two ways. Sometimes a person records it by hand, the way a shopkeeper writes each sale in a notebook. Sometimes a machine records it on its own, the way a step counter in a watch keeps counting without being asked. The second kind can pile up very quickly, because a machine never gets tired of recording.

Raw data has no meaning yet

Here is the important part. Suppose you find a slip of paper with only 36.6 written on it. Is that a temperature in degrees Celsius? A distance in metres? The price of something? You cannot tell. The number is perfectly real, but on its own it carries no meaning, because nothing tells you what it measures, when it was recorded, or why.

That is true of raw data in general. It has no context, it may be in no particular order, and it does not answer a question by itself. Something has to be done to it first. That “something” is the subject of the next section.

Q. If raw data tells us nothing on its own, why bother collecting it at all?

A. Because you cannot get meaning without it. Data is the starting point — it is the material that gets organised into something useful later. Nothing can be worked out from facts that were never recorded.

One honest warning before we move on. Data is only as good as the care taken while collecting it. A reading noted down in the wrong column, a name spelt two different ways on two days, or a sensor left switched off for an hour all become part of the data and look exactly like everything else. Nobody can spot such mistakes later just by staring at the numbers, so careful collection matters far more than it seems at the time.

9.2 From Data to Information

Go back to the canteen slips from the start of this chapter. Every slip was genuine data. Yet as long as they lay in a box, nobody could answer the one question the cook actually cared about: what should be prepared more of tomorrow?

The slips only became useful once someone sorted them, put them in day order and looked at them together. What came out of that is called information — data that has been processed and organised so that it means something and can be used to decide, explain or plan.

NoteDefinition

(Information is data that has been processed, organised and given context so that it carries a clear meaning and can be used to make decisions.)

Notice that nothing was invented in between. The counts on the slips were the same before and after. Only their arrangement changed, and that was enough to turn a pile of numbers into an answer.

9.2.1 How Data and Information Differ

Students often treat the two words as the same thing, because both look like “stuff written down”. They are not the same. Data is the input; information is what comes out after that input has been worked on. Table 9.1 sets the difference out clearly.

Table 9.1 – Data vs Information | Feature | Data | Information | |—|—|—| | What it is | Raw, unprocessed facts and figures | Data that has been processed and organised | | Meaning | Carries no meaning on its own | Carries a clear, definite meaning | | Order | May be scattered, with no particular order | Structured and arranged on some sensible basis | | Context | Exists without any context; the same value can mean many things | Tied to one context or one question | | Purpose | The starting point for study | Used to decide, explain or plan | | Example | A list of counts with no labels | A day-wise table of plates sold in a school canteen |

The last row is worth reading twice. The same counts appear in both columns. What changes is that the second one tells you which day and what was counted.

Q1. If data and information are made of the same numbers, what exactly is the difference between them?

A. The difference is not in the numbers but in what has been done to them. Data is the raw recording — unorganised and without context, so it answers nothing by itself. Information is that same data after it has been cleaned, arranged and labelled with what it measures, so that it now answers a question. Data is the ingredient; information is the finished dish.

9.2.2 The Steps That Turn Data into Information

Turning data into information is not one single action. It is a sequence, and each step in it does one small job. Fig. 9.2-1 shows the whole path in order.

Diagram

Fig. 9.2-1 – a left-to-right flow of eight labelled boxes joined by arrows: Data collection → Data processing → Data storage → Data analysis → Contextualisation → Organisation → Presentation → Interpretation; the first box drawn beside a small heap of loose slips and the last box beside a person looking at a chart

Turning raw data into information Input: (raw data collected from one or more sources) Output: (information that answers a question) Steps:

1. Data collection: gather the raw facts from wherever they occur —
   registers, forms, sensors, files.
2. Data processing: clean the data — remove what is not needed, fix
   entries that are clearly wrong, and put everything into the same
   units and the same format.
3. Data storage: keep the cleaned data somewhere safe and easy to
   search, such as a file or a database.
4. Data analysis: study the stored data to find patterns, trends and
   values that stand out.
5. Contextualisation: attach the missing background — what was
   measured, when, where and in what unit.
9. Organisation: arrange the data on a sensible basis, such as by day,
   by class or by item.
7. Presentation: show the result as a table, a chart or a short report
   that a reader can take in quickly.
8. Interpretation: read what has been presented and draw a conclusion
   from it.

Why it works: (each step removes one reason the data could not be understood — mess, missing units, missing order, or poor display — until nothing is left in the way of the meaning.)

Walking through the steps once

Suppose the canteen slips for one week are emptied out and the counts of idli plates read: 24, 65, 42, 38, 55, 40. In that form the numbers are useless. Nobody knows which day is which, or even whether they are in day order.

Now add the context and the order. That is steps 5 and 6 of the method above, and the result is Table 9.2.

Table 9.2 – plates of idli sold in the school canteen, day by day, for one week | Day | Plates of idli sold | |—|—| | Monday | 42 | | Tuesday | 38 | | Wednesday | 55 | | Thursday | 40 | | Friday | 65 | | Saturday | 24 |

The table shows the same six counts, but each one is now attached to a day, and the column heading says what was counted. Friday stands out as the busiest day and Saturday as the quietest — and Saturday being a half day explains why. That explanation is step 8: interpretation.

A single summary figure often makes a table easier to talk about, so let us work one out.

average number of idli plates sold per day

Given: (plates sold on six days — 42, 38, 55, 40, 65 and 24)

Find: (the average number of plates sold per day during the week)

Working: (add all six counts: 42 + 38 = 80; 80 + 55 = 135; 135 + 40 = 175; 175 + 65 = 240; 240 + 24 = 264. So the total is 264 plates over 6 days. Then divide the total by the number of days: 264 ÷ 6 = 44.)

(44 plates per day)

The average is \(\text{average} = \dfrac{\text{total of all values}}{\text{number of values}}\), where the total is the sum of the daily counts and the number of values is the number of days counted. One number now stands in for the whole week, which makes it easy to compare this week against the next.

Q. Does collecting more data always give better information?

A. No. If the extra data is careless, repeated or about the wrong thing, it only makes the analysis harder and can point to a wrong conclusion. Well-collected data about the right thing beats a large heap of poor data.

9.3 Types of Data

A canteen register, a song saved on a phone, a photograph of the school gate and a message to a friend are all data, as Section 9.1 showed. But a computer cannot treat them in the same way. Counting plates of idli and playing back a song need very different handling.

So data is sorted into types, and the type tells you how the data will be stored and what can sensibly be done with it. The four types you need to know are audio, visual, numeric and text data.

Before we look at each one, there is a small puzzle to settle. A computer stores everything as 0s and 1s. Sound, however, does not arrive in steps — it is a smooth, continuous wave, and so is the light falling on a camera. Data that varies smoothly like this cannot be written down as 0s and 1s directly. It first has to be measured at regular moments, and each measurement written as a number. That conversion happens inside the microphone or camera circuit, before the data ever reaches a file.

9.3.1 Audio Data

Audio data is sound stored in a form a computer can hold — a recorded song, a voice note, or the beep a machine makes.

To store a sound, the recording device measures the strength of the sound wave over and over again, thousands of times every second. Each measurement is called a sample, and each sample is stored as a number. Play the numbers back in the same order, at the same speed, and the ear hears the original sound again. See Fig. 9.3-1.

Diagram

Fig. 9.3-1 – a smooth sound wave drawn across the page, with evenly spaced vertical dotted lines meeting it; a small dot marked at each meeting point and a short column of numbers written below, labelled “each sample stored as a number”

How many samples are taken every second is called the sampling rate, and it is measured in hertz (Hz), which simply means “per second”. Music on an audio CD, for example, uses the long-standing standard of 44,100 samples per second. The number of bits used to write down each single sample is called the bit depth; more bits allow a sample to be recorded more finely.

audio data What it is: sound stored as a long list of numbers, one for each sample. How it works: the microphone measures the sound wave at fixed intervals; each measurement becomes a number, and the numbers are saved in a file such as .wav or .mp3. Used for: voice notes, songs, and the voice commands a phone assistant listens to. Watch out: sampling only takes measurements at fixed moments, so whatever happened between two samples is lost. A low sampling rate makes a recording sound dull or rough.

Q3. Sound reaches our ears as a smooth, continuous wave. How does a computer store something continuous when it can only hold 0s and 1s?

A. It does not store the whole smooth wave. It measures the wave’s strength thousands of times a second and stores each measurement as a number, written in binary as 0s and 1s. Played back quickly enough, this closely spaced set of measurements sounds like the original wave, even though the stored copy is really a long list of separate values.

9.3.2 Visual Data

Visual data is data you look at — photographs, drawings, screenshots and video.

A digital image is built out of tiny coloured squares. Each square is a pixel, the smallest unit of an image, and it holds the colour at that one spot. Millions of pixels placed side by side make a picture your eye reads as smooth. Fig. 9.3-2 shows what happens when you zoom far into one.

Diagram

Fig. 9.3-2 – a small photograph of a school building on the left, with a square region magnified on the right to reveal a grid of individual coloured squares, one square outlined and labelled “one pixel”

The resolution of an image is how many pixels it contains, usually written as width × height. A higher resolution image holds more detail, but it also takes up more storage space.

how many pixels are in a Full HD image

Given: (an image of resolution 1920 × 1080 pixels)

Find: (the total number of pixels in the image)

Working: (multiply the width by the height: 1920 × 1080. Break it up — 1920 × 1000 = 1,920,000 and 1920 × 80 = 153,600. Add them: 1,920,000 + 153,600 = 2,073,600.)

(2,073,600 pixels)

An image file also carries metadata — extra details stored alongside the picture itself, such as its size in pixels, the date it was taken and the camera settings used. Metadata is data about the data.

Video is visual data with one addition. A video is a run of still images shown quickly one after another, and how many are shown each second is the frame rate, measured in frames per second (fps). Films are commonly shot at 24 fps and much everyday video at 30 fps. Because a video holds so many images, it needs far more storage and far more processing power than a single photograph.

Photographs and video of people are personal. A face can identify someone, and metadata can quietly reveal when and where a picture was taken. Never collect images of classmates, staff or visitors for a project without telling them clearly and getting their permission, and never share such images outside the purpose they were collected for.

9.3.3 Numeric Data

Numeric data is data made of numbers that stand for quantities — marks, temperatures, counts of plates sold, the price of a notebook, the time taken to run a round of the ground.

This is the easiest type to work with, because arithmetic applies to it directly. Numeric values can be added, averaged, sorted and compared, exactly as was done with the canteen counts in Section 9.2.2. Numeric data comes in two common shapes: whole numbers such as a count of 42 plates, and decimal numbers such as a temperature of 36.6 degrees Celsius.

treating every number as a quantity What goes wrong: roll numbers, phone numbers and pin codes are written with digits, so students add them up or take their average. An average roll number means nothing at all. The fix: before doing arithmetic, ask whether the number measures an amount or only names something. If it is a name written in digits, treat it as a label — you may count how many there are, but you should not add them.

9.3.4 Text Data

Text data is data made of letters, words and sentences — a student’s name in a register, a message, a page of a textbook, the answer someone types into a form.

A computer cannot store a letter as a letter. Every character is stored as a number using an agreed code, so that a file written on one machine reads correctly on another. The older code is ASCII (American Standard Code for Information Interchange), which covers English letters, digits and common punctuation marks. The wider code used today is Unicode, which also covers scripts such as Devanagari, Tamil and Bengali, so text in Hindi or Marathi can be stored just as easily as text in English.

Plain text, with no styling at all, is usually kept in files such as .txt or .csv. Text that carries formatting — headings, bold, page layout — is kept in files such as .docx or .pdf.

Q. Why is text data harder for a computer to work with than numeric data?

A. Because meaning in text does not follow from the characters. “Not bad” and “bad” share most of their letters but say opposite things, and a computer has no arithmetic that gets from one to the other. Numbers carry their meaning directly.

Q2. A song, a photograph, a temperature reading and a text message are all very different things. Can all of them be called data?

A. Yes. Anything recorded in a form that can be stored and studied later is data. The song is audio data, the photograph is visual data, the temperature reading is numeric data and the message is text data. They look different to us, and each is stored differently, but inside the computer every one of them ends up as 0s and 1s.

9.4 Why Data Is Pivotal to Artificial Intelligence

Some problems can be solved by writing down a rule. If a school says a student passes when marks are 33 or more, a programmer can write that rule once and the program will be right every time. No data is needed beyond the rule itself and the marks of the student in front of it.

Now try to write a rule for reading handwriting. Everyone’s letter “a” is a little different — some are round, some are squeezed, some lean over. There is no sentence you can write that captures every possible “a” and rejects everything else. Nobody has ever managed it.

This is where artificial intelligence (AI) is used: for problems where the rule cannot be written out, but plenty of examples of the right answer exist. Instead of being given the rule, the program is given thousands of examples and works out for itself which patterns separate one answer from another.

How examples become a model

A very young child is not taught a definition of a cow. The child is shown cows — in fields, in pictures, in books — until the shape becomes familiar. An AI system is built in a similar way, though what happens inside is arithmetic, not understanding.

The examples are fed in, along with the correct answer for each one. The program adjusts its internal numbers a little at a time, so that its output moves closer to the correct answer across all the examples. This adjusting stage is called training, and what comes out of it is called a model.

NoteDefinition

(A model is the result of training a program on data — a set of internal values that turns a new input into a predicted output. It is judged on data it has never seen before, not on the examples it was trained on.)

Fig. 9.4-1 shows the whole path, from examples to a model that can handle something new.

Diagram

Fig. 9.4-1 – on the left, a stack of labelled examples (small handwritten letters each tagged with the correct letter) feeding into a box marked “training”; an arrow from training to a box marked “model”; below, a single new unseen handwritten letter entering the model box and an arrow leaving it marked “predicted letter”

Nothing in this picture works without the stack on the left. That is the point of this section: for an ordinary rule-based program, data is only what you feed in at the end; for an AI system, data is what the program is built out of in the first place.

What data does inside an AI system

Data is not used at one moment and then forgotten. It has several distinct jobs.

  1. Training the model. The examples are what the model learns its patterns from. Without them there is nothing to train on and no model at all.

  2. Finding useful features. Not every part of the data matters. Studying the data shows which parts actually separate one answer from another — in handwriting, the shape of the stroke matters and the colour of the ink usually does not.

  3. Recognising patterns. Once trained, the model matches a new input against the patterns found in the data and produces the answer those patterns point to.

  4. Improving the model. Fresh data collected later shows where the model is getting things wrong, and it can be trained again on the wider set so that it handles those cases better.

  5. Personalising. A system that suggests videos or shop items uses data about what a user has chosen before to decide what to place in front of them next.

Why so much of it is needed

A model can only recognise the kinds of examples it was trained on. Train it on neat handwriting alone and it will do badly on hurried handwriting, because it never saw any. So it is not just the amount of data that matters, but the variety — the training examples must cover the range of cases the model will actually meet.

Q4. Why does an artificial intelligence system need such a large amount of data, when an ordinary calculator needs none?

A. A calculator is given the rule for addition, so it needs nothing else. An AI system is used exactly where nobody can write the rule, so it has to find the pattern from examples instead. Finding a reliable pattern takes many examples covering many different cases, because the model can only handle situations similar to the ones it was trained on.

If the training data leaves out a group of people, the model works poorly for exactly that group. A bias is this kind of one-sidedness in the data, and it passes straight into the model’s outputs. Before training, check who and what the data covers, and add examples from the missing cases rather than assuming the model will manage.

Q. If a model gives a wrong answer, is the program at fault?

A. Often not. The usual cause is data — examples that were too few, too similar to each other, wrongly labelled, or missing the kind of case that came up. Fixing the data usually helps more than rewriting the program.

One honest limitation is worth stating plainly. A model does not check whether its answer makes sense; it computes the output its trained values point to, and it will do that just as confidently when the input is unlike anything in its training data. The safeguard is not in the model but in the data behind it, and in a person checking the results.

9.5 Identifying, Acquiring and Exploring Data

Section 9.4 showed that an AI system is built out of its data. That raises an obvious practical question: where does that data come from, and how do you know it is the right data?

The work happens in three stages, and they always run in this order. First you decide which data the problem needs. Then you go and get it. Then you look at what you actually got, before using it for anything. Fig. 9.5-1 shows the three stages together.

Diagram

Fig. 9.5-1 – three boxes joined left to right by arrows, each with a short question underneath: “Identify — which data would answer the question?”, “Acquire — where will it come from?”, “Explore — what does the data we collected actually look like?”

The collected data, once it is gathered together in one place, is called a dataset. Everything that follows in an AI project rests on this dataset, which is why these three stages come before any model is built.

9.5.1 Identifying the Data a Problem Needs

Start from the question, never from the data. Write the question down in one plain sentence, then ask what facts would be needed to answer it.

Suppose a school wants to reduce the food wasted in its canteen. The question becomes: how many plates of each item should be prepared tomorrow? Now the useful data almost lists itself — how many plates of each item were sold on each past day, which day of the week it was, and whether that day was a holiday, an exam day or a sports day.

Just as useful is knowing what to leave out. The names of the students who bought lunch, or their roll numbers, would not help answer this question at all. Data that does not help should not be collected, however easy it is to collect.

Q. How do you know a piece of data is relevant?

A. Ask what would change in your answer if that column were removed. If the answer would come out the same, the column is not doing any work and can be left out.

Q5. What can go wrong later if the data collected at the start is the wrong data?

A. Everything after it goes wrong too, and usually without any warning. A model trained on data that does not relate to the question will still produce confident-looking answers, because it can only match the patterns it was given. No amount of clever programming later can put in information the data never contained — the only fix is to go back and collect the right data, which costs far more time than getting it right at the start.

9.5.2 Acquiring the Data

Once you know what you need, you have to obtain it. There are four common sources, and most projects use more than one.

  1. Records that already exist. Attendance registers, library issue records, canteen sales books and exam mark sheets are all data a school already holds. This is the cheapest source, because the collecting has already been done.

  2. Surveys and forms. When the data does not exist yet, you ask for it — a printed form or an online form filled in by the people concerned. This gives exactly the fields you asked for, but only as honestly and carefully as people fill them in.

  3. Sensors and devices. A temperature sensor, a light sensor or a step counter records data by itself, at regular intervals, without anyone writing anything down. This suits any quantity that changes through the day.

  4. Public datasets. Governments and research bodies publish datasets for anyone to use. India’s open data portal at data.gov.in, for instance, carries datasets on rainfall, transport, health and much else. These are large and already cleaned up, but they were collected for someone else’s purpose, so they may not contain exactly the fields you want.

Collect only the fields your question actually needs, and nothing more. Every extra personal detail — a phone number, an address, a photograph — is something you then have to protect, and something that can harm a person if it leaks. Tell people what you are collecting and why, and remove names from a dataset when the question does not depend on who the person was.

9.5.3 Exploring the Data

Data almost never arrives clean. Before it is used for anything, you look through it — this stage is called exploring the data, and its whole purpose is to find problems while they are still cheap to fix.

Table 9.3 holds a short dataset from a temperature sensor placed in a school computer lab, which recorded one reading every hour.

Table 9.3 – hourly temperature readings from a sensor in a school computer lab | Time | Temperature (°C) | |—|—| | 09:00 | 24.5 | | 10:00 | 25.1 | | 11:00 | 26.0 | | 12:00 | (no reading) | | 13:00 | 27.2 | | 14:00 | 205.0 | | 15:00 | 27.0 | | 16:00 | 26.2 |

Four things are worth noticing, and each of them comes from a question you should ask of any dataset.

How much data is there? Eight time slots, but only seven readings. Knowing the size tells you whether there is enough to work with at all.

Is anything missing? The 12:00 reading is blank. A blank is not a zero — nothing was recorded, perhaps because the sensor lost power for a moment. You either leave that row out or note clearly that it is missing.

What is the normal range? The valid readings sit between 24.5 °C and 27.2 °C, which is a sensible range for a classroom.

Does anything look impossible? The 14:00 reading of 205.0 °C does. A room does not reach that temperature, and the readings on either side of it are close to 27 °C. This is almost certainly a fault — a loose wire, or the sensor being touched — and not a real measurement.

That last one matters more than it looks, as the following calculation shows.

what one faulty reading does to the average

Given: (the six valid readings 24.5, 25.1, 26.0, 27.2, 27.0 and 26.2 °C, plus the faulty reading of 205.0 °C)

Find: (the average temperature with the faulty reading left out, and with it included)

Working: (add the six valid readings: 24.5 + 25.1 = 49.6; 49.6 + 26.0 = 75.6; 75.6 + 27.2 = 102.8; 102.8 + 27.0 = 129.8; 129.8 + 26.2 = 156.0. Divide by 6: 156.0 ÷ 6 = 26.0. Now include the faulty reading: 156.0 + 205.0 = 361.0, spread over 7 readings, so 361.0 ÷ 7 = 51.57 correct to two decimal places.)

(26.0 °C without the faulty reading, and 51.57 °C with it — a figure no classroom ever reaches)

One bad value out of seven has pushed the average to roughly twice the true figure. Exploring the data is what catches it.

filling a missing value with zero What goes wrong: a blank cell is replaced with 0 so that the sums will run. The program now treats 0 °C as a real measurement and drags the average down. The fix: keep missing values marked as missing. Either leave those rows out of the calculation, or record clearly how they were filled, so anyone reading the result knows what was done.

Note the time and the reading from a thermometer in your classroom once every hour for one school day. Then look through your own table and answer the four questions above — how many readings, any missing, what range, anything impossible.

9.6 Data as a Precursor to the AI Project Cycle

Nobody builds a house by starting with the roof. There is an order — the ground is cleared, the foundation is laid, the walls go up, and only then does the roof make sense.

Building an AI system works the same way. The fixed sequence of stages it goes through, from first understanding the problem to checking whether the finished system actually works, is called the AI project cycle. Its stages are Problem Scoping, Data Acquisition, Data Exploration, Modelling and Evaluation.

You will study each of these stages closely later. What matters here is one thing: data comes before all of them and runs through all of them. That is what “a precursor to the AI project cycle” means — the data work is not one stage among five, it is the ground the whole cycle stands on. Fig. 9.6-1 shows this.

Diagram

Fig. 9.6-1 – five boxes arranged in a ring, labelled clockwise Problem Scoping, Data Acquisition, Data Exploration, Modelling, Evaluation, with an arrow from each to the next and a longer return arrow from Evaluation back to Data Acquisition; the centre of the ring holds a single box labelled “DATA” with short lines joining it to all five stages

What data does at each stage

Problem Scoping. This is where the problem is stated clearly. Knowing what data exists shapes what can sensibly be attempted — a question no available data could ever answer is not yet a workable project.

Data Acquisition. The data identified during scoping is collected, from the kinds of sources listed in Section 9.5.2. What can be obtained here fixes the limits of everything that follows.

Data Exploration. The collected data is examined for gaps, mistakes and odd values, and arranged so that its patterns can be seen. This is the checking work of Section 9.5.3, done before any model exists.

Modelling. The prepared data is used to train the model. The kind of data available also decides which method is suitable, since a method that expects numbers cannot be trained on photographs.

Evaluation. The model is tested on data it has not seen during training, to check whether it works on new cases rather than only on the examples it was shown.

Q. Why must a model be tested on data it has not already been trained on?

A. Because it was adjusted to fit the training examples, so doing well on those proves nothing. Only unseen data shows whether the model has picked up a pattern that holds generally, or has simply fitted itself to the examples it was given.

The cycle turns

Notice the return arrow in Fig. 9.6-1. Evaluation often shows that the model handles some cases badly, and the usual reason is that those cases were thin or absent in the data. The response is to go back and collect more, then work forward through the stages again.

So an AI project is rarely finished in one pass. Each turn of the cycle usually begins the same way — with more or better data.

starting at Modelling What goes wrong: the interesting-looking stage is Modelling, so a project jumps straight to it with whatever data happens to be at hand. The model trains, produces outputs, and looks like it is working. The fix: do the scoping, acquisition and exploration first. A model built on data that was never checked will produce answers that look convincing and are wrong, and nothing in the model itself will reveal this.

9.7 Summary

  1. Data is raw, unprocessed facts and figures that have been collected but not yet made sense of. On its own it has no context and answers no question.
  2. Data is recorded either by people, such as in a register, or automatically by machines and sensors.
  3. Information is data that has been processed, organised and given context, so that it carries a clear meaning and can be used to decide, explain or plan.
  4. The same values can be data at one moment and information at the next. What changes is the arrangement and the context added, not the values themselves.
  5. Data becomes information through a sequence of steps: data collection, data processing, data storage, data analysis, contextualisation, organisation, presentation and interpretation.
  6. The four types of data are audio, visual, numeric and text.
  7. Audio data is sound stored as a list of samples. The sampling rate is how many samples are taken each second, measured in hertz.
  8. Visual data covers images and video. A pixel is the smallest unit of an image, resolution is how many pixels an image contains, and metadata is the extra detail stored alongside the image. For video, the frame rate is how many frames are shown each second.
  9. Numeric data is numbers standing for quantities, which can be added, averaged and compared. Numbers used only as labels, such as roll numbers, should not be treated as quantities.
  10. Text data is letters and words, stored using a character code such as ASCII or the wider Unicode.
  11. An AI system is used for problems where the rule cannot be written down but examples of the right answer exist. It is trained on those examples, and the result of training is a model.
  12. Data is what an AI system is built out of. It trains the model, shows which features matter, supports pattern recognition, allows the model to be improved later, and lets a system personalise what it offers a user.
  13. The variety of the training data matters as much as the amount. A model handles only the kinds of cases it was trained on, and data that leaves a group out produces a model that is unfair to that group.
  14. Before any model is built, three stages of data work come first: identifying which data the question needs, acquiring it, and exploring what was actually collected.
  15. Data can be acquired from existing records, surveys and forms, sensors and devices, or public datasets. Only the fields the question needs should be collected.
  16. Exploring a dataset means checking its size, looking for missing values, checking the normal range, and spotting impossible values. A single faulty value can badly distort a result such as an average.
  17. The AI project cycle runs through Problem Scoping, Data Acquisition, Data Exploration, Modelling and Evaluation. Data comes before all of these stages and runs through every one of them.
  18. Evaluation uses data the model has not seen during training, and its result often sends the project back to collect more data, turning the cycle again.

9.8 Key Terms

  1. AI project cycle: the fixed sequence of stages an artificial intelligence project passes through — Problem Scoping, Data Acquisition, Data Exploration, Modelling and Evaluation.
  2. Artificial intelligence (AI): the building of systems that work out an answer from examples, used for problems where the rule cannot be written down directly.
  3. Audio data: sound stored in a form a computer can hold, as a long list of numbered samples.
  4. Bias: one-sidedness in a dataset, such as a group of people being left out, which passes into the model’s outputs and makes them unfair.
  5. Data: raw, unprocessed facts and figures that have been collected and can be stored and analysed later.
  6. Dataset: the collected data for a project, gathered together in one place.
  7. Frame rate: how many still frames of a video are shown each second, measured in frames per second (fps).
  8. Information: data that has been processed, organised and given context, so that it carries a clear meaning and can be used to make decisions.
  9. Metadata: extra details stored alongside a file describing the file itself, such as an image’s size in pixels, the date it was taken and the camera settings used.
  10. Model: the result of training a program on data — a set of internal values that turns a new input into a predicted output, judged on data it has not seen before.
  11. Numeric data: data made of numbers that stand for quantities, such as marks, counts or temperatures.
  12. Pixel: the smallest unit of a digital image, holding the colour at one spot.
  13. Resolution: how many pixels an image contains, usually written as width × height.
  14. Sampling rate: how many samples of a sound are taken each second while recording it, measured in hertz (Hz).
  15. Text data: data made of letters, words and sentences, stored using a character code such as ASCII (American Standard Code for Information Interchange) or Unicode.
  16. Visual data: data that is looked at, such as photographs, drawings, screenshots and video.

9.9 Objective Questions

  1. (The smallest unit of a digital image is called:)

    1. a sample
    2. a pixel
    3. a frame
    4. a byte
  2. (The number of samples taken from a sound wave each second is called the __________, and it is measured in hertz.)

  3. (State whether true or false: data and information mean the same thing, because both are made up of the same values.)

  4. (A school register holds a column of roll numbers. Which one of these is a sensible thing to do with that column?)

    1. Find the average roll number
    2. Add all the roll numbers together
    3. Count how many roll numbers there are
    4. Find the total of the roll numbers
  5. (Match each term in Column A with its correct meaning in Column B.)

    Column A Column B
    a. Resolution i. Details stored about a file, such as the date it was taken
    b. Frame rate ii. How many pixels an image contains
    c. Metadata iii. How many samples of a sound are taken each second
    d. Sampling rate iv. How many still frames of a video are shown each second
  6. (Data that is made of letters, words and sentences, and is stored using a character code such as ASCII or Unicode, is called __________ data.)

  7. (A sensor in a school hall recorded these four temperature readings: 22.8 °C, 23.4 °C, 180.0 °C and 24.1 °C. Name the reading that could not be a real measurement of a hall, and say in one line how you can tell.)

9.10 Concept Questions

  1. (Define data and define information in one sentence each, and then state one clear difference between them.)

  2. (Give one example each of audio data, visual data, numeric data and text data taken from an ordinary school day.)

  3. (A computer can hold only 0s and 1s, but sound reaches a microphone as a smooth wave. Explain what the recording device actually stores, and what is lost in doing so.)

  4. (A shopkeeper says, “I have four years of bills in that cupboard, so I already have information about my shop.” Explain why the shopkeeper is not correct, and describe what would have to be done to those bills first.)

  5. (The number of books issued from a school library on five days was 18, 25, 30, 22 and 25. Work out the average number of books issued per day, showing your working. Then work out what the average would become if the last value had been wrongly typed as 250 instead of 25, and say what this shows about checking data before using it.)

  6. (Explain why the variety of the training data matters as much as the amount of it. Support your answer with one example of what can go wrong when a group of people is missing from the data.)

9.11 Case-Based Questions

  1. (A school library wants to work out how many copies of its most popular book it should keep on the shelf. A student team is asked to prepare the data. The team writes down how many copies of that book were issued on each day of one week, and produces the table below.)

    Day Copies issued
    Monday 12
    Tuesday 15
    Wednesday (no entry)
    Thursday 14
    Friday 1400
    1. The team also wants to record the name and class of every student who borrowed the book. Explain whether this data is relevant to the question the library asked, and give a reason.
    2. Two values in the table need attention before any calculation is done. Identify both, say what is wrong with each, and state how each should be handled.
    3. Name the stage of the AI project cycle in which the work described in part (b) belongs.
  2. (A shop in a small town wants a system that suggests which items to restock each week. A team collects two things: the shop’s sales records for the past year, and photographs taken of customers standing at the billing counter.)

    1. Of the two sources collected, state which one is relevant to the question being asked, and explain why the other one is not.
    2. State one problem with collecting photographs of customers in this way, and describe what the team should do instead.
    3. The team suggests skipping straight to building the model, since the sales records are already available in the billing computer. Explain why this is a poor idea.