Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The Kernel Method (Kernel Trick)

The Kernel Method (Kernel Trick)

1. Introduction

Many machine learning algorithms, including linear regression, logistic regression, Principal Component Analysis (PCA), and linear classifiers (like the Perceptron or linear Support Vector Machines), rely on linear relationships between data points. These algorithms perform well when the data is linearly separable or can be adequately modeled by linear functions. However, many real-world problems involve complex, non-linear data structures that linear models cannot capture effectively.

The Kernel Method (often called the Kernel Trick) provides a powerful way to apply linear algorithms to non-linear data. The core idea is to map the data into a higher-dimensional feature space (F\mathcal{F}) where the data becomes linearly separable or easier to model linearly. The “trick” is that this mapping can be done implicitly using a kernel function, without ever needing to explicitly compute the coordinates of the data points in the high-dimensional (and potentially infinite-dimensional) feature space. This avoids the computational burden associated with explicit mapping.

Note: Kernel trick, which is also known as kernel method or kernel machines are a class of algorithms for pattern analysis, where involve using linear classifiers to solve nonlinear problems. These methods are different from kernelization, that is a technique for designing efficient algorithms that achieve their efficiency by a preprocessing stage in which inputs to the algorithm are replaced by a smaller input, called a “kernel”.

2. Limitations of Linear Models

Consider a binary classification problem. A linear model attempts to find a hyperplane to separate the data points belonging to different classes.

If such a separating hyperplane exists, the data is called linearly separable. However, if the data has a non-linear structure, like the classic XOR problem or concentric circles, no single hyperplane can correctly separate the classes in the original input space.

3. Feature Mapping

To handle non-linear data, we can transform the data into a new, higher-dimensional feature space where it might become linearly separable. This is done using a mapping function, denoted by ϕ\phi:

ϕ:X→F\phi: \mathcal{X} \to \mathcal{F}

4. The Kernel Trick

The power of the kernel method lies in the observation that many linear algorithms can be formulated such that they only require dot products between data points (xiTxj\mathbf{x}_i^T \mathbf{x}_j). Examples include the Perceptron (in its dual form), Logistic Regression (dual form), PCA, and Support Vector Machines.

If we use a feature map ϕ\phi, these algorithms would need to compute dot products in the high-dimensional feature space: ϕ(xi)Tϕ(xj)\phi(\mathbf{x}_i)^T \phi(\mathbf{x}_j). Calculating ϕ(x)\phi(\mathbf{x}) explicitly can be computationally very expensive, especially if F\mathcal{F} has extremely high or infinite dimensions.

The kernel trick avoids this explicit computation. We define a kernel function KK that computes the dot product in the feature space directly from the original input vectors:

K(x,z)=ϕ(x)Tϕ(z)K(\mathbf{x}, \mathbf{z}) = \phi(\mathbf{x})^T \phi(\mathbf{z})

If we can find a function KK that computes this dot product efficiently without first computing ϕ(x)\phi(\mathbf{x}) and ϕ(z)\phi(\mathbf{z}), we can use it in our linear algorithm. We simply replace every occurrence of the dot product xiTxj\mathbf{x}_i^T \mathbf{x}_j with the kernel function evaluation K(xi,xj)K(\mathbf{x}_i, \mathbf{x}_j).

This allows us to effectively operate in the high-dimensional feature space F\mathcal{F} while only doing computations in the original input space X\mathcal{X}.

Illustration depicting the mapping ϕ\phi and the kernel function kk.

5. Algorithms Using Kernels

Any algorithm that can be expressed solely in terms of dot products between input samples can potentially be “kernelized”.

6. Common Kernel Functions

Several standard kernel functions exist, each corresponding to a different feature map ϕ\phi.

7. Mercer’s Theorem: When is K a Valid Kernel?

Not every function K(x,z)K(\mathbf{x}, \mathbf{z}) can be interpreted as a dot product ϕ(x)Tϕ(z)\phi(\mathbf{x})^T \phi(\mathbf{z}) in some feature space (specifically, a Hilbert space). Mercer’s Theorem provides the condition for a function to be a valid kernel.

Definition: Gram Matrix

