In Linear Algebra, a vector is an ordered list (or array) of numbers (scalars). It can be thought of as representing a point in space or a quantity having both magnitude and direction.
Vectors are fundamental objects used to represent data points, features, parameters in models, embeddings, and directions in multi-dimensional spaces.
They are typically represented as column vectors (most common in ML/DL contexts) or row vectors.
Notation: Usually denoted by lowercase bold letters (e.g., \(\mathbf{v}, \mathbf{x}, \mathbf{w}\)) or lowercase letters with an arrow (e.g., \(\vec{v}\)).
Components/Elements: The individual numbers (scalars) within the vector. \(v_i\) is the \(i\)-th component.
Dimension: The number of components (\(n\)) in the vector determines its dimension. A vector \(\mathbf{v} \in \mathbb{R}^n\) is an n-dimensional real vector.
Row Vector: Written horizontally:
$$ \mathbf{v}^T = \begin{bmatrix} v_1 & v_2 & \dots & v_n \end{bmatrix} \in \mathbb{R}^{1 \times n} $$
Often represented as the transpose (denoted by \(T\)) of a column vector.
Data Point: A single observation (e.g., a user, an image) can be represented as a vector where each component is a feature value (e.g., \([\text{age}, \text{income}, \text{pages\_visited}]^T\)).
Feature Vector: The collection of features for one data point.
Parameters/Weights: The weights connecting neurons in a layer, or the weights of a linear model, are often organized into vectors (or matrices).
Word Embeddings (NLP): Words are represented as dense vectors in a high-dimensional space, where similar words have vectors close to each other (e.g., Word2Vec, GloVe).
Gradients: The gradient\(\nabla f\) of a scalar function \(f\) with respect to multiple variables is a vector pointing in the direction of the steepest ascent. Used in optimization.