LIBIRWLS
kernels.h File Reference

Defition of the kernel functions used in the non linear SVM. More...

#include "IOStructures.h"

Go to the source code of this file.

Functions

double kernelFunction (svm_dataset dataset, int index1, int index2, properties props)
 Radial Basis Function of two elements of the dataset. More...
 
double kernelTest (svm_dataset dataset, int index1, model mymodel, int index2)
 Radial Basis Function of one element of the dataset and Support Vectro of a trained model. More...
 

Detailed Description

Defition of the kernel functions used in the non linear SVM.

Author
Roberto Diaz Morales
Date
23 Aug 2016 It defines the kernel function to use in the non linear SVM in this library.

Function Documentation

§ kernelFunction()

double kernelFunction ( svm_dataset  dataset,
int  index1,
int  index2,
properties  props 
)

Radial Basis Function of two elements of the dataset.

This function returns the kernel function among two elements of the same dataset.

It returns exp(-gamma||x1-x2||^2)

x1 and x2 are two elements of the dataset and gamma is a parameter whose value can be found in the struct props.

Parameters
datasetThe strut that contains the dataset information.
index1The index of the first element of the dataset.
index2The index of the second element of the dataset.
propsThe list of properties to extract the kernel parameters.
Returns
The value of the Radial Basis Function of both elements.

§ kernelTest()

double kernelTest ( svm_dataset  dataset,
int  index1,
model  mymodel,
int  index2 
)

Radial Basis Function of one element of the dataset and Support Vectro of a trained model.

This method returns the RBF Kernel function of one element of the dataset and Support Vectro of a trained model.

It returns exp(-gamma||x1-x2||^2)

x1 is an element of the dataset and x2 is a support vector of a trained model, gamma is a parameter whose value can be found in the struct props.

Parameters
datasetThe strut that contains the dataset information.
index1The index of the sample of the dataset.
mymodelThe trained SVM model.
index2The index of one of the Support Vectors of the trained model.
Returns
The value of the Radial Basis Function of both elements.