#include <yat/classifier/Kernel_SEV.h>
Public Member Functions | |
Kernel_SEV (const MatrixLookup &, const KernelFunction &, const bool own=false) | |
Kernel_SEV (const MatrixLookupWeighted &, const KernelFunction &, const bool own=false) | |
Kernel_SEV (const Kernel_SEV &kernel, const std::vector< size_t > &index) | |
const Kernel_SEV * | make_kernel (const MatrixLookup &, const bool own=false) const |
const Kernel_SEV * | make_kernel (const MatrixLookupWeighted &, const bool own=false) const |
double | operator() (const size_t row, const size_t column) const |
const MatrixLookup & | data (void) const |
const MatrixLookupWeighted & | data_weighted (void) const |
double | element (const DataLookup1D &vec, const size_t i) const |
double | element (const DataLookupWeighted1D &vec, const size_t i) const |
size_t | size (void) const |
number of samples | |
bool | weighted (void) const |
Protected Attributes | |
const MatrixLookup * | ml_ |
underlying data | |
const MatrixLookupWeighted * | mlw_ |
same as data_ if weifghted otherwise a NULL pointer | |
const KernelFunction * | kf_ |
type of Kernel Function e.g. Gaussian (aka RBF) | |
unsigned int * | ref_count_ |
unsigned int * | ref_count_w_ |
Class taking care of the kernel matrix, where is number of samples. Type of Kernel is defined by a KernelFunction. This Speed Efficient Version (SEV) calculates the kernel matrix once by construction and the kernel is stored in memory. When is large and the kernel matrix cannot be stored in memory, use Kernel_MEV instead.
theplu::yat::classifier::Kernel_SEV::Kernel_SEV | ( | const MatrixLookup & | , | |
const KernelFunction & | , | |||
const bool | own = false | |||
) |
Constructor taking the data matrix and KernelFunction as input.
theplu::yat::classifier::Kernel_SEV::Kernel_SEV | ( | const MatrixLookupWeighted & | , | |
const KernelFunction & | , | |||
const bool | own = false | |||
) |
Constructor taking the data matrix and KernelFunction as input.
theplu::yat::classifier::Kernel_SEV::Kernel_SEV | ( | const Kernel_SEV & | kernel, | |
const std::vector< size_t > & | index | |||
) |
Constructs a Kernel based on selected features defined by index
const MatrixLookup& theplu::yat::classifier::Kernel::data | ( | void | ) | const [inherited] |
if | data is weighted |
const MatrixLookupWeighted& theplu::yat::classifier::Kernel::data_weighted | ( | void | ) | const [inherited] |
if | data is unweighted |
double theplu::yat::classifier::Kernel::element | ( | const DataLookupWeighted1D & | vec, | |
const size_t | i | |||
) | const [inherited] |
Calculates the weighted scalar product (using the KernelFunction) between vector vec and the th column in the data matrix. Using a weight vector with all elements equal to unity yields same result as the non-weighted version above.
double theplu::yat::classifier::Kernel::element | ( | const DataLookup1D & | vec, | |
const size_t | i | |||
) | const [inherited] |
Calculates the scalar product (using the KernelFunction) between vector vec and the th column in the data matrix.
const Kernel_SEV* theplu::yat::classifier::Kernel_SEV::make_kernel | ( | const MatrixLookupWeighted & | , | |
const bool | own = false | |||
) | const [virtual] |
An interface for making new classifier objects. This function allows for specification at run-time of which kernel to instatiate (see 'Prototype' in Design Patterns).
Implements theplu::yat::classifier::Kernel.
const Kernel_SEV* theplu::yat::classifier::Kernel_SEV::make_kernel | ( | const MatrixLookup & | , | |
const bool | own = false | |||
) | const [virtual] |
An interface for making new classifier objects. This function allows for specification at run-time of which kernel to instatiate (see 'Prototype' in Design Patterns).
Implements theplu::yat::classifier::Kernel.
double theplu::yat::classifier::Kernel_SEV::operator() | ( | const size_t | row, | |
const size_t | column | |||
) | const [virtual] |
Implements theplu::yat::classifier::Kernel.
bool theplu::yat::classifier::Kernel::weighted | ( | void | ) | const [inherited] |
unsigned int* theplu::yat::classifier::Kernel::ref_count_ [protected, inherited] |
pointer telling how many owners to underlying data (data_). NULL if this is not an owner.
unsigned int* theplu::yat::classifier::Kernel::ref_count_w_ [protected, inherited] |
pointer telling how many owners to underlying weights (data_w_). NULL if this is not an owner.