Skip to content

Lesson 1 of 4

Free preview

The Palmer penguins problem

Frame the task and explore the data before modelling.

10 min 3-question quiz 3 guides to read next

The Palmer penguins dataset records 344 penguins of three species from three islands in Antarctica. Our task: predict the species from the bird's measurements. That is a three-class classification problem.

import pandas as pd

url = "https://raw.githubusercontent.com/allisonhorst/palmerpenguins/main/inst/extdata/penguins.csv"
penguins = pd.read_csv(url)

penguins["species"].value_counts()
penguins.groupby("species")[["bill_length_mm", "flipper_length_mm", "body_mass_g"]].mean()

You will see the classes are not balanced — there are many more Adélie than Chinstrap penguins — and that Gentoo penguins are clearly heavier with longer flippers. Adélie and Chinstrap are harder to tell apart, but their bills differ.

Before modelling, write down:

  • What would a useless model score? Always guessing "Adélie" is right about 44% of the time. Any real model must beat that.
  • Which features would be available in practice? Measurements, yes. The year column tells you when the bird was measured — it shouldn't help predict species, and if it does, that is a warning sign.

Check your understanding

3 questions · pass with 2 correct

1. Predicting a penguin's species from its measurements is what kind of problem?
2. Always guessing 'Adélie' is right about 44% of the time. Why note this?
3. If the year a bird was measured helps predict its species, what should you think?

You'll see your score; enrol to have it count towards your certificate.

Enrol for free to save your progress, unlock every lesson and earn a certificate.

Sign in to enrol

Further reading

Guides that go deeper on this lesson.