Given a dataset {x1,…,xn}\{\mathbf{x}_1, \dots, \mathbf{x}_n\} and a feature map ϕ\phi that maps each data point to a (possibly infinite-dimensional) inner product space, the Gram matrix K\mathbf{K} is an n×nn \times n matrix where the entry (i,j)(i, j) is the inner product of the feature representations:

Kij=⟨ϕ(xi),ϕ(xj)⟩\mathbf{K}_{ij} = \langle \phi(\mathbf{x}_i), \phi(\mathbf{x}_j) \rangle

Relationship to the Kernel Function

The kernel function KK is defined precisely as this inner product:

K(xi,xj)=⟨ϕ(xi),ϕ(xj)⟩K(\mathbf{x}_i, \mathbf{x}_j) = \langle \phi(\mathbf{x}_i), \phi(\mathbf{x}_j) \rangle

Therefore, the Gram matrix entries can be written equivalently as:

Kij=⟨ϕ(xi),ϕ(xj)⟩=K(xi,xj)\mathbf{K}_{ij} = \langle \phi(\mathbf{x}_i), \phi(\mathbf{x}_j) \rangle = K(\mathbf{x}_i, \mathbf{x}_j)

Definition: Positive Semidefinite (PSD) Matrix A symmetric matrix K\mathbf{K} is positive semidefinite if for any non-zero vector c∈Rn\mathbf{c} \in \mathbb{R}^n:

cTKc≥0\mathbf{c}^T \mathbf{K} \mathbf{c} \ge 0

Mercer’s Theorem (Simplified): Let X\mathcal{X} be a compact subset of Rp\mathbb{R}^p. A continuous, symmetric function K:X×X→RK: \mathcal{X} \times \mathcal{X} \to \mathbb{R} is a valid kernel (i.e., there exists a mapping ϕ\phi to a Hilbert space such that K(x,z)=⟨ϕ(x),ϕ(z)⟩K(\mathbf{x}, \mathbf{z}) = \langle \phi(\mathbf{x}), \phi(\mathbf{z}) \rangle) if and only if the Gram matrix K\mathbf{K} is positive semidefinite for any finite set of points {x1,…,xn}\{\mathbf{x}_1, \dots, \mathbf{x}_n\} drawn from X\mathcal{X}.

Proof: If KK is a kernel   ⟹  \implies Gram matrix is PSD Assume K(x,z)=ϕ(x)Tϕ(z)K(\mathbf{x}, \mathbf{z}) = \phi(\mathbf{x})^T \phi(\mathbf{z}) for some mapping ϕ\phi. Let {x1,…,xn}\{\mathbf{x}_1, \dots, \mathbf{x}_n\} be any set of points and K\mathbf{K} be the corresponding Gram matrix (Kij=ϕ(xi)Tϕ(xj)\mathbf{K}_{ij} = \phi(\mathbf{x}_i)^T \phi(\mathbf{x}_j)). For any vector c=(c1,…,cn)T∈Rn\mathbf{c} = (c_1, \dots, c_n)^T \in \mathbb{R}^n, consider the quadratic form:

cTKc=∑i=1n∑j=1ncicjKij\mathbf{c}^T \mathbf{K} \mathbf{c} = \sum_{i=1}^n \sum_{j=1}^n c_i c_j \mathbf{K}_{ij}

Substitute Kij=ϕ(xi)Tϕ(xj)\mathbf{K}_{ij} = \phi(\mathbf{x}_i)^T \phi(\mathbf{x}_j):

cTKc=∑i=1n∑j=1ncicj(ϕ(xi)Tϕ(xj))\mathbf{c}^T \mathbf{K} \mathbf{c} = \sum_{i=1}^n \sum_{j=1}^n c_i c_j (\phi(\mathbf{x}_i)^T \phi(\mathbf{x}_j))

Rearrange the terms:

cTKc=∑i=1nciϕ(xi)T(∑j=1ncjϕ(xj))\mathbf{c}^T \mathbf{K} \mathbf{c} = \sum_{i=1}^n c_i \phi(\mathbf{x}_i)^T \left( \sum_{j=1}^n c_j \phi(\mathbf{x}_j) \right)
cTKc=(∑i=1nciϕ(xi))T(∑j=1ncjϕ(xj))\mathbf{c}^T \mathbf{K} \mathbf{c} = \left( \sum_{i=1}^n c_i \phi(\mathbf{x}_i) \right)^T \left( \sum_{j=1}^n c_j \phi(\mathbf{x}_j) \right)

