Dictionary of Applied Machine Learning: 114 machine-learning terms, each with a definition, a figure, citations and a Python demo · All terms · Demos · Start here
Updated on 2026-11-04
Readiness 100/100
A subset of the Euclidean space is convex if it contains the line segment between any two of its points. A function is convex if its epigraph is a convex set. A convex optimization problem is the minimization of a convex function over a convex set. Empirical risk minimization (ERM) is a convex optimization problem whenever the hypothesis space is parameterized by a convex set of model parameters and the loss function is convex in those model parameters. Any local minimizer of a convex objective function is necessarily also a global minimizer, so a method that reaches a local minimum has solved the optimization problem.

convex.py, which recomputes what the entry states: the script block by block · open in ColabLearning a linear model by gradient descent (GD) moves the model parameters step by step, each iteration reducing the objective function within a neighborhood of the current model parameters. Many machine learning (ML) methods learn model parameters by such an iterative optimization method, with GD and its variants the most widely used.
B-globalThese optimization methods are guaranteed to converge to a global minimum when the objective function is a differentiable convex function of the model parameters and the step size is chosen suitably (Boyd and Vandenberghe, 2004, Sect. 9.3). For a convex function every local minimum is necessarily a global minimum: any choice of model parameters at which no small change reduces the objective function already attains the smallest value that the objective function takes anywhere. The average squared error loss of linear regression is a convex function of the model parameters, and so is the objective function of the support vector machine (SVM). Empirical risk minimization (ERM) over a hypothesis space parameterized by a convex set of model parameters, with a loss function that is convex in them, is a convex optimization problem: the minimization of a convex function over a convex set.
Convexity is defined both for sets and for functions.
For sets, the definition is geometric.
A subset $\mathcal{C} \subseteq \mathbb{R}^{d}$ of the
Euclidean space $\mathbb{R}^{d}$ is referred to
as convex if it contains the line segment between any two of its
points (Boyd and Vandenberghe, 2004, Sect. 2.1.4). For
${\mathbf w}, {\mathbf w}' \in \mathcal{C}$, that is
\[ \beta {\mathbf w} + (1-\beta) {\mathbf w}' \in \mathcal{C}
\quad \text{for all } \beta \in [0,1] \text{.} \]
Similarly, a function
$f: \mathbb{R}^{d} \rightarrow \mathbb{R}$
is convex if its epigraph
$\big\{ \big( {\mathbf w}^{\top},t \big)^{\top} \in \mathbb{R}^{d+1} : t \geq f({\mathbf w}) \big\}$
is a convex set (Boyd and Vandenberghe, 2004, Sect. 3.1.7), the epigraph
being the set of points on or above the graph of
$f$. Examples of a convex set
and of a convex function are illustrated in
Fig. 1.
B-halfEvery
closed convex set is given by the intersection of all halfspaces
that contain it (Boyd and Vandenberghe, 2004, Sect. 2.3.1;
Rockafellar, 1970, Thm. 11.5)
\begin{equation}
\label{equ_halfspace_intersection_dict}
\mathcal{C} = \bigcap \big\{ H \subseteq \mathbb{R}^{d}
\;:\; H \text{ is a halfspace}, \; \mathcal{C} \subseteq H \big\}
\text{.}
\end{equation}
In general, intersecting
a subset of the halfspaces containing a convex set yields a
convex set that contains the original one, i.e., an outer
approximation (see Fig. 2).
The outer approximation of Fig. 2 is also used by approximate inference in probabilistic models defined over a graph. The set of achievable marginal distributions is a convex set described by a large number of linear inequalities. Message-passing methods optimize over an outer approximation of it obtained from a subset of those inequalities (Wainwright and Jordan, 2008, Sect. 3.4.1; Sontag and Jaakkola, 2007).
Of the two families of convex sets introduced above, the convex hull is the one that characterizes the linear separability of data points with binary label values. Consider $m$ data points with feature vectors ${\mathbf x}^{(r)} \in \mathbb{R}^{d}$ and labels $y^{(r)} \in \{-1,+1\}$, for $r = 1, \ldots, m$. These data points are linearly separable if some linear classifier predicts every label correctly, i.e., there are ${\mathbf w} \in \mathbb{R}^{d} \setminus \{\mathbf{0}\}$ and $b \in \mathbb{R}$ with $y^{(r)} \big( {\mathbf w}^{\top} {\mathbf x}^{(r)} + b \big) > 0$ for $r = 1, \ldots, m$. This holds precisely when the convex hull of the feature vectors labeled $+1$ and the convex hull of those labeled $-1$ do not intersect (Boyd and Vandenberghe, 2004, Sects. 2.5.1 and 8.6.1). Separability is therefore a property of two convex sets built from the data points.
Convexity also appears in a widely used family of probabilistic models. An exponential family is constituted by the probability distributions whose probability density function (pdf) has the form \[ p({\mathbf x}; {\mathbf w}) = h({\mathbf x}) \exp\big({\mathbf w}^{\top} \mathbf{t}({\mathbf x}) - A({\mathbf w})\big) \text{.} \] This pdf is parameterized by the vector ${\mathbf w}$ and the sufficient statistics $\mathbf{t}(\cdot)$. The log-partition function $A$ is fully determined by requiring $p({\mathbf x}; {\mathbf w})$ to integrate to one. Its Hessian is the covariance matrix of the sufficient statistics $\mathbf{t}({\mathbf x})$ under $p({\mathbf x}; {\mathbf w})$, \[ \nabla^{2} A({\mathbf w}) = {\mathbb{E}} \big\{ \mathbf{t}({\mathbf x}) \mathbf{t}({\mathbf x})^{\top} \big\} - {\mathbb{E}} \big\{ \mathbf{t}({\mathbf x}) \big\} {\mathbb{E}} \big\{ \mathbf{t}({\mathbf x}) \big\}^{\top} \text{,} \] which is positive semi-definite (psd). A twice-differentiable function whose Hessian is psd is convex (Boyd and Vandenberghe, 2004, Sect. 3.1.4), so $A$ is a convex function on its domain (Wainwright and Jordan, 2008, Prop. 3.1). The convexity of $A$ implies that the negative log-likelihood function of a training set, up to an additive constant that does not depend on ${\mathbf w}$, \[ - \sum_{r=1}^{m} {\mathbf w}^{\top} \mathbf{t}\big({\mathbf x}^{(r)}\big) + m A({\mathbf w}) \text{,} \] is a convex function of ${\mathbf w}$. Thus, for an exponential family, maximum likelihood estimation is a convex optimization problem.
See also: epigraph, halfspace, supporting hyperplane, convex optimization, Hessian.
Published version: doi.org/10.1007/978-981-92-2012-0_18-1, in Dictionary of Applied Machine Learning (Springer Nature Singapore). Please cite that version. This page corresponds to version 1 of that entry.
@incollection{dictml_convex,
author = {Jung, Alexander},
editor = {Olioumtsevits, Konstantina and Schnoor, Ekkehard},
title = {convex},
booktitle = {Dictionary of Applied Machine Learning},
publisher = {Springer Nature Singapore},
year = {2026},
doi = {10.1007/978-981-92-2012-0_18-1},
isbn = {978-981-92-2012-0},
url = {https://doi.org/10.1007/978-981-92-2012-0_18-1}
}