---
name: "mlpack_kernel_PolynomialKernel"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_kernel_PolynomialKernel"
---

# mlpack\_kernel\_PolynomialKernel(3)

The simple polynomial kernel.

## NAME

mlpack::kernel::PolynomialKernel -

The simple polynomial kernel.

## SYNOPSIS

### Public Member Functions

**PolynomialKernel** (const double **degree**=2.0, const double **offset**=0.0)\
 *Construct the Polynomial Kernel with the given offset and degree.*  const double & **Degree** () const \
 *Get the degree of the polynomial.*  double & **Degree** ()\
 *Modify the degree of the polynomial.*  template\<typename VecType \> double **Evaluate** (const VecType &a, const VecType &b) const \
 *Simple evaluation of the dot product.*  const double & **Offset** () const \
 *Get the offset of the dot product of the arguments.*  double & **Offset** ()\
 *Modify the offset of the dot product of the arguments.*  std::string **ToString** () const \
 *Return a string representation of the kernel.*

### Private Attributes

double **degree**\
 *The degree of the polynomial.*  double **offset**\
 *The offset of the dot product of the arguments.*

## Detailed Description

The simple polynomial kernel.

For any two vectors $ x $, $ y $, $ degree $ and $ offset $,

Definition at line 38 of file polynomial\_kernel.hpp.

## Constructor & Destructor Documentation

### mlpack::kernel::PolynomialKernel::PolynomialKernel (const doubledegree = `2.0`, const doubleoffset = `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.

**Parameters:**

*offset* Offset of the dot product of the arguments. \
 *degree* Degree of the polynomial.

Definition at line 48 of file polynomial\_kernel.hpp.

## Member Function Documentation

### 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::Degree ()` [inline]`

Modify the degree of the polynomial.

Definition at line 71 of file polynomial\_kernel.hpp.

References degree.

### template\<typename VecType \> 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.

**Template Parameters:**

*VecType* Type of vector (should be arma::vec or arma::spvec).

**Parameters:**

*a* First vector. \
 *b* Second vector.

**Returns:**

K(a, b).

Definition at line 63 of file polynomial\_kernel.hpp.

References degree, and 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::Offset ()` [inline]`

Modify the offset of the dot product of the arguments.

Definition at line 76 of file polynomial\_kernel.hpp.

References offset.

### std::string mlpack::kernel::PolynomialKernel::ToString () const` [inline]`

Return a string representation of the kernel.

Definition at line 79 of file polynomial\_kernel.hpp.

References degree, and offset.

## Member Data Documentation

### double mlpack::kernel::PolynomialKernel::degree` [private]`

The degree of the polynomial.

Definition at line 90 of file polynomial\_kernel.hpp.

Referenced by Degree(), Evaluate(), and ToString().

### double mlpack::kernel::PolynomialKernel::offset` [private]`

The offset of the dot product of the arguments.

Definition at line 92 of file polynomial\_kernel.hpp.

Referenced by Evaluate(), Offset(), and ToString().

## Author

Generated automatically by Doxygen for MLPACK from the source code.