Let v=∑i=1nciϕ(xi)\mathbf{v} = \sum_{i=1}^n c_i \phi(\mathbf{x}_i). This is a vector in the feature space F\mathcal{F}. The expression becomes:

cTKc=vTv=∥v∥2\mathbf{c}^T \mathbf{K} \mathbf{c} = \mathbf{v}^T \mathbf{v} = \|\mathbf{v}\|^2

Since the squared Euclidean norm (or the squared norm in the Hilbert space) of any vector is always non-negative, we have:

cTKc=∥∑i=1nciϕ(xi)∥2≥0\mathbf{c}^T \mathbf{K} \mathbf{c} = \left\| \sum_{i=1}^n c_i \phi(\mathbf{x}_i) \right\|^2 \ge 0

Thus, the Gram matrix K\mathbf{K} is positive semidefinite.

The other direction of Mercer’s theorem (that any function KK generating PSD Gram matrices corresponds to some feature map ϕ\phi) is more involved to prove but guarantees that functions like the Gaussian or polynomial kernels are valid.

Implications: Mercer’s theorem is fundamental because it tells us which functions KK we can legally use as kernels in our algorithms. We don’t need to explicitly find ϕ\phi; we just need to verify the positive semidefinite condition on KK. In practice, we often use well-known kernels (like linear, polynomial, RBF) that are known to satisfy Mercer’s condition. It also allows us to construct new valid kernels from existing ones (e.g., the sum or product of valid kernels is also a valid kernel).

8. Further Interpretations and Operations in Feature Space (via Kernels)

The kernel trick not only allows us to run algorithms implicitly in the feature space F\mathcal{F} but also enables us to understand and compute certain properties related to the data within that space, all without needing the explicit coordinates ϕ(x)\phi(\mathbf{x}).

Kernel Value as Similarity:

As mentioned earlier, the kernel function K(x,z)=ϕ(x)Tϕ(z)K(\mathbf{x}, \mathbf{z}) = \phi(\mathbf{x})^T \phi(\mathbf{z}) represents the dot product between the feature vectors ϕ(x)\phi(\mathbf{x}) and ϕ(z)\phi(\mathbf{z}). In Euclidean space (and Hilbert spaces), the dot product is closely related to the angle between vectors. A larger, positive dot product implies the vectors point in similar directions, indicating higher similarity. Therefore, the kernel value K(x,z)K(\mathbf{x}, \mathbf{z}) can be interpreted as a measure of similarity between the original points x\mathbf{x} and z\mathbf{z} after they have been mapped into the feature space F\mathcal{F}. This interpretation is fundamental to why kernels work well in algorithms like SVM (finding points similar to support vectors) or clustering (grouping similar points). Different kernels capture different notions of similarity.

Norm of a Point in Feature Space:

The squared Euclidean norm (or squared length) of a mapped point ϕ(x)\phi(\mathbf{x}) in the feature space can be computed using the kernel function. Recall that the squared norm of a vector is its dot product with itself:

∥ϕ(x)∥2=ϕ(x)Tϕ(x)\|\phi(\mathbf{x})\|^2 = \phi(\mathbf{x})^T \phi(\mathbf{x})

Using the definition of the kernel, this is simply:

∥ϕ(x)∥2=K(x,x)\|\phi(\mathbf{x})\|^2 = K(\mathbf{x}, \mathbf{x})

So, the diagonal elements of the Gram matrix K\mathbf{K} give the squared norms of the data points in the feature space. This is useful, for instance, if we need to normalize points in F\mathcal{F}.

Mean in Feature Space:

Given a dataset {x1,x2,...,xn}\{\mathbf{x}_1, \mathbf{x}_2, ..., \mathbf{x}_n\}, the mean of their representations in the feature space is:

mϕ=1n∑i=1nϕ(xi)\mathbf{m}_\phi = \frac{1}{n} \sum_{i=1}^n \phi(\mathbf{x}_i)

While we usually cannot compute or store mϕ\mathbf{m}_\phi directly (as it lives in F\mathcal{F}), we can compute its dot product with any mapped point ϕ(x)\phi(\mathbf{x}) using the kernel:

