Year 9 · Spring 1

Data Science and AI · Lesson 5 of 5

How machine learning learns, and where bias comes from

UnpluggedTopic 18 Data, spreadsheets and AI

Year 9 · Data Science and AI · Lesson 5 of 5

You will learn to

  • Explain the difference between a human writing the rules and machine learning, which finds rules from examples.
  • Write a rule that sorts 20 example cards, then test it on cards it has not seen.
  • Explain why the rule changed when the examples changed.
  • Explain how biased training data leads to unfair answers, with an example.

Year 9 · Data Science and AI · Lesson 5 of 5

Success criteria

You have got it when you can say:

  • I can write a sorting rule from the examples and test it on new cards.
  • I can say what went wrong when our rule met an unusual card.
  • I can give one real example where AI bias could be unfair to people.

Year 9 · Data Science and AI · Lesson 5 of 5

Retrieval starter

Questions from before. Write your answers, then show them.

  1. Last lesson

    The numbers 3, 9, 4, 4, 10. What is the median?

    A 6B 4C 9

    B. 4

  2. Last unit

    A fake bank email asking you to log in is…

    A PhishingB A wormC Brute force

    A. Phishing

  3. Earlier this year

    =B2*C2 in D2 is filled down to D5. What is in D5?

    A =B5*C5B =B2*C2C =E2*F2

    A. =B5*C5

Year 9 · Data Science and AI · Lesson 5 of 5

Key words (1 of 2)

Machine learning
The computer finds rules itself from labelled examples.
Formula
A spreadsheet calculation. Always starts with =.
Function
A subroutine that returns a value.
Record / field
One row in a database table: everything stored about one thing.

Year 9 · Data Science and AI · Lesson 5 of 5

Key words (2 of 2)

Primary key
A field whose value is unique for every record.
SQL
Structured Query Language: asks databases questions.

The explanation · step 1 of 1 · part 1 of 2

AI and machine learning

  • Normal programming: a human writes the rules.
  • Machine learning: you give thousands of labelled examples; the computer finds the rules itself.
  1. Collect training data.
  2. Train: adjust until guesses are mostly right.
  3. Test on examples it hasn't seen.
  4. Use it on new data.

The explanation · step 1 of 1 · part 2 of 2

AI and machine learning (continued)

!Watch out

Bias: a model learns whatever is in its examples, including unfairness. Unfair data in, unfair decisions out.

e.g.Example

Chatbots predict likely next words. Very useful, but they can be confidently wrong, so check them.

Year 9 · Data Science and AI · Lesson 5 of 5

Quick quiz · 1 of 3

Which field makes a good primary key?

  1. A FirstName
  2. B House
  3. C StudentID

C. StudentID

It is unique for every student and doesn't change.

Year 9 · Data Science and AI · Lesson 5 of 5

Quick quiz · 2 of 3

To show change over time, use a…

  1. A Line chart
  2. B Pie chart
  3. C Scatter graph

A. Line chart

A line joins the points in time order, so you see the trend.

Year 9 · Data Science and AI · Lesson 5 of 5

Quick quiz · 3 of 3

SELECT FirstName FROM Students WHERE Year = 8; returns…

  1. A Every field of every student
  2. B Only the first names of Year 8 students
  3. C The number of Year 8 students

B. Only the first names of Year 8 students

WHERE keeps the Year 8 records. SELECT keeps only the FirstName field.

Year 9 · Data Science and AI · Lesson 5 of 5

Exit ticket

Answer on paper before you go. Then check.

  1. A face-recognition model works badly on faces unlike its training photos. This is…

    A OverflowB A syntax errorC Bias from unrepresentative training data

    C. Bias from unrepresentative training data The model only learns what it is shown. Missing groups in the data means worse results for those groups.

  2. Every spreadsheet formula starts with…

    A $B #C =

    C. = The = tells the spreadsheet: calculate this, don't just show it.

Year 9 · Data Science and AI · Lesson 5 of 5

Homework and the challenge

Homework

Study page 18 to the quiz; 'SQL result' practice.

End-of-unit challenge

Investigate a dataset and present one finding with a chart and a caveat.