Dictionary of Applied Machine Learning: 151 machine-learning terms, each with a definition, a figure, citations and a Python demo · All terms · Demos · Start here

feature vector

Updated on 2026-11-26

Readiness 100/100

▶ Run the Python demo Open in Colab Typeset PDF LaTeX source Markdown Cite this entry

See also feature feature space feature transformation data point feature matrix feature learning dimensionality reduction tabular data weighted graph Laplacian matrix eigenvector spectral clustering kernel method Hilbert space

A feature vector is a list of numbers describing a data point, with one entry for each of its features. A feature is an attribute of the data point that is measured or computed without substantial human supervision. The precise specification of these measurements defines a feature transformation, the function that maps the data point to its feature vector that belongs to an underlying feature space. The feature space is usually a Euclidean space whose dimension is the number of features. Nonnumeric features are encoded as numbers, a binary attribute as $0$ or $1$ and a categorical one by one-hot encoding. The domain of the feature transformation varies between applications: a data point can be a record of attributes, a text, a digital image, an audio recording, or a node of a graph, whose feature vector collects entries of the eigenvectors of the Laplacian matrix. More generally, the feature space can be any Hilbert space, and a kernel method uses such feature vectors without ever forming them, through their inner products alone.

Figure produced by the Python demo of the entry feature vector
Figure written by the entry's Python demo featurevec.py, which recomputes what the entry states: the script block by block · open in Colab

Definition

B-dayA machine learning (ML) method can represent a day at Krems an der Donau (Austria) by four numbers. They are the air temperature at $06{:}00$ and at $15{:}00$ (UTC) of that day, and the same two readings of the previous day. For 16 July 2024, these are $24.6$ and $30.8\,^{\circ}\mathrm{C}$, and $22.2$ and $31.5\,^{\circ}\mathrm{C}$ the day before. Stacking these measurements into a vector $\big(24.6, 30.8, 22.2, 31.5\big)^{\top} \in \mathbb{R}^{4}$ gives a feature vector that characterizes this day.

In general, the entries of a feature vector ${\mathbf x} = \big(x_{1}, \ldots, x_{d}\big)^{\top}$ are the features $x_{1}, \ldots, x_{d}$ of a data point: attributes measured or computed without substantial human supervision (Duda et al., 2001). A precise specification of how these attributes are measured defines a feature transformation \[ {\mathbf \Phi} : \mathcal{Z} \rightarrow \mathcal{X}, \quad {\mathbf x} = {\mathbf \Phi}({\mathbf z}) \text{.} \] The function ${\mathbf \Phi}$ maps a data point ${\mathbf z} \in \mathcal{Z}$ to its feature vector ${\mathbf x}$ in the feature space $\mathcal{X}$ (Fig. 1). Feature extraction, a preprocessing step, computes ${\mathbf \Phi}({\mathbf z})$ for a given data point (Bishop, 2006, p. 2). In supervised learning, the extracted feature vector is fed into a hypothesis $h: \mathcal{X} \rightarrow \mathcal{Y}$ that delivers a prediction $\widehat{y} = h({\mathbf x})$ of the label $y \in \mathcal{Y}$ of the data point. The feature vectors ${\mathbf x}^{(1)}, \ldots, {\mathbf x}^{(m)}$ of the data points in a dataset $\mathcal{D}$ of dataset size $m$ are the rows of its feature matrix ${\mathbf X} \in \mathbb{R}^{m \times d}$.

Figure 1 of the entry featurevec
Figure 1: A feature vector $\featurevec$ stacks the individual features $\feature_{1}, \,\ldots, \,\feature_{\nrfeatures}$ of a data point $\datapoint$, computed by the feature transformation $\featuretrafovec$. It is a point in the feature space $\featurespace$
One widely used choice for the feature space is a Euclidean space $\mathbb{R}^{d}$ of fixed dimension $d$ (Axler, 2024, Sect. 1A). For the weather example above, the feature space is $\mathcal{X}=\mathbb{R}^{4}$. The feature space $\mathbb{R}^{d}$ serves ML applications whose features are numeric quantities, such as the four temperatures. Features measured on different scales are often brought to a common scale by feature standardization before training. The dimension $d$ ranges from a handful of measurements to millions of pixel intensities; a large $d$ invites the curse of dimensionality and motivates dimensionality reduction.