ϕ(x)Tmϕ=ϕ(x)T(1n∑j=1nϕ(xj))=1n∑j=1nϕ(x)Tϕ(xj)=1n∑j=1nK(x,xj)\phi(\mathbf{x})^T \mathbf{m}_\phi = \phi(\mathbf{x})^T \left( \frac{1}{n} \sum_{j=1}^n \phi(\mathbf{x}_j) \right) = \frac{1}{n} \sum_{j=1}^n \phi(\mathbf{x})^T \phi(\mathbf{x}_j) = \frac{1}{n} \sum_{j=1}^n K(\mathbf{x}, \mathbf{x}_j)

Similarly, the squared norm of the mean vector can also be computed:

∥mϕ∥2=mϕTmϕ=(1n∑i=1nϕ(xi))T(1n∑j=1nϕ(xj))=1n2∑i=1n∑j=1nϕ(xi)Tϕ(xj)=1n2∑i=1n∑j=1nK(xi,xj)\|\mathbf{m}_\phi\|^2 = \mathbf{m}_\phi^T \mathbf{m}_\phi = \left( \frac{1}{n} \sum_{i=1}^n \phi(\mathbf{x}_i) \right)^T \left( \frac{1}{n} \sum_{j=1}^n \phi(\mathbf{x}_j) \right) = \frac{1}{n^2} \sum_{i=1}^n \sum_{j=1}^n \phi(\mathbf{x}_i)^T \phi(\mathbf{x}_j) = \frac{1}{n^2} \sum_{i=1}^n \sum_{j=1}^n K(\mathbf{x}_i, \mathbf{x}_j)

This ability to work with the mean implicitly is crucial for algorithms like Kernel PCA that require centering the data in the feature space.

Distance between Points:

The distance between ϕ(xi)\phi(\textbf{x}_i) and ϕ(xj)\phi(\textbf{x}_{j}) is

∥ϕ(xi)−ϕ(xj)∥2=∥ϕ(xi)∥2+∥ϕ(xj)∥2−2ϕ(xi)Tϕ(xj)=K(xi,xi)+K(xj,xj)−2K(xi,xj)\|\phi(\textbf{x}_i) -\phi(\textbf{x}_{j})\|^2 = \|\phi(\textbf{x}_i)\|^2 + \|\phi(\textbf{x}_{j})\|^2 - 2 \phi(\textbf{x}_i)^T\phi(\textbf{x}_{j})\\ = K(\textbf{x}_i,\textbf{x}_i) + K (\textbf{x}_{j}, \textbf{x}_{j}) - 2 K(\textbf{x}_i,\textbf{x}_{j})

which implies that

∥ϕ(xi)−ϕ(xj)∥=K(xi,xi)+K(xj,xj)−2K(xi,xj)\|\phi(\textbf{x}_i) -\phi(\textbf{x}_{j})\| = \sqrt{K(\textbf{x}_i,\textbf{x}_i) + K (\textbf{x}_{j}, \textbf{x}_{j}) - 2 K(\textbf{x}_i,\textbf{x}_{j})}

Total Variance in Feature Space:

The total variance of the data in the feature space measures the spread of the points ϕ(xi)\phi(\mathbf{x}_i) around their mean mϕ\mathbf{m}_\phi. It’s typically defined as the average squared distance from the mean:

Varϕ=1n∑i=1n∥ϕ(xi)−mϕ∥2\text{Var}_\phi = \frac{1}{n} \sum_{i=1}^n \|\phi(\mathbf{x}_i) - \mathbf{m}_\phi\|^2

We can compute this using kernels. Expanding the norm:

∥ϕ(xi)−mϕ∥2=∥ϕ(xi)∥2−2ϕ(xi)Tmϕ+∥mϕ∥2\|\phi(\mathbf{x}_i) - \mathbf{m}_\phi\|^2 = \|\phi(\mathbf{x}_i)\|^2 - 2 \phi(\mathbf{x}_i)^T \mathbf{m}_\phi + \|\mathbf{m}_\phi\|^2

Now, substitute the kernel expressions we found above:

∥ϕ(xi)−mϕ∥2=K(xi,xi)−2n∑j=1nK(xi,xj)+1n2∑k=1n∑l=1nK(xk,xl)\|\phi(\mathbf{x}_i) - \mathbf{m}_\phi\|^2 = K(\mathbf{x}_i, \mathbf{x}_i) - \frac{2}{n} \sum_{j=1}^n K(\mathbf{x}_i, \mathbf{x}_j) + \frac{1}{n^2} \sum_{k=1}^n \sum_{l=1}^n K(\mathbf{x}_k, \mathbf{x}_l)

