ContentsChapter 1 · Linear algebra1 of 7

1.1

Vectors and linear combinations

In this chapter
  1. 1.1Vectors and linear combinations
  2. 1.2Span, basis and dimension
  3. 1.3Matrices as transformations
  4. 1.4Determinant, inverse and Ax = b
  5. 1.5Dot products, angles and projections
  6. 1.6Eigenvectors and eigenvalues
  7. 1.7Symmetric matrices and the SVD
Before you readA patient is described by age 50, blood pressure 130 and cholesterol 5.2. How would you write that patient as a single mathematical object?
Watch: Vectors, what even are they? · 3Blue1Brown · Essence of Linear Algebra, ch. 1

A vector is a list of numbers. In ML it is one data point: the patient above is x=(50,130,5.2)Tx = (50, 130, 5.2)^T The T^T (transpose) says it is really a column, written sideways to save space. R3\mathbb{R}^3 is the set of all lists of three real numbers, so xx is a vector in R3\mathbb{R}^3 In two dimensions you can draw it as an arrow from the origin.

Two operations are all you need:

Together they give a linear combination: av+bwav + bw for numbers a,ba, b Most models in this course are built from them. A linear regression prediction, θ1x1+θ2x2+…\theta_1 x_1 + \theta_2 x_2 + \dots is a linear combination of features.

v = (3, 1)w = (-1, 2)av + bw = (2, 3)
Drag the tips of v and w, or move the sliders. The purple arrow is av + bw.
Recall
In ML, what does a single vector usually represent?
Recall
What is a linear combination of vv and ww
Exercise
Let v=(3,1)Tv = (3, 1)^T and w=(−1,2)Tw = (-1, 2)^T Compute 2v−w2v - w