The simple polynomial kernel. More...
Public Member Functions | |
| PolynomialKernel (const double degree=2.0, const double offset=0.0) | |
| Construct the Polynomial Kernel with the given offset and degree. | |
| double & | Degree () |
| Modify the degree of the polynomial. | |
| const double & | Degree () const |
| Get the degree of the polynomial. | |
| template<typename VecType > | |
| double | Evaluate (const VecType &a, const VecType &b) const |
| Simple evaluation of the dot product. | |
| double & | Offset () |
| Modify the offset of the dot product of the arguments. | |
| const double & | Offset () const |
| Get the offset of the dot product of the arguments. | |
Private Attributes | |
| double | degree |
| The degree of the polynomial. | |
| double | offset |
| The offset of the dot product of the arguments. | |
The simple polynomial kernel.
For any two vectors
,
,
and
,
Definition at line 38 of file polynomial_kernel.hpp.
| mlpack::kernel::PolynomialKernel::PolynomialKernel | ( | const double | degree = 2.0, |
|
| const double | offset = 0.0 | |||
| ) | [inline] |
Construct the Polynomial Kernel with the given offset and degree.
If the arguments are omitted, the default degree is 2 and the default offset is 0.
| offset | Offset of the dot product of the arguments. | |
| degree | Degree of the polynomial. |
Definition at line 48 of file polynomial_kernel.hpp.
| double& mlpack::kernel::PolynomialKernel::Degree | ( | ) | [inline] |
Modify the degree of the polynomial.
Definition at line 71 of file polynomial_kernel.hpp.
References degree.
| const double& mlpack::kernel::PolynomialKernel::Degree | ( | ) | const [inline] |
Get the degree of the polynomial.
Definition at line 69 of file polynomial_kernel.hpp.
References degree.
| double mlpack::kernel::PolynomialKernel::Evaluate | ( | const VecType & | a, | |
| const VecType & | b | |||
| ) | const [inline] |
Simple evaluation of the dot product.
This evaluation uses Armadillo's dot() function.
| VecType | Type of vector (should be arma::vec or arma::spvec). |
| a | First vector. | |
| b | Second vector. |
Definition at line 63 of file polynomial_kernel.hpp.
| double& mlpack::kernel::PolynomialKernel::Offset | ( | ) | [inline] |
Modify the offset of the dot product of the arguments.
Definition at line 76 of file polynomial_kernel.hpp.
References offset.
| const double& mlpack::kernel::PolynomialKernel::Offset | ( | ) | const [inline] |
Get the offset of the dot product of the arguments.
Definition at line 74 of file polynomial_kernel.hpp.
References offset.
double mlpack::kernel::PolynomialKernel::degree [private] |
The degree of the polynomial.
Definition at line 80 of file polynomial_kernel.hpp.
Referenced by Degree(), and Evaluate().
double mlpack::kernel::PolynomialKernel::offset [private] |
The offset of the dot product of the arguments.
Definition at line 82 of file polynomial_kernel.hpp.
Referenced by Evaluate(), and Offset().
1.6.1