Year 1 · Week 06
Chapter 6: What Is Intelligence?
So far we have been writing programs that follow exact instructions—move forward, turn left, add two numbers. This week we ask a bigger question: what does it mean for a machine to be intelligent? We will explore input and output, train a real image classifier, and discover how a simple math idea called linear regression lets a computer make predictions.
Part 1: Input and Output
Every computer program takes something in (input) and produces something out (output). Consider the simplest program you can imagine:
x = 3
print(x) The input is the number 3. The output is... the number 3. The computer stored a value and repeated it back. Is that intelligent?
Part 2: When Does a Task Feel "Intelligent"?
Now imagine a very different task. Someone shows you a photograph of a messy room—clothes on the floor, books on the bed, a half-open backpack. Then they ask you to draw a quick sketch of that room.
You would have to look at the photo, understand which objects are where, decide what to include and what to leave out, and then move your pencil in the right way to represent the scene on paper. That feels much more impressive than printing 3.
Here is the big question for you:
Part 3: Dogs vs. Cats
Let's bring this idea down to something simpler but still surprisingly hard for a computer.
Think about a toddler—maybe two or three years old. Show them a picture of a dog and they say "doggy!" Show them a cat and they say "kitty!" They can tell the two apart almost every time, even for breeds they have never seen before.
Can we get a computer to do the same thing? To find out, we need a collection of labeled examples—pictures where we already know which ones are dogs and which are cats. This collection is called a dataset.
Part 4: Teaching a Machine with Google Teachable Machine
We are going to train our own image classifier—no coding required—using Google Teachable Machine.
What to do
- Open teachablemachine.withgoogle.com and start a new Image Project.
- Create two classes: Dog and Cat.
- Upload images from the dataset into each class.
- Click Train Model and wait for it to finish.
- Test it! Hold up a new picture (or use your webcam) and see if the model can tell whether it is a dog or a cat.
Part 5: Making Predictions with Linear Regression
After training a classifier, we turn to a simpler task: predicting numbers. If you know how many cups of lemonade were sold at different temperatures, can you predict how many will be sold at 75°F?
This is where linear regression comes in! It finds the best-fitting line through your data points, then uses that line to make predictions.
cups_sold = k × temperature + b
Linear regression finds the best numbers for k (slope) and b (y-intercept) to make predictions accurate.