Public Member Functions | Static Public Member Functions
clsfy_builder_1d Class Reference

Base for classes to build clsfy_classifier_1d objects. More...

#include <clsfy_builder_1d.h>

Inheritance diagram for clsfy_builder_1d:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~clsfy_builder_1d ()
virtual clsfy_classifier_1dnew_classifier () const =0
 Create empty model.
virtual double build (clsfy_classifier_1d &classifier, const vnl_vector< double > &egs, const vnl_vector< double > &wts, const vcl_vector< unsigned > &outputs) const =0
 Build a binary_threshold classifier.
virtual double build (clsfy_classifier_1d &classifier, vnl_vector< double > &egs0, vnl_vector< double > &wts0, vnl_vector< double > &egs1, vnl_vector< double > &wts1) const =0
 Build a binary_threshold classifier.
virtual double build_from_sorted_data (clsfy_classifier_1d &classifier, const vbl_triple< double, int, int > *data, const vnl_vector< double > &wts) const =0
 Train classifier, returning weighted error.
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_builder_1dclone () 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.
virtual void config (vcl_istream &as)
 Initialise the parameters from a text stream.

Static Public Member Functions

static vcl_auto_ptr
< clsfy_builder_1d
new_builder (vcl_istream &as)
 Load description from a text stream.

Detailed Description

Base for classes to build clsfy_classifier_1d objects.

Definition at line 20 of file clsfy_builder_1d.h.


Constructor & Destructor Documentation

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

Definition at line 25 of file clsfy_builder_1d.h.


Member Function Documentation

virtual void clsfy_builder_1d::b_read ( vsl_b_istream bfs) [pure virtual]
virtual void clsfy_builder_1d::b_write ( vsl_b_ostream bfs) const [pure virtual]
virtual double clsfy_builder_1d::build ( clsfy_classifier_1d classifier,
const vnl_vector< double > &  egs,
const vnl_vector< double > &  wts,
const vcl_vector< unsigned > &  outputs 
) const [pure virtual]

Build a binary_threshold classifier.

Train classifier, returning weighted error Selects parameters of classifier which best separate examples from two classes, weighting examples appropriately when estimating the misclassification rate. Returns weighted sum of error, e.wts, where e_i =0 for correct classifications, e_i=1 for incorrect.

Implemented in clsfy_binary_threshold_1d_builder, and clsfy_mean_square_1d_builder.

virtual double clsfy_builder_1d::build ( clsfy_classifier_1d classifier,
vnl_vector< double > &  egs0,
vnl_vector< double > &  wts0,
vnl_vector< double > &  egs1,
vnl_vector< double > &  wts1 
) const [pure virtual]

Build a binary_threshold classifier.

Train classifier, returning weighted error Selects parameters of classifier which best separate examples from two classes, weighting examples appropriately when estimating the misclassification rate. Returns weighted sum of error, e.wts, where e_i =0 for correct classifications, e_i=1 for incorrect.

Implemented in clsfy_binary_threshold_1d_builder, and clsfy_mean_square_1d_builder.

virtual double clsfy_builder_1d::build_from_sorted_data ( clsfy_classifier_1d classifier,
const vbl_triple< double, int, int > *  data,
const vnl_vector< double > &  wts 
) const [pure virtual]

Train classifier, returning weighted error.

Selects parameters of classifier which best separate examples, weighting examples appropriately when estimating the misclassification rate. data[i] is a triple, {value,class_number,weight} Returns weighted sum of error. Note that input "data" must be sorted to use this routine

Implemented in clsfy_binary_threshold_1d_builder, and clsfy_mean_square_1d_builder.

virtual clsfy_builder_1d* clsfy_builder_1d::clone ( ) const [pure virtual]

Create a copy on the heap and return base class pointer.

Implemented in clsfy_binary_threshold_1d_builder, clsfy_mean_square_1d_builder, and clsfy_binary_threshold_1d_gini_builder.

void clsfy_builder_1d::config ( vcl_istream &  as) [virtual]

Initialise the parameters from a text stream.

Default case accepts no parameters.

Definition at line 37 of file clsfy_builder_1d.cxx.

vcl_string clsfy_builder_1d::is_a ( ) const [virtual]
bool clsfy_builder_1d::is_class ( vcl_string const &  s) const [virtual]
vcl_auto_ptr< clsfy_builder_1d > clsfy_builder_1d::new_builder ( vcl_istream &  as) [static]

Load description from a text stream.

The stream should contain the name of the feature extractor class that will be used, followed by a brace-enclosed list of parameters for the builder. This function will construct the appropriate clsfy_builder_1d derivative and return that.

Exceptions:
ifthe parse fails.

Definition at line 53 of file clsfy_builder_1d.cxx.

virtual clsfy_classifier_1d* clsfy_builder_1d::new_classifier ( ) const [pure virtual]
virtual void clsfy_builder_1d::print_summary ( vcl_ostream &  os) const [pure virtual]

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