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
| Word | What it means | Example |
|---|---|---|
| Variable | A column of data that can change from row to row. | Temperature |
| Descriptive analytics | Describes what happened. | Average hires were 50 a day |
| Diagnostic analytics | Looks for why it happened. | Wet days had fewer hires |
| Exploratory data analysis | A first look at data to find its shape, odd values and links. Often called EDA. | Summaries and groups |
| Univariate | Looking at one variable on its own. | Hires per day |
| Bivariate | Looking at two variables together. | Temperature and hires |
| Multivariate | Looking at three or more variables together. | Temperature, rain and hires |
| Feature | A column used to describe each row for an analysis. | Temperature |
| Feature engineering | Making a new, more useful feature from existing columns. | Weekend or not, from the weekday |
| Feature selection | Choosing 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 questionsYour 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
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.