B-encodeNonnumeric features can also be entries of a feature vector, once their values are encoded as real numbers (Goodfellow et al., 2016; Hastie et al., 2009). A binary feature, such as whether there was rainfall during the day, is encoded as $0$ or $1$. A categorical feature with $K$ possible values, such as the season (winter, spring, summer, or autumn), is one-hot encoded. It occupies $K$ entries of the feature vector, all equal to $0$ except for a single entry equal to $1$, whose position names the value. On 16 July 2024, $18.7$ millimeters of rain fell, and the season is summer, so the two features are encoded as the entries $1$ and $\big(0, 0, 1, 0\big)$, respectively. Stacked under the four temperatures, they give the feature vector ${\mathbf x} = \big(24.6, 30.8, 22.2, 31.5, 1, 0, 0, 1, 0\big)^{\top} \in \mathbb{R}^{9}$ of the day. Records that mix numeric and nonnumeric attributes in this way, one row per data point, are tabular data.

B-imageWhile the range of the feature transformation ${\mathbf \Phi}$ can often be chosen as $\mathbb{R}^{d}$, its domain $\mathcal{Z}$ varies widely among ML applications. For example, each element of $\mathcal{Z}$ can be a text document, with its feature vector consisting of word occurrence counts or of an average of the word embeddings of its words. In computer vision, the elements of $\mathcal{Z}$ are digital images, each an array of pixels. The feature vector then lists the red-green-blue (RGB) intensities of those pixels, one entry per intensity (Fig. 2). The feature vector of an audio recording typically consists of signal values at a sequence of time instants, one entry $x_{j}$ for each instant $j=1,\ldots,d$ (Fig. 3), or of the entries of its spectrogram. Instead of fixing ${\mathbf \Phi}$ by hand, deep learning methods learn it from data: the layers of a deep net up to the last one compute a feature vector, and the last layer is the hypothesis applied to it (feature learning; Goodfellow et al., 2016, Ch. 15).

Figure 2 of the entry featurevec
Figure 2: A $2 \times 2$ patch of a digital image and its feature vector. The patch has one array (or grid) of intensities per color channel, labeled R, G, and B, and each array holds the same four pixels in the same positions. On the right, the patch is shown in color, its pixels numbered $1$ to $4$: pixel $1$ has the color with the three intensities $78$, $85$, and $67$. Stacking those three values for pixel $1$, then those for pixel $2$, and so on gives a feature vector with $\nrfeatures = 12$ entries
Figure 3 of the entry featurevec
Figure 3: The feature vector of an audio recording read at $256$ time instants. Entry $\feature_{\featureidx}$ is the value its signal takes at instant $\featureidx$, so this data point is a point of $\reals^{256}$
The domain $\mathcal{Z}$ can also be the node set $\mathcal{V}$ of a weighted graph $\mathcal{G} = \left( \mathcal{V},\mathcal{E} \right)$, a similarity graph whose node $r \in \mathcal{V} := \{1, \ldots, m\}$ is the $r$th data point. An edge $\{r,r'\} \in \mathcal{E}$ with edge weight $A_{r,r'} > 0$ records that the two data points are similar in a domain-specific sense, such as two web pages linked to each other or two weather stations a few kilometers apart. Unlike a $k$-nearest-neighbor graph ($k$-NN graph), which is built from features already at hand, such a graph presupposes no features; it delivers them. Let ${\mathbf u}^{(1)}, \ldots, {\mathbf u}^{(d)}$ be eigenvectors of the Laplacian matrix ${\mathbf L}^{(\mathcal{G})}$, each a vector in $\mathbb{R}^{m}$, for its $d$ smallest eigenvalues $\lambda_{1} \leq \ldots \leq \lambda_{d}$. The feature vector of node $r$ collects the $r$th entries of these eigenvectors, \[ {\mathbf x}^{(r)} = \big(u^{(1)}_{r}, \ldots, u^{(d)}_{r}\big)^{\top} \in \mathbb{R}^{d} \] (Luxburg, 2007, Sect. 4; Hastie et al., 2009, Sect. 14.5.3). An eigenvector with a small eigenvalue varies little across edges with large edge weight (see Laplacian matrix), so nodes joined by such edges receive nearby feature vectors: the map $r \mapsto {\mathbf x}^{(r)}$ is an embedding of the nodes into $\mathbb{R}^{d}$. The eigenvector ${\mathbf u}^{(2)}$, for the algebraic connectivity $\lambda_{2}$, is the Fiedler vector of $\mathcal{G}$. Spectral clustering applies this construction before clustering the resulting feature vectors (Luxburg, 2007, Sect. 4), and a graph neural network (GNN) learns node feature vectors from the same graph by message passing along its edges.

