Home / Maths for AI / Symbols / Vectors and matrices

Vector

Say it: "vector x", "bold x"

What it means

An ordered list of numbers, often written in bold or with an arrow. xix_i is its i-th entry.

Example

x=(2,−1,4),x2=−1\mathbf{x} = (2, -1, 4), \quad x_2 = -1

Three numbers, so a vector in R3\mathbb{R}^3.

In code

import numpy as np
x = np.array([2, -1, 4])
print(x[1], x.shape)   # Python counts from 0

Output

-1 (3,)

Where it appears in machine learning

One data point (one row of features) is a vector; so is a word embedding.

Related symbols

Learn it properly in the free lesson Vectors, Norms & the Dot Product, with practice questions that check your answers.