Summing over ii and dividing by nn gives the total variance, computable entirely from the kernel values K(xi,xj)K(\mathbf{x}_i, \mathbf{x}_j). This calculation is central to Kernel PCA.

Normalizing Data in Feature Space:

Sometimes it’s desirable to normalize the data points in the feature space. Two common types of normalization are:

ϕ~(xi)=ϕ(xi)−mϕ\tilde{\phi}(\mathbf{x}_i) = \phi(\mathbf{x}_i) - \mathbf{m}_\phi.

While we don’t compute ϕ~(xi)\tilde{\phi}(\mathbf{x}_i) explicitly, we can compute the kernel matrix K~\mathbf{\tilde{K}} corresponding to these centered points using the original kernel matrix K\mathbf{K}. The operation effectively centers the data within F\mathcal{F}. The formula for the centered kernel matrix K~\mathbf{\tilde{K}} where K~ij=ϕ~(xi)Tϕ~(xj)\tilde{K}_{ij} = \tilde{\phi}(\mathbf{x}_i)^T \tilde{\phi}(\mathbf{x}_j) is K~=K−1nK−K1n+1nK1n\mathbf{\tilde{K}} = \mathbf{K} - \mathbf{1}_n \mathbf{K} - \mathbf{K} \mathbf{1}_n + \mathbf{1}_n \mathbf{K} \mathbf{1}_n, where 1n\mathbf{1}_n is the n×nn \times n matrix with all entries equal to 1/n1/n. This is precisely the centering step used in Kernel PCA.

9. Advantages and Disadvantages of the Kernel Trick

Advantages:

  1. Ability to Model Non-linearity: Kernels allow linear algorithms to model complex, non-linear relationships and decision boundaries without changing the core algorithm itself.

  2. Computational Efficiency: Avoids explicit computation of potentially very high-dimensional or infinite-dimensional feature vectors ϕ(x)\phi(\mathbf{x}). Calculations remain in the original input space dimension, depending only on the number of data points when computing the Gram matrix.

  3. Modularity: We can easily switch between different types of non-linearities by simply changing the kernel function (e.g., from polynomial to RBF).

  4. Works with Non-vectorial Data: Kernels can be defined for data types that are not naturally represented as fixed-size vectors, such as strings, graphs, or images, as long as a meaningful similarity function (satisfying Mercer’s condition) can be defined.

Disadvantages:

  1. Computational Cost with Large Datasets: Computing and storing the Gram matrix K\mathbf{K} takes O(n2d)O(n^2 d) or O(n2)O(n^2) time (depending on kernel complexity) and O(n2)O(n^2) space, where nn is the number of samples and dd is the original dimension. This becomes prohibitive for very large nn. Algorithms using the kernel typically have a complexity related to n2n^2 or n3n^3.

  2. Choice of Kernel and Hyperparameters: The performance is highly sensitive to the choice of the kernel function (e.g., Linear, RBF, Polynomial) and its hyperparameters (e.g., γ\gamma for RBF, dd and cc for Polynomial). This often requires careful tuning using techniques like cross-validation.

  3. Interpretability: While the decision boundary in the feature space is linear, the corresponding boundary in the original input space can be very complex and hard to interpret directly. It’s less straightforward than interpreting the coefficients of a simple linear model.

Summary

The Kernel Trick is a powerful mathematical technique that allows linear algorithms (specifically, those relying only on dot products) to operate implicitly in a high-dimensional feature space F\mathcal{F}. By defining a kernel function K(x,z)=ϕ(x)Tϕ(z)K(\mathbf{x}, \mathbf{z}) = \phi(\mathbf{x})^T \phi(\mathbf{z}), we replace dot products in the original algorithm with kernel evaluations. This avoids the potentially expensive computation of the feature map ϕ\phi while achieving the effect of mapping data to a space where it might be linearly separable or where linear patterns might emerge. Key aspects include:

Kernel K-means Clustering

Review: Standard K-means Algorithm

