In the field of
multivariate statistics
Multivariate statistics is a subdivision of statistics encompassing the simultaneous observation and analysis of more than one outcome variable.
Multivariate statistics concerns understanding the different aims and background of each of the dif ...
, kernel principal component analysis (kernel PCA)
is an extension of
principal component analysis
Principal component analysis (PCA) is a popular technique for analyzing large datasets containing a high number of dimensions/features per observation, increasing the interpretability of data while preserving the maximum amount of information, and ...
(PCA) using techniques of
kernel methods
In machine learning, kernel machines are a class of algorithms for pattern analysis, whose best known member is the support-vector machine (SVM). The general task of pattern analysis is to find and study general types of relations (for example ...
. Using a kernel, the originally linear operations of PCA are performed in a
reproducing kernel Hilbert space
In functional analysis (a branch of mathematics), a reproducing kernel Hilbert space (RKHS) is a Hilbert space of functions in which point evaluation is a continuous linear functional. Roughly speaking, this means that if two functions f and g in ...
.
Background: Linear PCA
Recall that conventional PCA operates on zero-centered data; that is,
:
,
where
is one of the
multivariate observations.
It operates by diagonalizing the
covariance matrix
In probability theory and statistics, a covariance matrix (also known as auto-covariance matrix, dispersion matrix, variance matrix, or variance–covariance matrix) is a square matrix giving the covariance between each pair of elements of ...
,
:
in other words, it gives an
eigendecomposition
In linear algebra, eigendecomposition is the factorization of a matrix into a canonical form, whereby the matrix is represented in terms of its eigenvalues and eigenvectors. Only diagonalizable matrices can be factorized in this way. When the matri ...
of the covariance matrix:
:
which can be rewritten as
:
.
(See also:
Covariance matrix as a linear operator)
Introduction of the Kernel to PCA
To understand the utility of kernel PCA, particularly for clustering, observe that, while ''N'' points cannot, in general, be
linearly separated in
dimensions, they can
almost always
In probability theory, an event is said to happen almost surely (sometimes abbreviated as a.s.) if it happens with probability 1 (or Lebesgue measure 1). In other words, the set of possible exceptions may be non-empty, but it has probability 0. ...
be linearly separated in
dimensions. That is, given ''N'' points,
, if we map them to an ''N''-dimensional space with
:
where
,
it is easy to construct a
hyperplane
In geometry, a hyperplane is a subspace whose dimension is one less than that of its ''ambient space''. For example, if a space is 3-dimensional then its hyperplanes are the 2-dimensional planes, while if the space is 2-dimensional, its hyper ...
that divides the points into arbitrary clusters. Of course, this
creates linearly independent vectors, so there is no covariance on which to perform eigendecomposition ''explicitly'' as we would in linear PCA.
Instead, in kernel PCA, a non-trivial, arbitrary
function is 'chosen' that is never calculated explicitly, allowing the possibility to use very-high-dimensional
's if we never have to actually evaluate the data in that space. Since we generally try to avoid working in the
-space, which we will call the 'feature space', we can create the N-by-N kernel
:
which represents the inner product space (see
Gramian matrix
In linear algebra, the Gram matrix (or Gramian matrix, Gramian) of a set of vectors v_1,\dots, v_n in an inner product space is the Hermitian matrix of inner products, whose entries are given by the inner product G_ = \left\langle v_i, v_j \right\r ...
) of the otherwise intractable feature space. The dual form that arises in the creation of a kernel allows us to mathematically formulate a version of PCA in which we never actually solve the eigenvectors and eigenvalues of the covariance matrix in the
-space (see
Kernel trick
In machine learning, kernel machines are a class of algorithms for pattern analysis, whose best known member is the support-vector machine (SVM). The general task of pattern analysis is to find and study general types of relations (for example ...
). The N-elements in each column of ''K'' represent the dot product of one point of the transformed data with respect to all the transformed points (N points). Some well-known kernels are shown in the example below.
Because we are never working directly in the feature space, the kernel-formulation of PCA is restricted in that it computes not the principal components themselves, but the projections of our data onto those components. To evaluate the projection from a point in the feature space
onto the kth principal component
(where superscript k means the component k, not powers of k)
:
We note that
denotes dot product, which is simply the elements of the kernel
. It seems all that's left is to calculate and normalize the
, which can be done by solving the eigenvector equation
:
where N is the number of data points in the set, and
and
are the eigenvalues and eigenvectors of
. Then to normalize the eigenvectors
, we require that
:
Care must be taken regarding the fact that, whether or not
has zero-mean in its original space, it is not guaranteed to be centered in the feature space (which we never compute explicitly). Since centered data is required to perform an effective principal component analysis, we '
centralize
Centralisation or centralization (see spelling differences) is the process by which the activities of an organisation, particularly those regarding planning and decision-making, framing strategy and policies become concentrated within a particu ...
'
to become
:
where
denotes a N-by-N matrix for which each element takes value
. We use
to perform the kernel PCA algorithm described above.
One caveat of kernel PCA should be illustrated here. In linear PCA, we can use the eigenvalues to rank the eigenvectors based on how much of the variation of the data is captured by each principal component. This is useful for data dimensionality reduction and it could also be applied to KPCA. However, in practice there are cases that all variations of the data are same. This is typically caused by a wrong choice of kernel scale.
Large datasets
In practice, a large data set leads to a large K, and storing K may become a problem. One way to deal with this is to perform clustering on the dataset, and populate the kernel with the means of those clusters. Since even this method may yield a relatively large K, it is common to compute only the top P eigenvalues and eigenvectors of the eigenvalues are calculated in this way.
Example
Consider three concentric clouds of points (shown); we wish to use kernel PCA to identify these groups. The color of the points does not represent information involved in the algorithm, but only shows how the transformation relocates the data points.
First, consider the kernel
:
Applying this to kernel PCA yields the next image.
Now consider a Gaussian kernel:
:
That is, this kernel is a measure of closeness, equal to 1 when the points coincide and equal to 0 at infinity.
Note in particular that the first principal component is enough to distinguish the three different groups, which is impossible using only linear PCA, because linear PCA operates only in the given (in this case two-dimensional) space, in which these concentric point clouds are not linearly separable.
Applications
Kernel PCA has been demonstrated to be useful for novelty detection and image de-noising.
Kernel PCA and De-Noising in Feature Spaces. NIPS, 1999
/ref>
See also
* Cluster analysis
Cluster analysis or clustering is the task of grouping a set of objects in such a way that objects in the same group (called a cluster) are more similar (in some sense) to each other than to those in other groups (clusters). It is a main task of ...
* Nonlinear dimensionality reduction
Nonlinear dimensionality reduction, also known as manifold learning, refers to various related techniques that aim to project high-dimensional data onto lower-dimensional latent manifolds, with the goal of either visualizing the data in the low-d ...
* Spectral clustering
In multivariate statistics, spectral clustering techniques make use of the Spectrum of a matrix, spectrum (eigenvalues) of the similarity matrix of the data to perform dimensionality reduction before clustering in fewer dimensions. The similarity ...
References
{{DEFAULTSORT:Kernel Principal Component Analysis
Dimension reduction
Signal processing
Machine learning algorithms
Kernel methods for machine learning
sv:Principalkomponentanalys#Olinjär PCA