Public Member Functions
clsfy_classifier_base Class Reference

A common interface for 1-out-of-N classifiers. More...

#include <clsfy_classifier_base.h>

Inheritance diagram for clsfy_classifier_base:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 clsfy_classifier_base ()
virtual ~clsfy_classifier_base ()
virtual unsigned classify (const vnl_vector< double > &input) const
 Classify the input vector.
virtual void class_probabilities (vcl_vector< double > &outputs, const vnl_vector< double > &input) const =0
 Return the probability the input being in each class.
virtual void classify_many (vcl_vector< unsigned > &outputs, mbl_data_wrapper< vnl_vector< double > > &inputs) const
 Classify many input vectors.
virtual double log_l (const vnl_vector< double > &input) const =0
 Log likelihood of being in class (binary classifiers only).
virtual unsigned n_classes () const =0
 The number of possible output classes.
virtual unsigned n_dims () const =0
 The dimensionality of input vectors.
virtual vcl_string is_a () const
 Name of the class.
virtual bool is_class (vcl_string const &s) const
 Name of the class.
virtual clsfy_classifier_baseclone () const =0
 Create a copy on the heap and return base class pointer.
virtual void print_summary (vcl_ostream &os) const =0
 Print class to os.
virtual void b_write (vsl_b_ostream &bfs) const =0
 Save class to binary file stream.
virtual void b_read (vsl_b_istream &bfs)=0
 Load class from binary file stream.

Detailed Description

A common interface for 1-out-of-N classifiers.

This class takes a vector and classifies into one of N classes.

Derived classes with binary in the name indicates that the classifier works with only two classes, 0 and 1.

Definition at line 29 of file clsfy_classifier_base.h.


Constructor & Destructor Documentation

clsfy_classifier_base::clsfy_classifier_base ( ) [inline]

Definition at line 34 of file clsfy_classifier_base.h.

virtual clsfy_classifier_base::~clsfy_classifier_base ( ) [inline, virtual]

Definition at line 37 of file clsfy_classifier_base.h.


Member Function Documentation

virtual void clsfy_classifier_base::b_read ( vsl_b_istream bfs) [pure virtual]
virtual void clsfy_classifier_base::b_write ( vsl_b_ostream bfs) const [pure virtual]
virtual void clsfy_classifier_base::class_probabilities ( vcl_vector< double > &  outputs,
const vnl_vector< double > &  input 
) const [pure virtual]

Return the probability the input being in each class.

output(i) 0<=i<nClasses, contains the probability that the input is in class i

Implemented in clsfy_binary_tree, clsfy_direct_boost, clsfy_simple_adaboost, clsfy_rbf_svm, clsfy_rbf_parzen, clsfy_binary_pdf_classifier, clsfy_random_classifier, clsfy_k_nearest_neighbour, clsfy_random_forest, clsfy_binary_hyperplane, clsfy_null_classifier, and clsfy_binary_1d_wrapper.

unsigned clsfy_classifier_base::classify ( const vnl_vector< double > &  input) const [virtual]

Classify the input vector.

returns a number between 0 and nClasses-1 inclusive to represent the most likely class

Reimplemented in clsfy_binary_tree, clsfy_direct_boost, clsfy_simple_adaboost, clsfy_rbf_svm, clsfy_rbf_parzen, clsfy_binary_pdf_classifier, clsfy_k_nearest_neighbour, clsfy_binary_1d_wrapper, clsfy_binary_hyperplane, and clsfy_random_forest.

Definition at line 21 of file clsfy_classifier_base.cxx.

void clsfy_classifier_base::classify_many ( vcl_vector< unsigned > &  outputs,
mbl_data_wrapper< vnl_vector< double > > &  inputs 
) const [virtual]

Classify many input vectors.

Definition at line 55 of file clsfy_classifier_base.cxx.

virtual clsfy_classifier_base* clsfy_classifier_base::clone ( ) const [pure virtual]
vcl_string clsfy_classifier_base::is_a ( ) const [virtual]
bool clsfy_classifier_base::is_class ( vcl_string const &  s) const [virtual]
virtual double clsfy_classifier_base::log_l ( const vnl_vector< double > &  input) const [pure virtual]

Log likelihood of being in class (binary classifiers only).

class probability = 1 / (1+exp(-log_l)) Operation of this method is undefined for multiclass classifiers

Implemented in clsfy_binary_tree, clsfy_direct_boost, clsfy_simple_adaboost, clsfy_rbf_svm, clsfy_rbf_parzen, clsfy_binary_pdf_classifier, clsfy_random_classifier, clsfy_k_nearest_neighbour, clsfy_binary_1d_wrapper, clsfy_binary_hyperplane, clsfy_random_forest, and clsfy_null_classifier.

virtual unsigned clsfy_classifier_base::n_classes ( ) const [pure virtual]
virtual unsigned clsfy_classifier_base::n_dims ( ) const [pure virtual]
virtual void clsfy_classifier_base::print_summary ( vcl_ostream &  os) const [pure virtual]

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