Stage 2 · Lesson 1 of 9
Vectors, matrices and the dot product
In ML, one data point is a , which is just a list of numbers. A house with area 120, 3 bedrooms and age 15 becomes [120, 3, 15]. A whole dataset is a matrix: one row per example and one column per .
The dot product multiplies two vectors item by item and adds up the results, so [1, 2, 3] · [4, 5, 6] = 4 + 10 + 18 = 32. It is the most important operation in this roadmap. A linear model's prediction is the dot product of its and the features.
, used to compare (lists of numbers that stand for words or items), is a dot product after scaling both vectors to length 1. Learn the picture too: a large positive dot product means the vectors point the same way, and zero means they are at right angles.
Common traplearning this on paper only; work every example in NumPy with @ as you go.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CoursePaidMathematics for Machine Learning and Data Science Specialization
DeepLearning.AI · Beginner · Coursera subscription; financial aid available
Paid, with financial aid: linear algebra, calculus and statistics taught visually with Python labs
- CourseFreeKhan Academy Statistics and Probability
Khan Academy · Beginner
Free, complete statistics and probability with practice questions on every topic
Keep handy
Also worth your time
- Mathematics for Machine LearningGo deeper
Free book that ties the maths directly to regression, PCA and classifiers