B-dimsThe notion of a Euclidean feature vector can be generalized by replacing the feature space $\mathbb{R}^{d}$ with an arbitrary Hilbert space $\mathcal{H}$. Here, a feature vector is the image of a feature transformation \[ {\mathbf \Phi} : \mathcal{Z} \rightarrow \mathcal{H} \text{,} \] and any Hilbert space can serve as the feature space (Shalev-Shwartz and Ben-David, 2014, Sect. 16.1). One construction of such a feature vector uses a kernel $k: \mathbb{R}^{d} \times \mathbb{R}^{d} \rightarrow \mathbb{R}$. The kernel assigns to each ${\mathbf z} \in \mathbb{R}^{d}$ the function $k\big({\mathbf z},\cdot\big): \mathbb{R}^{d} \rightarrow \mathbb{R}$, whose value at ${\mathbf z}' \in \mathbb{R}^{d}$ is $k\big({\mathbf z},{\mathbf z}'\big)$. That function is itself a vector in a reproducing kernel Hilbert space (RKHS) $\mathcal{H}$, a Hilbert space whose elements are functions on $\mathbb{R}^{d}$ (Aronszajn, 1950, Part I, Sect. 2; Schölkopf and Smola, 2002, Sect. 2.2.2). A kernel method, such as the support vector machine (SVM), kernel ridge regression, or a Gaussian process (GP), uses elements of $\mathcal{H}$ as feature vectors without ever forming them explicitly. Many ML methods use feature vectors only through their inner products, which the reproducing property reduces to kernel evaluations, $\langle k\big({\mathbf z},\cdot\big), k\big({\mathbf z}',\cdot\big) \rangle_{\mathcal{H}} = k\big({\mathbf z},{\mathbf z}'\big)$ (Schölkopf and Smola, 2002, Eq. (2.30)).

Synonyms: covariate vector, input vector, predictor vector.

See also: feature, feature space, feature transformation, data point, vector, Euclidean space, feature matrix, input vector, preprocessing, feature learning, dimensionality reduction, tabular data, graph, weighted graph, similarity graph, Laplacian matrix, eigenvector, embedding, spectral clustering, kernel, reproducing kernel Hilbert space, kernel method, Hilbert space.

References

  1. Duda et al. (2001). Pattern Classification. Wiley.
  2. Bishop (2006). Pattern Recognition and Machine Learning. Springer Science+Business Media. doi.org/10.1007/978-0-387-45528-0
  3. Axler (2024). Linear Algebra Done Right. Springer. doi.org/10.1007/978-3-031-41026-0
  4. Goodfellow et al. (2016). Deep Learning. MIT Press.
  5. Hastie et al. (2009). The Elements of Statistical Learning: Data Mining, Inference, and Prediction. Springer Science+Business Media. doi.org/10.1007/978-0-387-84858-7
  6. Luxburg (2007). A tutorial on spectral clustering. Statist. Comput.. doi.org/10.1007/s11222-007-9033-z
  7. Shalev-Shwartz and Ben-David (2014). Understanding Machine Learning: From Theory to Algorithms. Cambridge Univ. Press. doi.org/10.1017/cbo9781107298019
  8. Aronszajn (1950). Theory of Reproducing Kernels. Trans. Am. Math. Soc.. doi.org/10.1090/S0002-9947-1950-0051437-7
  9. Schölkopf and Smola (2002). Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. MIT Press. doi.org/10.7551/mitpress/4175.001.0001

Cite this entry

@misc{dictml_featurevec,
  author = {Jung, Alexander},
  editor = {Olioumtsevits, Konstantina and Schnoor, Ekkehard},
  title = {feature vector},
  howpublished = {Dictionary of Applied Machine Learning (course edition)},
  year = {2026},
  doi = {10.5281/zenodo.21569296},
  note = {ISBN 978-952-64-3013-3, CC BY 4.0, retrieved 2026-11-26},
  url = {https://dictionaryofml.org/terms/featurevec.html}
}