Skip to content
BIASED

Vectors, spaces and linear maps

Block 1 of 7~2 min

Data are vectors

This course answers one question: what mathematics does a model need in order to represent data, learn from it and compute reliably? The short answer has four parts. Data are vectors. Models are maps between vector spaces. Learning is optimization. And all of it runs in floating point. This first topic starts the first two parts from scratch and assumes only school algebra.

A model never sees a flat; it sees numbers about it. Describe a flat by its area in square metres, its number of rooms and its age in years, and the flat becomes a list of three numbers, a vector:

x=(70325)∈R3.x = \begin{pmatrix} 70 \\ 3 \\ 25 \end{pmatrix} \in \mathbb R^3 .

Rn\mathbb R^n is the set of all lists of nn real numbers. In ML such a list is a feature vector, and its entries x1,…,xnx_1, \dots, x_n are the features. Vectors are columns; to save space we also write them in a row, x=(70,3,25)x = (70, 3, 25).

Two operations act entry by entry: adding two vectors and multiplying a vector by a number (scaling). Take a second flat y=(50,2,5)y = (50, 2, 5). Then

x+y=(120,5,30),12(x+y)=(60,2.5,15).x + y = (120, 5, 30), \qquad \tfrac12 (x + y) = (60, 2.5, 15).

The second vector is the average flat. An expression ax+bya x + b y with numbers aa and bb is a linear combination of xx and yy; the average is the case a=b=12a = b = \tfrac12.

In two dimensions a vector is also an arrow from the origin: v=(2,1)v = (2, 1) points two units right and one up. Adding vectors puts the arrows head to tail. The vector 2v2v is twice as long, and −v-v points the opposite way.

Answers are saved on the server and tied to this browser until you sign in.