This repository contains an implementation of the paper Learning Kernel Parameters for Support Vector Classification Using Similarity Embeddings, presented in ESANN 24. It consists of a similarity-based approach for optimizing the width parameter (sigma) in radial basis function (RBF) kernels.
Supported kernel types are:
- Gaussian kernel: $K(x_i, x_j) = \exp\left(-\frac{1}{2}\frac{||x_i - x_j||2}{\sigma2}\right)$.
- Laplacian kernel:
$K(x_i, x_j) = \exp\left(-\frac{1}{2}\frac{||x_i - x_j||}{\sigma}\right)$ .
similarity_optimization.py: Contains the core functions for generating similarity spaces, computing RBF loss, and optimizing the kernel width.
Generates a similarity space using a specified kernel function (Gaussian or Laplacian).
Computes the RBF loss based on class mean similarities.
Finds the optimal sigma value to minimize the RBF loss using numerical optimization.
This module can be used for tuning kernel parameters in machine learning tasks where similarity-based representations are important. Import the functions and apply them to your dataset to determine the best kernel width for classification tasks.
numpyscipy
This project is open-source and available under the Apache 2.0 License.