PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
Classes | Functions
plssvm::openmp Namespace Reference

Namespace containing the C-SVM using the OpenMP backend. More...

Classes

class  csvm
 A C-SVM implementation using OpenMP as backend. More...
 
class  backend_exception
 Exception type thrown if a problem with the OpenMP backend occurs. More...
 

Functions

template<typename real_type >
void device_kernel_q_linear (std::vector< real_type > &q, const std::vector< std::vector< real_type >> &data)
 Calculates the q vector using the linear C-SVM kernel. More...
 
template<typename real_type >
void device_kernel_q_polynomial (std::vector< real_type > &q, const std::vector< std::vector< real_type >> &data, int degree, real_type gamma, real_type coef0)
 Calculates the q vector using the polynomial C-SVM kernel. More...
 
template<typename real_type >
void device_kernel_q_rbf (std::vector< real_type > &q, const std::vector< std::vector< real_type >> &data, real_type gamma)
 Calculates the q vector using the radial basis functions C-SVM kernel. More...
 
template<typename real_type >
void device_kernel_linear (const std::vector< real_type > &q, std::vector< real_type > &ret, const std::vector< real_type > &d, const std::vector< std::vector< real_type >> &data, real_type QA_cost, real_type cost, real_type add)
 Calculates the C-SVM kernel using the linear kernel function. More...
 
template<typename real_type >
void device_kernel_polynomial (const std::vector< real_type > &q, std::vector< real_type > &ret, const std::vector< real_type > &d, const std::vector< std::vector< real_type >> &data, real_type QA_cost, real_type cost, real_type add, int degree, real_type gamma, real_type coef0)
 Calculates the C-SVM kernel using the polynomial kernel function. More...
 
template<typename real_type >
void device_kernel_rbf (const std::vector< real_type > &q, std::vector< real_type > &ret, const std::vector< real_type > &d, const std::vector< std::vector< real_type >> &data, real_type QA_cost, real_type cost, real_type add, real_type gamma)
 Calculates the C-SVM kernel using the radial basis function kernel function. More...
 

Detailed Description

Namespace containing the C-SVM using the OpenMP backend.

Function Documentation

◆ device_kernel_q_linear()

template<typename real_type >
void plssvm::openmp::device_kernel_q_linear ( std::vector< real_type > &  q,
const std::vector< std::vector< real_type >> &  data 
)

Calculates the q vector using the linear C-SVM kernel.

Template Parameters
real_typethe type of the data
Parameters
[out]qthe calculated q vector
[in]datathe two-dimensional data matrix

◆ device_kernel_q_polynomial()

template<typename real_type >
void plssvm::openmp::device_kernel_q_polynomial ( std::vector< real_type > &  q,
const std::vector< std::vector< real_type >> &  data,
int  degree,
real_type  gamma,
real_type  coef0 
)

Calculates the q vector using the polynomial C-SVM kernel.

Template Parameters
real_typethe type of the data
Parameters
[out]qthe calculated q vector
[in]datathe two-dimensional data matrix
[in]degreethe degree parameter used in the polynomial kernel function
[in]gammathe gamma parameter used in the polynomial kernel function
[in]coef0the coef0 parameter used in the polynomial kernel function

◆ device_kernel_q_rbf()

template<typename real_type >
void plssvm::openmp::device_kernel_q_rbf ( std::vector< real_type > &  q,
const std::vector< std::vector< real_type >> &  data,
real_type  gamma 
)

Calculates the q vector using the radial basis functions C-SVM kernel.

Template Parameters
real_typethe type of the data
Parameters
[out]qthe calculated q vector
[in]datathe two-dimensional data matrix
[in]gammathe gamma parameter used in the rbf kernel function

◆ device_kernel_linear()

template<typename real_type >
void plssvm::openmp::device_kernel_linear ( const std::vector< real_type > &  q,
std::vector< real_type > &  ret,
const std::vector< real_type > &  d,
const std::vector< std::vector< real_type >> &  data,
real_type  QA_cost,
real_type  cost,
real_type  add 
)

Calculates the C-SVM kernel using the linear kernel function.

Template Parameters
real_typethe type of the data
Parameters
[in]qthe q vector
[out]retthe result vector
[in]dthe right-hand side of the equation
[in]datathe data matrix
[in]QA_costhe bottom right matrix entry multiplied by cost
[in]cost1 / the cost parameter in the C-SVM
[in]adddenotes whether the values are added or subtracted from the result vector

◆ device_kernel_polynomial()

template<typename real_type >
void plssvm::openmp::device_kernel_polynomial ( const std::vector< real_type > &  q,
std::vector< real_type > &  ret,
const std::vector< real_type > &  d,
const std::vector< std::vector< real_type >> &  data,
real_type  QA_cost,
real_type  cost,
real_type  add,
int  degree,
real_type  gamma,
real_type  coef0 
)

Calculates the C-SVM kernel using the polynomial kernel function.

Template Parameters
real_typethe type of the data
Parameters
[in]qthe q vector
[out]retthe result vector
[in]dthe right-hand side of the equation
[in]datathe data matrix
[in]QA_costthe bottom right matrix entry multiplied by cost
[in]cost1 / the cost parameter in the C-SVM
[in]adddenotes whether the values are added or subtracted from the result vector
[in]degreethe degree parameter used in the polynomial kernel function
[in]gammathe gamma parameter used in the polynomial kernel function
[in]coef0the coef0 parameter used in the polynomial kernel function

◆ device_kernel_rbf()

template<typename real_type >
void plssvm::openmp::device_kernel_rbf ( const std::vector< real_type > &  q,
std::vector< real_type > &  ret,
const std::vector< real_type > &  d,
const std::vector< std::vector< real_type >> &  data,
real_type  QA_cost,
real_type  cost,
real_type  add,
real_type  gamma 
)

Calculates the C-SVM kernel using the radial basis function kernel function.

Template Parameters
real_typethe type of the data
Parameters
[in]qthe q vector
[out]retthe result vector
[in]dthe right-hand side of the equation
[in]datathe data matrix
[in]QA_costhe bottom right matrix entry multiplied by cost
[in]cost1 / the cost parameter in the C-SVM
[in]adddenotes whether the values are added or subtracted from the result vector
[in]gammathe gamma parameter used in the rbf kernel function