Lesson 3.1Math~50 min
Vectors: arrows & lists
A list of numbers is an arrow in space. Add them, stretch them, measure them — in 2D and 3D.
Module 3 · 0/7 done
A list of numbers is an arrow
A vector is simply a list of numbers, like . But here’s the trick that makes it powerful: you can also see it as an arrow starting at 0 and ending at the point — three steps along x, two up y. Same thing, two pictures.
In machine learning, everything becomes a vector. A house is . A pixel is . A word is a list of a few hundred numbers. Once something is a vector, all the math in this module works on it.
// In machine learning, every example becomes a vector: a list of numbers. // A house: [size in m², bedrooms, age in years] const house = [120, 3, 15] // A colour: [red, green, blue], each 0–255 const tomato = [255, 99, 71] // A (tiny) word embedding — you'll meet these in Module 8: const cat = [0.8, -0.2, 0.45, 0.1] console.log(house.length, "numbers describe the house") console.log(cat.length, "numbers describe 'cat'")
Press Run (⌘/Ctrl + Enter) to see output here.