MLPACK  1.0.10
Public Member Functions | Private Attributes | List of all members
mlpack::kernel::EpanechnikovKernel Class Reference

The Epanechnikov kernel, defined as. More...

Public Member Functions

 EpanechnikovKernel (const double bandwidth=1.0)
 Instantiate the Epanechnikov kernel with the given bandwidth (default 1.0). More...
 
template<typename VecType >
double ConvolutionIntegral (const VecType &a, const VecType &b)
 Obtains the convolution integral [integral of K(||x-a||) K(||b-x||) dx] for the two vectors. More...
 
template<typename Vec1Type , typename Vec2Type >
double Evaluate (const Vec1Type &a, const Vec2Type &b) const
 Evaluate the Epanechnikov kernel on the given two inputs. More...
 
double Evaluate (const double distance) const
 Evaluate the Epanechnikov kernel given that the distance between the two input points is known. More...
 
double Normalizer (const size_t dimension)
 Compute the normalizer of this Epanechnikov kernel for the given dimension. More...
 
std::string ToString () const
 

Private Attributes

double bandwidth
 Bandwidth of the kernel. More...
 
double inverseBandwidthSquared
 Cached value of the inverse bandwidth squared (to speed up computation). More...
 

Detailed Description

The Epanechnikov kernel, defined as.

\[ K(x, y) = \max \{0, 1 - || x - y ||^2_2 / b^2 \} \]

where $ b $ is the bandwidth the of the kernel (defaults to 1.0).

Definition at line 39 of file epanechnikov_kernel.hpp.

Constructor & Destructor Documentation

mlpack::kernel::EpanechnikovKernel::EpanechnikovKernel ( const double  bandwidth = 1.0)
inline

Instantiate the Epanechnikov kernel with the given bandwidth (default 1.0).

Parameters
bandwidthBandwidth of the kernel.

Definition at line 47 of file epanechnikov_kernel.hpp.

Member Function Documentation

template<typename VecType >
double mlpack::kernel::EpanechnikovKernel::ConvolutionIntegral ( const VecType &  a,
const VecType &  b 
)

Obtains the convolution integral [integral of K(||x-a||) K(||b-x||) dx] for the two vectors.

Template Parameters
VecTypeType of vector (arma::vec, arma::spvec should be expected).
Parameters
aFirst vector.
bSecond vector.
Returns
the convolution integral value.
template<typename Vec1Type , typename Vec2Type >
double mlpack::kernel::EpanechnikovKernel::Evaluate ( const Vec1Type &  a,
const Vec2Type &  b 
) const

Evaluate the Epanechnikov kernel on the given two inputs.

Parameters
aOne input vector.
bThe other input vector.
double mlpack::kernel::EpanechnikovKernel::Evaluate ( const double  distance) const

Evaluate the Epanechnikov kernel given that the distance between the two input points is known.

double mlpack::kernel::EpanechnikovKernel::Normalizer ( const size_t  dimension)

Compute the normalizer of this Epanechnikov kernel for the given dimension.

Parameters
dimensionDimension to calculate the normalizer for.
std::string mlpack::kernel::EpanechnikovKernel::ToString ( ) const

Member Data Documentation

double mlpack::kernel::EpanechnikovKernel::bandwidth
private

Bandwidth of the kernel.

Definition at line 92 of file epanechnikov_kernel.hpp.

double mlpack::kernel::EpanechnikovKernel::inverseBandwidthSquared
private

Cached value of the inverse bandwidth squared (to speed up computation).

Definition at line 94 of file epanechnikov_kernel.hpp.


The documentation for this class was generated from the following file: