strumpack::kernel::ANOVAKernel< scalar_t > Class Template Reference

ANOVA kernel. More...

#include <Kernel.hpp>

Inheritance diagram for strumpack::kernel::ANOVAKernel< scalar_t >:
Collaboration diagram for strumpack::kernel::ANOVAKernel< scalar_t >:

Public Member Functions

 ANOVAKernel (DenseMatrix< scalar_t > &data, scalar_t h, scalar_t lambda, int p=1)
 
- Public Member Functions inherited from strumpack::kernel::Kernel< scalar_t >
 Kernel (DenseM_t &data, scalar_t lambda)
 
virtual ~Kernel ()=default
 
std::size_t n () const
 
std::size_t d () const
 
virtual scalar_t eval (std::size_t i, std::size_t j) const
 
void operator() (const std::vector< std::size_t > &I, const std::vector< std::size_t > &J, DenseMatrix< real_t > &B) const
 
void operator() (const std::vector< std::size_t > &I, const std::vector< std::size_t > &J, DenseMatrix< std::complex< real_t >> &B) const
 
DenseM_t fit_HSS (std::vector< scalar_t > &labels, const HSS::HSSOptions< scalar_t > &opts)
 
std::vector< scalar_t > predict (const DenseM_t &test, const DenseM_t &weights) const
 
DistM_t fit_HSS (const BLACSGrid &grid, std::vector< scalar_t > &labels, const HSS::HSSOptions< scalar_t > &opts)
 
std::vector< scalar_t > predict (const DenseM_t &test, const DistM_t &weights) const
 
DenseM_t fit_HODLR (const MPIComm &c, std::vector< scalar_t > &labels, const HODLR::HODLROptions< scalar_t > &opts)
 
const DenseM_tdata () const
 
DenseM_tdata ()
 
std::vector< int > & permutation ()
 
const std::vector< int > & permutation () const
 
virtual void permute ()
 

Detailed Description

template<typename scalar_t>
class strumpack::kernel::ANOVAKernel< scalar_t >

ANOVA kernel.

Implements the kernel: \( \sum_{1\leq k_1<...<k_p\leq n}k(x^{k_1},y^{k_1})\times...\times k(x^{k_p},y^{k_p}), with k(x,y)=\exp \left( -\frac{\|x-y\|_2^2}{2 h^2} \right)\), with an extra regularization parameter lambda on the diagonal. The kernel is implemented efficiently due to the recurrence relation in "Support Vector Regression with ANOVA Decomposition Kernels", 1999.

This is a subclass of Kernel. It only implements the (protected) eval_kernel_function routine, the rest of the functionality is inherited. To create your own kernel, simply copy this class, rename and change the eval_kernel_function implementation.

See also
Kernel, GaussKernel

Constructor & Destructor Documentation

◆ ANOVAKernel()

template<typename scalar_t >
strumpack::kernel::ANOVAKernel< scalar_t >::ANOVAKernel ( DenseMatrix< scalar_t > &  data,
scalar_t  h,
scalar_t  lambda,
int  p = 1 
)
inline

Constructor of the kernel object.

Parameters
dataData defining the kernel matrix. data.rows() is the number of features, and data.cols() is the number of data points, ie, the dimension of the kernel matrix.
hKernel width
lambdaRegularization parameter, added to the diagonal
pKernel degree (1 <= p_ <= this->d())

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