Expand description
Kernel utility functions for machine learning workflows.
This module provides practical utilities for kernel-based machine learning:
- Kernel-target alignment for measuring kernel quality
- Gram matrix operations (eigendecomposition preparation)
- Distance matrix computation from kernels
- Kernel matrix validation
Functionsยง
- compute_
gram_ matrix - Compute the kernel matrix from data using a given kernel function.
- distances_
from_ kernel - Compute pairwise distances from a kernel matrix.
- estimate_
kernel_ rank - Compute the effective dimensionality (rank) of a kernel matrix based on normalized eigenvalue spectrum.
- is_
valid_ kernel_ matrix - Check if a kernel matrix is valid (symmetric and positive semi-definite).
- kernel_
target_ alignment - Compute kernel-target alignment (KTA) between a kernel matrix and target labels.
- median_
heuristic_ bandwidth - Compute kernel bandwidth using median heuristic.
- normalize_
rows - Normalize each row of a data matrix (L2 normalization).