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 value 1.
  • --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 value 1.
  • --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 value 1.
  • --new_dimensionality (-d) [int] β€” If not 0, reduce the dimensionality of the output dataset by ignoring the dimensions with the smallest eigenvalues. Default value 0.
  • --nystroem_method (-n) [bool] β€” If set, the Nystroem method will be used.
  • --offset (-O) [double] β€” Offset, for 'hyptan' and 'polynomial' kernels. Default value 0.
  • --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