Skip to main content

Module kernel

Module kernel 

Source
Expand description

Kernel functions equivalent to LIBSVM’s linear, polynomial, RBF, sigmoid, and precomputed kernels. Kernel functions matching the original LIBSVM.

Provides both:

  • Standalone k_function for prediction (operates on sparse node slices)
  • Kernel struct for training (precomputes x_square for RBF, stores refs)

Structs§

Kernel
Kernel evaluator for training. Holds references to the dataset and precomputes x_square[i] = dot(x[i], x[i]) for RBF kernels.

Functions§

dot
Sparse dot product of two sorted-by-index node slices.
k_function
Evaluate the kernel function K(x, y) for the given parameters.
powi
Integer power by squaring. Matches LIBSVM’s powi(base, times).