PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
csvm_factory_examples.cpp

A few examples regarding the plssvm::make_csvm function.

#include "plssvm/core.hpp"
int main() {
// create a default support vector machine
// the used backend is determined by the plssvm::determine_default_backend function
const auto svm1 = plssvm::make_csvm();
// explicitly define a backend to use (using the default SVM parameters)
// for SYCL, the SYCL implementation type can/must also be specified
const auto svm3 = plssvm::make_csvm(plssvm::backend_type::sycl, plssvm::sycl_implementation_type = plssvm::sycl::implementation_type::dpcpp);
// explicitly define a backend and parameters to use
const plssvm::parameter params{ plssvm::kernel_type = plssvm::kernel_function_type::rbf, plssvm::gamma = 0.0001 };
const auto svm4 = plssvm::make_csvm(plssvm::backend_type::openmp, params);
// explicitly define a backend and named-parameters to use
const auto svm5 = plssvm::make_csvm(plssvm::backend_type::opencl, plssvm::kernel_type = plssvm::kernel_function_type::rbf, plssvm::gamma = 0.0001);
// explicitly define a backend, parameters, and named-parameters to use
const auto svm6 = plssvm::make_csvm(plssvm::backend_type::sycl, params, plssvm::degree = 6);
// Note: in this case the plssvm::parameter object must be THE FIRST parameter, i.e., the following will not compiled
// const auto svm7 = plssvm::make_csvm(plssvm::backend_type::sycl, plssvm::degree = 6, params);
return 0;
}
Core header including all other necessary headers.
std::unique_ptr< csvm > make_csvm(const backend_type backend, Args &&...args)
Create a new C-SVM using the backend type and additional parameter args.
Definition: csvm_factory.hpp:158