faif
Classes | Public Types | Public Member Functions | Friends | List of all members
faif::ml::Classifier< Val > Class Template Referenceabstract

the clasiffier interface More...

#include <Classifier.hpp>

Inheritance diagram for faif::ml::Classifier< Val >:
Inheritance graph
Collaboration diagram for faif::ml::Classifier< Val >:
Collaboration graph

Classes

class  ExamplesTrain
 inner class - examples train collection More...
 
struct  InitValueId
 the helping inner class to init PointAndFeature structure using getUnknownId method More...
 

Public Types

typedef Val Value
 
typedef Val::Value AttrValue
 attribute value representation in learning More...
 
typedef Val::DomainType AttrDomain
 the attribute domain for learning More...
 
typedef Val::DomainType::ValueId AttrIdd
 attribute id representation in learning More...
 
typedef Val::DomainType::ValueIdSerialize AttrIddSerialize
 for serialization the const interferes More...
 
typedef Space< AttrDomainDomains
 
typedef Belief< Val >::Beliefs Beliefs
 collection of pair (AttrIdd, Probability) More...
 
typedef Point< Val > ExampleTest
 the test example (collection of AttrIdd) More...
 
typedef PointAndFeature< Val, AttrIdd, InitValueIdExampleTrain
 the train example (test example and the category) More...
 

Public Member Functions

 Classifier (const Domains &attr_domains, const AttrDomain &category_domain)
 
const DomainsgetAttrDomains () const
 accessor More...
 
const AttrDomaingetCategoryDomain () const
 accessor More...
 
AttrIdd getCategoryIdd (const AttrValue &val) const
 accessor (helper) More...
 
virtual void reset ()=0
 the clasiffier will have no knowledge More...
 
virtual void train (const ExamplesTrain &)=0
 learn classifier (on the collection of training examples) More...
 
virtual AttrIdd getCategory (const ExampleTest &example) const =0
 classify More...
 
virtual Beliefs getCategories (const ExampleTest &example) const =0
 classify and return all classes with belief that the example is from each class classes are sorted from the best (index 0) to the worst More...
 
virtual void write (std::ostream &os) const
 

Friends

class boost::serialization::access
 serialization using boost::serialization More...
 

Detailed Description

template<typename Val>
class faif::ml::Classifier< Val >

the clasiffier interface

type definitions for AttrValue, AttrDomain, AttrIdd and others

Store attribute domains and category domain, methods to create training/testing example, load/save (boost::serialization), pure virtual for training and classifing.

Member Typedef Documentation

template<typename Val>
typedef Val::Value faif::ml::Classifier< Val >::AttrValue

attribute value representation in learning

template<typename Val>
typedef Val::DomainType faif::ml::Classifier< Val >::AttrDomain

the attribute domain for learning

template<typename Val>
typedef Val::DomainType::ValueId faif::ml::Classifier< Val >::AttrIdd

attribute id representation in learning

template<typename Val>
typedef Val::DomainType::ValueIdSerialize faif::ml::Classifier< Val >::AttrIddSerialize

for serialization the const interferes

template<typename Val>
typedef Space<AttrDomain> faif::ml::Classifier< Val >::Domains

the domain collection; the pointers should be valid

template<typename Val>
typedef Belief<Val>::Beliefs faif::ml::Classifier< Val >::Beliefs

collection of pair (AttrIdd, Probability)

template<typename Val>
typedef Point<Val> faif::ml::Classifier< Val >::ExampleTest

the test example (collection of AttrIdd)

template<typename Val>
typedef PointAndFeature<Val, AttrIdd, InitValueId> faif::ml::Classifier< Val >::ExampleTrain

the train example (test example and the category)

Member Function Documentation

template<typename Val>
const Domains& faif::ml::Classifier< Val >::getAttrDomains ( ) const
inline
template<typename Val>
const AttrDomain& faif::ml::Classifier< Val >::getCategoryDomain ( ) const
inline

accessor

Referenced by faif::ml::createExample().

template<typename Val>
AttrIdd faif::ml::Classifier< Val >::getCategoryIdd ( const AttrValue val) const
inline
template<typename Val>
virtual void faif::ml::Classifier< Val >::reset ( )
pure virtual
template<typename Val>
virtual void faif::ml::Classifier< Val >::train ( const ExamplesTrain )
pure virtual
template<typename Val>
virtual AttrIdd faif::ml::Classifier< Val >::getCategory ( const ExampleTest example) const
pure virtual
template<typename Val>
virtual Beliefs faif::ml::Classifier< Val >::getCategories ( const ExampleTest example) const
pure virtual

classify and return all classes with belief that the example is from each class classes are sorted from the best (index 0) to the worst

Implemented in faif::ml::RandomForest< Val >, faif::ml::KNearestNeighbor< Val, Distance >, faif::ml::DecisionTree< Val >, and faif::ml::NaiveBayesian< Val >.

Referenced by faif::ml::Classifier< Val >::getCategoryIdd().

template<typename Val >
void faif::ml::Classifier< Val >::write ( std::ostream &  os) const
virtual

Friends And Related Function Documentation

template<typename Val>
friend class boost::serialization::access
friend

serialization using boost::serialization


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