Dictionary of Applied Machine Learning: 111 machine-learning terms, each with a definition, a figure, citations and a Python demo · All terms · Demos · Start here
Updated on 2026-10-29
Readiness 95/100
See also matrix linear regression sigmoid function
An inverse of a function is a second function that undoes it. For $f: \mathcal{U} \to \mathcal{V}$ it is the function $g: \mathcal{V} \to \mathcal{U}$ with $g(f(u)) = u$ and $f(g(v)) = v$, and it exists precisely when $f$ is injective and every element of $\mathcal{V}$ has a nonempty preimage. The inverse of a linear map of $\mathbb{R}^{n}$ is again a linear map, represented by the inverse matrix ${\mathbf A}^{-1}$ with ${\mathbf A} {\mathbf A}^{-1} = {\mathbf A}^{-1} {\mathbf A} = \mathbf{I}$, which exists exactly when the square matrix ${\mathbf A}$ is of full-rank, equivalently when its determinant is nonzero. Where no inverse exists, a left or right inverse or the Moore–Penrose pseudoinverse takes its place. In machine learning (ML), inverses appear in the closed-form solution of linear regression, in the pair formed by the sigmoid function and the logit, which turns a score into a probability and back, and in drawing a realization through the inverse of a cumulative distribution function (cdf).

inverse.py, which recomputes what the entry states: the script block by block · open in ColabB-sigmoidA frost warning for Krems an der Donau delivers a real-valued score for the day, and the sigmoid function turns that score into the probability of frost: the score $0$ becomes the probability $0.5$, the score $2.2$ becomes $0.9$. Reading the score back off a reported probability undoes this step, and the function that does so is the logit $\ln\big( p / (1-p) \big)$. The logit is the inverse of the sigmoid function.
B-matrixAn inverse of a function $f: \mathcal{U} \to \mathcal{V}$ is
a function $g: \mathcal{V} \to \mathcal{U}$ that undoes it in
both directions: $g\big(f(u)\big) = u$ for every
$u \in \mathcal{U}$, and $f\big(g(v)\big) = v$ for every
$v \in \mathcal{V}$. Such a $g$ exists precisely when $f$ is
injective and every $v \in \mathcal{V}$ has a nonempty
preimage. It is then unique and written $f^{-1}$. If only
the first identity holds, $g$ is a left inverse, and if only the
second holds, a right inverse. Fig. 1
shows both cases for a function on a domain of four
shapes.
B-cdfInverses are used throughout machine learning (ML). Solving a system of linear equations is one task, and ridge regression is another: its closed-form solution inverts the matrix ${\mathbf X}^{\top} {\mathbf X} + \alpha \mathbf{I}$, which is invertible for every positive regularization strength $\alpha$. The sigmoid function and the logit of the opening paragraph are an invertible pair, which allows translating between the score of a linear classifier and a probability value. A feature transformation that is invertible loses no information, since the raw feature vector can be recovered from the transformed one. The inverse of the cumulative distribution function (cdf) of a random variable (RV) allows generating realizations of that RV from a realization of another, simpler RV, one uniformly distributed on $[0,1]$ (Ross, 2014).
A counterfactual explanation for a learned hypothesis can be constructed from a right inverse of it, which returns, for a given prediction, one feature vector of its preimage. A learned hypothesis usually maps many feature vectors to the same prediction, so it has no inverse and no left inverse; a right inverse is what remains, and choosing which element of the preimage it returns is what makes one counterfactual more useful than another.
See also: function, injective, preimage, invertible, matrix, linear map, determinant, pseudoinverse, linear regression, sigmoid function, logit.
@misc{dictml_inverse,
author = {Jung, Alexander},
editor = {Olioumtsevits, Konstantina and Schnoor, Ekkehard},
title = {inverse},
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-10-29},
url = {https://dictionaryofml.org/terms/inverse.html}
}