K-means is a widely used clustering algorithm that partitions a dataset into kk clusters by minimizing the sum of squared distances between each point and its assigned cluster centroid.

Algorithm Steps:

  1. Initialization: Randomly select kk initial centroids μ1,…,μk\boldsymbol{\mu}_1, \ldots, \boldsymbol{\mu}_k.

  2. Assignment Step: Assign each data point xj\mathbf{x}_j to the nearest centroid: i∗=arg⁡min⁡i{∥xj−μi∥2} i^* = \arg\min_{i} \left\{ \|\mathbf{x}_j - \boldsymbol{\mu}_i\|^2 \right\}

  3. Update Step: Recompute each centroid as the mean of the points assigned to it: μi=1∣Ci∣∑xj∈Cixj \boldsymbol{\mu}_i = \frac{1}{|C_i|} \sum_{\mathbf{x}_j \in C_i} \mathbf{x}_j

  4. Repeat steps 2 and 3 until convergence (i.e., assignments no longer change or centroids stabilize).

Objective Function:

SSE(C)=∑i=1k∑xj∈Ci∥xj−μi∥2SSE(\mathcal{C}) = \sum_{i=1}^{k} \sum_{\mathbf{x}_j \in C_i} \|\mathbf{x}_j - \boldsymbol{\mu}_i\|^2

Limitation:
K-means can only find clusters separated by linear boundaries. It fails when clusters have nonlinear structure.


Kernel K-means: Motivation

To overcome the linearity limitation, Kernel K-means uses the kernel trick to implicitly map data into a higher-dimensional feature space where clusters may become linearly separable.


Kernel K-means Algorithm

Definitions:

Distance in Feature Space: The squared distance between a point and a cluster centroid in feature space can be computed using only kernel values:

∥ϕ(xj)−μiϕ∥2=K(xj,xj)−2ni∑xa∈CiK(xa,xj)+1ni2∑xa,xb∈CiK(xa,xb)\|\phi(\mathbf{x}_j) - \boldsymbol{\mu}_i^\phi\|^2 = K(\mathbf{x}_j, \mathbf{x}_j) - \frac{2}{n_i} \sum_{\mathbf{x}_a \in C_i} K(\mathbf{x}_a, \mathbf{x}_j) + \frac{1}{n_i^2} \sum_{\mathbf{x}_a, \mathbf{x}_b \in C_i} K(\mathbf{x}_a, \mathbf{x}_b)

Algorithm Steps:

  1. Initialization: Randomly assign points to kk clusters.

  2. For each cluster CiC_i and each point xj\mathbf{x}_j:

    • Compute:

      • sqnormi=1ni2∑xa,xb∈CiK(xa,xb)\text{sqnorm}_i = \frac{1}{n_i^2} \sum_{\mathbf{x}_a, \mathbf{x}_b \in C_i} K(\mathbf{x}_a, \mathbf{x}_b)

      • avgji=1ni∑xa∈CiK(xa,xj)\text{avg}_{ji} = \frac{1}{n_i} \sum_{\mathbf{x}_a \in C_i} K(\mathbf{x}_a, \mathbf{x}_j)

    • Compute the distance: d(xj,Ci)=sqnormi−2⋅avgjid(\mathbf{x}_j, C_i) = \text{sqnorm}_i - 2 \cdot \text{avg}_{ji}

  3. Assignment Step: Assign each point to the cluster with the minimum d(xj,Ci)d(\mathbf{x}_j, C_i).

  4. Repeat steps 2 and 3 until convergence.

Objective Function in Kernel Space:

min⁡C  SSE(C)=∑i=1k∑xj∈Ci∥ϕ(xj)−μiϕ∥2\min_{\mathcal{C}} \; SSE(\mathcal{C}) = \sum_{i=1}^k \sum_{\mathbf{x}_j \in C_i} \|\phi(\mathbf{x}_j) - \boldsymbol{\mu}_i^\phi\|^2

Notes


Example: Gaussian Kernel

With the Gaussian (RBF) kernel:

K(xi,xj)=exp⁡(−∥xi−xj∥22σ2)K(\mathbf{x}_i, \mathbf{x}_j) = \exp\left(-\frac{\|\mathbf{x}_i - \mathbf{x}_j\|^2}{2\sigma^2}\right)

Kernel K-means can separate concentric or otherwise nonlinearly separable clusters.