To teach a computer, we must translate the world into Numbers.
Computers can't see "Red" or "Bumpy". But they can see 1 and 0!
A "Feature" is a fact about an object translated into a number.
Light = 0
Heavy = 1
Smooth = 0
Bumpy = 1
Example using Lists:
Let's say Red is 1 and Yellow is 0.
Create an apple list with [1] (Red).
apple = [1] print(apple)
Now create a banana. It is Yellow (0).
apple = [1] banana = [0] print(banana)
Let's add Shape!
Round = 1, Long = 0.
Update your lists to have 2 numbers: [Color, Shape].
# Apple: Red(1), Round(1)
apple = [1, 1]
# Banana: Yellow(0), Long(0)
banana = [0, 0]
print("Data Ready!")
1. Why do we change words into numbers?