Reading mode

CS 450 · AI and the World — L3 — ML foundations

One static lecture with two views over the same document. Reading mode is the default continuous study document. Present mode changes layout, type, and navigation only.

A model turns inputs into predictions

Ask for evidence that an AI works on new cases.

leads toleads to

Flower measurements

Learned model

Species prediction

Diagram explanation

A learned model maps measurements to a species prediction.

  1. Flower measurements leads to Learned model
  2. Learned model leads to Species prediction
Model
The learned part of a system that maps inputs to predictions.

Examples give it something to learn from

One actual Iris example · measurements in centimetres
Sepal lengthSepal widthPetal lengthPetal widthKnown species
5.13.51.40.2setosa
Inputs / features
The four measurements.
Label
The known species we want the model to predict.
Supervised learning
Learning from examples with target answers.

Training changes it; using it makes a prediction

TRAIN · make

  • Labeled examples → fit a model
  • The model is changed.

INFER · use

  • New measurements → prediction
  • The fitted model is used.

Code state 1

Train

model.fit(measurements, labels)

Code state 2

Use

model.predict(new_measurements)

Learn the pattern, not the quirks

Conceptual fitting patterns; shapes identify groups. Not measured Iris results.

Conceptual fitting patterns; shapes identify groups. Not measured Iris results.

CS 450 · original conceptual illustration · Original course schematic; all rights reserved

Check cases kept out of training

TRAINING FLOWERS

  • Used to fit the model
  • 112 examples

HELD-OUT FLOWERS

  • Kept out while fitting
  • 38 examples
leads toleads to

Predict species

Compare with kept-back label

Count correct / checked

Diagram explanation

The score summarizes predictions on the separate cases.

  1. Predict species leads to Compare with kept-back label
  2. Compare with kept-back label leads to Count correct / checked
Accuracy
Correct predictions divided by the number of cases checked.

Learning can also use rewards for actions

SUPERVISED LEARNING

  • Examples with target answers
  • Iris measurements + species

REINFORCEMENT LEARNING

  • Actions produce reward feedback
  • Game moves → game reward

Follow the same story in Iris

leads toleads toleads to

Examples

Train

Model

Use + check

Diagram explanation

Separate cases provide a check on a trained model.

  1. Examples leads to Train
  2. Train leads to Model
  3. Model leads to Use + check
Decision tree
Questions about measurements lead to a species prediction.
Depth
How many levels of questions the tree can use.

Open the Iris notebook

Get a working notebook or join the paper/projected route.

  1. Open the Iris activity from the CS 450 course page.
  2. In Colab, choose Runtime → Run all.
  3. Find a code cell and the output underneath it.

Read the inputs, prediction, and check

Explain one example and one prediction.

  1. Find the four input measurements and the species label.
  2. Find the 38 flowers kept out of training.
  3. At depth 1, read the correct count and denominator.
  4. Choose one displayed case: does its prediction match its label?

Allow more questions, then check again

Predict what could change before you rerun.

  1. In Step 6, change TREE_DEPTH from 1 to 3.
  2. Run that cell and every cell below it.
  3. Compare the new correct count on the same held-out flowers.

Keep the claim within the evidence

Complete three lines.

  1. Training did __; inference did __.
  2. The model got __ of __ held-out flowers right.
  3. That does not establish __.