Skip to main content

Module kernels

Module kernels 

Source
Expand description

Kernel functions library (Linear, Polynomial, RBF, Laplacian, Sigmoid) Kernel Functions Library

Provides a comprehensive set of kernel functions for use in kernel methods such as Kernel PCA, Kernel Ridge Regression, and Support Vector Machines.

§Available Kernels

  • Linear: k(x, y) = x^T y
  • Polynomial: k(x, y) = (gamma * x^T y + coef0)^degree
  • RBF/Gaussian: k(x, y) = exp(-gamma * ||x - y||^2)
  • Laplacian: k(x, y) = exp(-gamma * ||x - y||_1)
  • Sigmoid/Tanh: k(x, y) = tanh(gamma * x^T y + coef0)

§Gram Matrix and Centering

The module also provides utilities for computing Gram matrices (kernel matrices) and centering them in feature space.

Enums§

KernelType
Kernel function type

Functions§

center_kernel_matrix
Center a kernel matrix in feature space
center_kernel_matrix_test
Center a test kernel matrix using the training kernel matrix statistics
cross_gram_matrix
Compute the Gram matrix between two datasets
estimate_rbf_gamma
Estimate the RBF gamma parameter using the median heuristic
gram_matrix
Compute the Gram matrix (kernel matrix) for a dataset
is_positive_semidefinite
Check if a kernel matrix is positive semi-definite
kernel_alignment
Kernel alignment between two kernel matrices
kernel_diagonal
Compute the diagonal of a kernel matrix (self-similarities)
kernel_eval
Evaluate a kernel function between two vectors