mlpack_kernel_pca(1)
π mlpack_kernel_pca β the user-commands girlie of section 1 β¨
okay bestie, pull up a chair, because this is mlpack_kernel_pca(1), like, from the User Commands manual, and it is the tool for kernel principal components analysis and it EATS π
πΈ NAME πΈ
mlpack_kernel_pca β kernel principal components analysis π¦
β¨ SYNOPSIS β¨
mlpack_kernel_pca -i unknown -k string [-b double] [-c bool] [-D double] [-S double] [-d int] [-n bool] [-O double] [-s string] [-V bool] [-o unknown] [-h -v]
π DESCRIPTION π
so this program performs Kernel Principal Components Analysis (KPCA) on the dataset you hand it, using the kernel you pick. that's the whole vibe. it transforms your data onto the kernel principal components, and if you want, it'll also reduce the dimensionality by ignoring the kernel principal components that have the smallest eigenvalues. slay π
and here's a cute little fact: for the case where a linear kernel is used, this reduces to regular PCA. iconic.
the kernels that are supported are listed below, no cap:
- 'linear': the standard linear dot product (same as normal PCA):
K(x, y) = x^T y - 'gaussian': a Gaussian kernel; requires bandwidth:
K(x, y) = exp(-(|| x - y || ^ 2) / (2 * (bandwidth ^ 2))) - 'polynomial': polynomial kernel; requires offset and degree:
K(x, y) = (x^T y + offset) ^ degree - 'hyptan': hyperbolic tangent kernel; requires scale and offset:
K(x, y) = tanh(scale * (x^T y) + offset) - 'laplacian': Laplacian kernel; requires bandwidth:
K(x, y) = exp(-(|| x - y ||) / bandwidth) - 'epanechnikov': Epanechnikov kernel; requires bandwidth:
K(x, y) = max(0, 1 - || x - y ||^2 / bandwidth^2) - 'cosine': cosine distance:
K(x, y) = 1 - (x^T y) / (|| x || * || y ||)
the parameters for each of the kernels should be specified with the options --bandwidth (-b), --kernel_scale (-S), --offset (-O), or --degree (-D) (or a combination of those parameters). like, mix and match depending on which kernel you chose, bestie π«Ά
π§ the Nystroem thing (yes it's a real word) π§
optionally, the Nystroem method ("Using the Nystroem method to speed up kernel machines", 2001) can be used to calculate the kernel matrix by specifying the --nystroem_method (-n) parameter. this approach works by using a subset of the data as basis to reconstruct the kernel matrix. to specify the sampling scheme, the --sampling (-s) parameter is used. the sampling scheme for the Nystroem method can be chosen from the following list: 'kmeans', 'random', 'ordered'.
π example time π
for example, the following command will perform KPCA on the dataset 'input.csv' using the Gaussian kernel, and saving the transformed data to 'transformed.csv':
$ mlpack_kernel_pca --input_file input.csv --kernel gaussian --output_file transformed.csv
literally copy-paste and go, periodt π
π REQUIRED INPUT OPTIONS π
like, you cannot skip these. the program will simply not know what you want from it.
--input_file(-i) [unknown] β Input dataset to perform KPCA on. the main character of the operation, fr fr.--kernel(-k) [string] β The kernel to use; see the above documentation for the list of usable kernels. pick your fighter β¨
π OPTIONAL INPUT OPTIONS π
these are the little extras, the accessories to the outfit:
--bandwidth(-b) [double] β Bandwidth, for'gaussian'and'laplacian'kernels. Default value1.--center(-c) [bool] β If set, the transformed data will be centered about the origin. centering is self-care π«Ά--degree(-D) [double] β Degree of polynomial, for'polynomial'kernel. Default value1.--help(-h) [bool] β Default help info.--info[string] β Print help on a specific option. Default value''.--kernel_scale(-S) [double] β Scale, for'hyptan'kernel. Default value1.--new_dimensionality(-d) [int] β If not0, reduce the dimensionality of the output dataset by ignoring the dimensions with the smallest eigenvalues. Default value0.--nystroem_method(-n) [bool] β If set, the Nystroem method will be used.--offset(-O) [double] β Offset, for'hyptan'and'polynomial'kernels. Default value0.--sampling(-s) [string] β Sampling scheme to use for the Nystroem method:'kmeans','random','ordered'Default value'kmeans'.--verbose(-v) [bool] β Display informational messages and the full list of parameters and timers at the end of execution. the "tell me everything" button π₯--version(-V) [bool] β Display the version of mlpack.
π¦ OPTIONAL OUTPUT OPTIONS π¦
--output_file(-o) [unknown] β Matrix to save modified dataset to. your transformed data's new home π‘
π ADDITIONAL INFORMATION π
for further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack. iykyk, go read the source, it's giving scholarly π
and that's the whole page, bestie!! this was mlpack-4.8.0, dated 22 June 2026, coming at you live from the mlpack_kernel_pca(1) manual. go forth and kernel your principal components πβ¨π
π¦ where this page comes from
- ubuntu stonking: mlpack-bin 4.8.0-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms