![]() |
PLSSVM - Parallel Least Squares Support Vector Machine
2.0.0
A Least Squares Support Vector Machine implementation using different backends.
|
Class for encapsulating all important C-SVM parameters. More...
#include <parameter.hpp>
Public Types | |
| using | real_type = T |
The type of the data. Must be either float or double. | |
Public Member Functions | |
| constexpr | parameter () noexcept=default |
| Default construct a parameter set, i.e., each SVM parameter has its default value. | |
| constexpr | parameter (const kernel_function_type kernel_p, const int degree_p, const real_type gamma_p, const real_type coef0_p, const real_type cost_p) noexcept |
| Construct a parameter set by explicitly overwriting the SVM parameters' default values. More... | |
| template<typename... Args, PLSSVM_REQUIRES(has_only_named_args_v< Args... >) > | |
| constexpr | parameter (const parameter ¶ms, Args &&...named_args) |
Construct a parameter by using the values in params and overwriting all values using the provided named-parameters. More... | |
| template<typename... Args, PLSSVM_REQUIRES(has_only_named_args_v< Args... >) > | |
| constexpr | parameter (Args &&...named_args) noexcept |
| Construct a parameter set by overwriting the SVM parameters' default values that are provided using named-parameters. More... | |
| template<typename U > | |
| constexpr | operator parameter< U > () const |
Convert a plssvm::parameter<T>to a plssvm::parameter<U> (i.e., conversion between float <-> double). More... | |
| constexpr bool | equivalent (const parameter &other) const noexcept |
Checks whether the current parameter set is equivalent to the one given by other. More... | |
Public Attributes | |
| default_value< kernel_function_type > | kernel_type { default_init<kernel_function_type>{ kernel_function_type::linear } } |
| The used kernel function: linear, polynomial, or radial basis functions (rbf). | |
| default_value< int > | degree { default_init<int>{ 3 } } |
| The degree parameter used in the polynomial kernel function. | |
| default_value< real_type > | gamma { default_init<real_type>{ 0.0 } } |
| The gamma parameter used in the polynomial and rbf kernel functions. | |
| default_value< real_type > | coef0 { default_init<real_type>{ 0.0 } } |
| The coef0 parameter used in the polynomial kernel function. | |
| default_value< real_type > | cost { default_init<real_type>{ 1.0 } } |
| The cost parameter in the C-SVM. | |
Private Member Functions | |
| template<typename... Args> | |
| void | set_named_arguments (Args &&...named_args) |
Overwrite the default values of this parameter object with the potential provided named-parameters named_args. More... | |
Class for encapsulating all important C-SVM parameters.
| T | the used real_type, must either be float or double |
|
inlineconstexprnoexcept |
Construct a parameter set by explicitly overwriting the SVM parameters' default values.
| [in] | kernel_p | the kernel type: linear, polynomial, or radial-basis functions (rbf) |
| [in] | degree_p | the degree used in the polynomial kernel function |
| [in] | gamma_p | the gamma used in the polynomial and rbf kernel functions |
| [in] | coef0_p | the coef0 used in the polynomial kernel function |
| [in] | cost_p | the cost used in all kernel functions |
|
inlineexplicitconstexpr |
Construct a parameter by using the values in params and overwriting all values using the provided named-parameters.
| Args | the type of the named-parameters |
| [in] | params | the parameters used to overwrite the default values |
| [in] | named_args | the potential named-parameters |
|
inlineexplicitconstexprnoexcept |
Construct a parameter set by overwriting the SVM parameters' default values that are provided using named-parameters.
| Args | the type of the named-parameters |
| [in] | named_args | the potential named-parameters |
|
inlineexplicitconstexpr |
Convert a plssvm::parameter<T>to a plssvm::parameter<U> (i.e., conversion between float <-> double).
| U | the type to convert to |
plssvm::parameter values converted to U ([[nodiscard]])
|
inlineconstexprnoexcept |
Checks whether the current parameter set is equivalent to the one given by other.
Compares the member variables based on the kernel, i.e., for example for the rbf kernel both parameter sets must only have the same gamma and cost values but may differ in the values of degree or coef0. If all members should be compared regardless of the kernel type, one can use the operator== overload.
| [in] | other | the other parameter set compared to this one |
true if both parameter sets are equivalent, false otherwise ([[nodiscard]])
|
inlineprivate |
Overwrite the default values of this parameter object with the potential provided named-parameters named_args.
| Args | the type of the named-parameters |
| [in] | named_args | the potential named-parameters |