shark::KernelMeanClassifier< InputType > Class Template Reference

Kernelized mean-classifier. More...

#include <shark/Algorithms/Trainers/KernelMeanClassifier.h>

+ Inheritance diagram for shark::KernelMeanClassifier< InputType >:

Public Member Functions

 KernelMeanClassifier (AbstractKernelFunction< InputType > *kernel)
 
std::string name () const
 returns the name of the object
 
void train (KernelClassifier< InputType > &model, WeightedLabeledData< InputType, unsigned int > const &dataset)
 
- Public Member Functions inherited from shark::AbstractWeightedTrainer< KernelClassifier< InputType >, unsigned int >
virtual void train (ModelType &model, WeightedDatasetType const &dataset)=0
 Executes the algorithm and trains a model on the given weighted data.
 
virtual void train (ModelType &model, DatasetType const &dataset)
 Executes the algorithm and trains a model on the given unweighted data.
 
- Public Member Functions inherited from shark::AbstractTrainer< Model, LabelTypeT >
virtual void train (ModelType &model, DatasetType const &dataset)=0
 Core of the Trainer interface.
 
- Public Member Functions inherited from shark::INameable
virtual ~INameable ()
 
- Public Member Functions inherited from shark::ISerializable
virtual ~ISerializable ()
 Virtual d'tor.
 
virtual void read (InArchive &archive)
 Read the component from the supplied archive.
 
virtual void write (OutArchive &archive) const
 Write the component to the supplied archive.
 
void load (InArchive &archive, unsigned int version)
 Versioned loading of components, calls read(...).
 
void save (OutArchive &archive, unsigned int version) const
 Versioned storing of components, calls write(...).
 
 BOOST_SERIALIZATION_SPLIT_MEMBER ()
 

Public Attributes

AbstractKernelFunction< InputType > * mpe_kernel
 

Additional Inherited Members

- Public Types inherited from shark::AbstractWeightedTrainer< KernelClassifier< InputType >, unsigned int >
typedef base_type::ModelType ModelType
 
typedef base_type::InputType InputType
 
typedef base_type::LabelType LabelType
 
typedef base_type::DatasetType DatasetType
 
typedef WeightedLabeledData< InputType, LabelTypeWeightedDatasetType
 
- Public Types inherited from shark::AbstractTrainer< Model, LabelTypeT >
typedef Model ModelType
 
typedef ModelType::InputType InputType
 
typedef LabelTypeT LabelType
 
typedef LabeledData< InputType, LabelTypeDatasetType
 

Detailed Description

template<class InputType>
class shark::KernelMeanClassifier< InputType >

Kernelized mean-classifier.

Computes the mean of the training data in feature space for each class and assigns a new data point to the class with the nearest mean. The trainer supports multi-class and weighted data

The resulting classifier is a kernel expansion as assigning the label with minimum distance (or maximum negative distance by convention for classifiers)

\[ max -1/2 ||\phi(x) - m_i||^2 = <\phi(x), m_i> - 1/2<m_i,m_i> \]

Definition at line 55 of file KernelMeanClassifier.h.

Constructor & Destructor Documentation

◆ KernelMeanClassifier()

template<class InputType >
shark::KernelMeanClassifier< InputType >::KernelMeanClassifier ( AbstractKernelFunction< InputType > *  kernel)
inline

Definition at line 57 of file KernelMeanClassifier.h.

Member Function Documentation

◆ name()

template<class InputType >
std::string shark::KernelMeanClassifier< InputType >::name ( ) const
inlinevirtual

returns the name of the object

Reimplemented from shark::INameable.

Definition at line 59 of file KernelMeanClassifier.h.

◆ train()

Member Data Documentation

◆ mpe_kernel


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