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§
- Kernel
Type - 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