Skip to content
Exit presentation

How AI Learns I: From Rules to Data

A rule a person wrote, and a pile of examples

Two programs price the same crate at the mandi. The mandi is the wholesale fruit market. One follows a rule the shop wrote. One copies the nearest example from a pile of priced crates.

A crate has two numbers. One is marked fruit. One is weight in kilos. A marked fruit has a spot on its skin. Nearest means closest on those two numbers.

Loading lab…

A new crate: 6 marked, 3 kilos.
Step 1 of 4
  1. A new crate: 6 marked, 3 kilos.
  2. The shop rule counts marked fruit. 6 is 5 or more. Answer: cut price.
  3. The pile rule finds the nearest example. Its word: full price.
  4. On twenty test crates, the shop rule gets 15 right. The pile gets 14.

The rule

The pile is the evening's twenty-four priced crates. The test crates are the next morning's twenty, the kept-back set.

One rule a person wrote and one rule learned from examples. Measured on the same kept-back set, both produce a count. The counts do not tell you which crates each one got wrong.

  • Shop rule — count marked fruit in a sample of fifteen. 5 or more means cut price. A sample is fifteen fruit taken from the crate.
  • Pile rule — no formula. It copies the word on the nearest example.

The shop rule gets 15 of the 20 right. So 5 are wrong. The pile gets 14 of the 20 right, so 6 are wrong. Only 2 test crates are wrong under both rules. So the two rules miss mostly different crates.

Take one crate that both rules get wrong. At 4 marked and 1 kilo, the seller wrote cut price. The shop rule needs 5 or more marked. With 4, it says full. The nearest example on the pile has 5 marked and 2 kilos. Its word is full price, so the pile says full too.

Jump to lesson

This track

  1. 0 Start here
  2. 1 A rule a person wrote, and a pile of examples
  3. 2 Keep some crates back
  4. 3 Right out of how many
  5. 4 Split it differently
  6. 5 Learning the examples instead of the pattern
  7. 6 Ask more than one
  8. 7 The order you do it in
  9. 8 Write the rule yourself
  10. 9 The big picture
  11. 10 Track quiz

Other tracks