Public Member Functions | Static Public Member Functions
clsfy_mean_square_1d_builder Class Reference

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

#include <clsfy_mean_square_1d_builder.h>

Inheritance diagram for clsfy_mean_square_1d_builder:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 clsfy_mean_square_1d_builder ()
virtual ~clsfy_mean_square_1d_builder ()
virtual clsfy_classifier_1dnew_classifier () const
 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
 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
 Build a mean_square classifier.
virtual double build_from_sorted_data (clsfy_classifier_1d &classifier, const vbl_triple< double, int, int > *data, const vnl_vector< double > &wts) const
 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.
short version_no () const
 Version number for I/O.
virtual clsfy_builder_1dclone () const
 Create a copy on the heap and return base class pointer.
virtual void print_summary (vcl_ostream &os) const
 Print class to os.
virtual void b_write (vsl_b_ostream &bfs) const
 Save class to binary file stream.
virtual void b_read (vsl_b_istream &bfs)
 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 17 of file clsfy_mean_square_1d_builder.h.


Constructor & Destructor Documentation

clsfy_mean_square_1d_builder::clsfy_mean_square_1d_builder ( )

Definition at line 21 of file clsfy_mean_square_1d_builder.cxx.

clsfy_mean_square_1d_builder::~clsfy_mean_square_1d_builder ( ) [virtual]

Definition at line 27 of file clsfy_mean_square_1d_builder.cxx.


Member Function Documentation

void clsfy_mean_square_1d_builder::b_read ( vsl_b_istream bfs) [virtual]

Load class from binary file stream.

Implements clsfy_builder_1d.

Definition at line 362 of file clsfy_mean_square_1d_builder.cxx.

void clsfy_mean_square_1d_builder::b_write ( vsl_b_ostream bfs) const [virtual]

Save class to binary file stream.

Implements clsfy_builder_1d.

Definition at line 351 of file clsfy_mean_square_1d_builder.cxx.

double clsfy_mean_square_1d_builder::build ( clsfy_classifier_1d classifier,
const vnl_vector< double > &  egs,
const vnl_vector< double > &  wts,
const vcl_vector< unsigned > &  outputs 
) const [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.

Implements clsfy_builder_1d.

Definition at line 53 of file clsfy_mean_square_1d_builder.cxx.

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

Build a mean_square 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.

nb here egs0 are -ve examples and egs1 are +ve examples

Implements clsfy_builder_1d.

Definition at line 161 of file clsfy_mean_square_1d_builder.cxx.

double clsfy_mean_square_1d_builder::build_from_sorted_data ( clsfy_classifier_1d classifier,
const vbl_triple< double, int, int > *  data,
const vnl_vector< double > &  wts 
) const [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

Assumes two classes

Implements clsfy_builder_1d.

Definition at line 270 of file clsfy_mean_square_1d_builder.cxx.

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

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

Implements clsfy_builder_1d.

Definition at line 332 of file clsfy_mean_square_1d_builder.cxx.

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

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_mean_square_1d_builder::is_a ( ) const [virtual]

Name of the class.

Reimplemented from clsfy_builder_1d.

Definition at line 286 of file clsfy_mean_square_1d_builder.cxx.

bool clsfy_mean_square_1d_builder::is_class ( vcl_string const &  s) const [virtual]

Name of the class.

Reimplemented from clsfy_builder_1d.

Definition at line 291 of file clsfy_mean_square_1d_builder.cxx.

vcl_auto_ptr< clsfy_builder_1d > clsfy_builder_1d::new_builder ( vcl_istream &  as) [static, inherited]

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.

clsfy_classifier_1d * clsfy_mean_square_1d_builder::new_classifier ( ) const [virtual]

Create empty model.

Create empty classifier.

Caller is responsible for deletion

Implements clsfy_builder_1d.

Definition at line 41 of file clsfy_mean_square_1d_builder.cxx.

void clsfy_mean_square_1d_builder::print_summary ( vcl_ostream &  os) const [virtual]

Print class to os.

Implements clsfy_builder_1d.

Definition at line 340 of file clsfy_mean_square_1d_builder.cxx.

short clsfy_mean_square_1d_builder::version_no ( ) const

Version number for I/O.

Definition at line 33 of file clsfy_mean_square_1d_builder.cxx.


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