P e x c e r a

Vectors: 1D Arrays of Data

Vectors are ordered lists of scalars. In the context of AI, vectors are the standard way to represent 'objects' that have multiple features. If a scalar is a point, a vector is an arrow in space pointing from the origin to that point.

Formal Notation

A vector $\mathbf{v}$ in $n$-dimensional space is written as a column matrix. Each entry in the vector is called a 'component' or 'feature'.

Column Vector Notation

$$\mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix}$$ where $v_1, v_2, ..., v_n$ are the feature values for each dimension.

Vector Spaces: $\mathbb{R}^n$

If a vector has $n$ real-valued components, we say it exists in the vector space $\mathbb{R}^n$. A 3D vector exists in $\mathbb{R}^3$, representing properties like Height, Width, and Depth.

Vectors as 'Feature Sets'

The true power of vectors in AI comes from 'Feature Engineering'. By converting real-world properties into numbers, we can use math to solve problems.

The Housing Example

A house can be represented as a vector: $\mathbf{h} = [\text{area}, \text{bedrooms}, \text{price}]$. This allows us to treat a house as a single point in a 3D coordinate system.

Word Embeddings

In Natural Language Processing (NLP), words are converted into vectors (called embeddings). Large Language Models typically use vectors with 4,096 to 12,288 dimensions, where each dimension captures a subtle linguistic nuance.