Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

DA 3.3: Exploring data before you model it

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

60 minutes

Look before you leap

A made-up bike hire firm has twelve days of figures: the weather and how many bikes went out. The boss wants to predict next week.

Before anyone builds a prediction, a good analyst just looks. What is typical? What is odd? What seems to go with what? That first look has a name.

Key words

WordWhat it meansExample
VariableA column of data that can change from row to row.Temperature
Descriptive analyticsDescribes what happened.Average hires were 50 a day
Diagnostic analyticsLooks for why it happened.Wet days had fewer hires
Exploratory data analysisA first look at data to find its shape, odd values and links. Often called EDA.Summaries and groups
UnivariateLooking at one variable on its own.Hires per day
BivariateLooking at two variables together.Temperature and hires
MultivariateLooking at three or more variables together.Temperature, rain and hires
FeatureA column used to describe each row for an analysis.Temperature
Feature engineeringMaking a new, more useful feature from existing columns.Weekend or not, from the weekday
Feature selectionChoosing which features to keep and which to drop.Drop the day number

The cells students fill in are left blank in this preview.

By the end of this lesson

Note

I can tell descriptive from diagnostic analytics, explore data with one, two and many variables, and make and choose features.

Starter: what you already know

Have a go

Starter: what you already know

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

What happened, and why

Descriptive analytics says what happened: the average, the highest day, the count. Diagnostic analytics goes one step further and asks why.

Hires were low on day 11. Descriptive: only 15. Diagnostic: it was cold and it rained 12 millimetres.

Analysis with code, in a notebook

Programmatic analysis means you write code to do the analysis. The steps can be run again on new data, and another person can read them.

Analysts often use a notebook, such as Jupyter or Google Colab. A notebook is a page of cells. Some cells hold words. Some hold code, with its answer shown right below.

Try it: summarise with Python

Code: python
hired = [40, 44, 20, 48, 60, 85, 70, 18, 50, 55, 15, 90]

total = 0
for h in hired:
    total = total + h

average = total / len(hired)
print("Days:", len(hired))
print("Lowest:", min(hired), "Highest:", max(hired))
print("Average:", average)

# Try it: count the days with more than 50 hires.

Three ways to explore

Univariate. One variable at a time: its middle, lowest, highest and spread.

Bivariate. Two variables together: does hires go up with temperature?

Multivariate. Three or more together: does temperature still matter when it rains?

EDA also uses statistical analysis, such as averages and spread, which you meet in later lessons.

The lesson goes on

10 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.