Public Member Functions | Static Public Member Functions | Private Attributes
clsfy_binary_1d_wrapper_builder Class Reference

Wrap a builder_1d in general builder_base derivative. More...

#include <clsfy_binary_1d_wrapper_builder.h>

Inheritance diagram for clsfy_binary_1d_wrapper_builder:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 clsfy_binary_1d_wrapper_builder ()
void set_builder_1d (const clsfy_builder_1d &builder)
 Set the underlying builder.
const clsfy_builder_1dbuilder_1d () const
 Get the underlying builder.
virtual clsfy_classifier_basenew_classifier () const
 Create a new untrained linear classifier with binary output.
double build (clsfy_classifier_base &classifier, mbl_data_wrapper< vnl_vector< double > > &inputs, const vcl_vector< unsigned > &outputs) const
 Build a linear classifier, with the given data.
double build (clsfy_classifier_base &classifier, mbl_data_wrapper< vnl_vector< double > > &inputs, unsigned n_classes, const vcl_vector< unsigned > &outputs) const
 Build a linear classifier, with the given data.
vcl_string is_a () const
 Name of the class.
virtual bool is_class (vcl_string const &s) const
 Name of the class.
void print_summary (vcl_ostream &os) const
 Print class to os.
virtual clsfy_builder_baseclone () const
 Create a deep copy.
virtual void b_write (vsl_b_ostream &) const
 Save class to binary file stream.
virtual void b_read (vsl_b_istream &)
 Load class from binary file stream.
void config (vcl_istream &as)
 Initialise the parameters from a text stream.

Static Public Member Functions

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

Private Attributes

mbl_cloneable_nzptr
< clsfy_builder_1d
builder_1d_

Detailed Description

Wrap a builder_1d in general builder_base derivative.

Definition at line 18 of file clsfy_binary_1d_wrapper_builder.h.


Constructor & Destructor Documentation

clsfy_binary_1d_wrapper_builder::clsfy_binary_1d_wrapper_builder ( )

Definition at line 23 of file clsfy_binary_1d_wrapper_builder.cxx.


Member Function Documentation

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

Load class from binary file stream.

Implements clsfy_builder_base.

Definition at line 117 of file clsfy_binary_1d_wrapper_builder.cxx.

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

Save class to binary file stream.

Implements clsfy_builder_base.

Definition at line 108 of file clsfy_binary_1d_wrapper_builder.cxx.

double clsfy_binary_1d_wrapper_builder::build ( clsfy_classifier_base classifier,
mbl_data_wrapper< vnl_vector< double > > &  inputs,
const vcl_vector< unsigned > &  outputs 
) const

Build a linear classifier, with the given data.

Build a multi layer perceptron classifier, with the given data.

Return the mean error over the training set.

Definition at line 62 of file clsfy_binary_1d_wrapper_builder.cxx.

double clsfy_binary_1d_wrapper_builder::build ( clsfy_classifier_base classifier,
mbl_data_wrapper< vnl_vector< double > > &  inputs,
unsigned  n_classes,
const vcl_vector< unsigned > &  outputs 
) const [virtual]

Build a linear classifier, with the given data.

Return the mean error over the training set. n_classes must be 1

Return the mean error over the training set. n_classes must be 1.

Implements clsfy_builder_base.

Definition at line 98 of file clsfy_binary_1d_wrapper_builder.cxx.

const clsfy_builder_1d& clsfy_binary_1d_wrapper_builder::builder_1d ( ) const [inline]

Get the underlying builder.

Definition at line 33 of file clsfy_binary_1d_wrapper_builder.h.

virtual clsfy_builder_base* clsfy_binary_1d_wrapper_builder::clone ( ) const [inline, virtual]

Create a deep copy.

client is responsible for deleting returned object.

Implements clsfy_builder_base.

Definition at line 64 of file clsfy_binary_1d_wrapper_builder.h.

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

Initialise the parameters from a text stream.

The next non-ws character in the stream should be a '{'

   {
     builder_1d: clsfy_binary_threshold_1d_builder  (required, underlying builder)
   }
   
Exceptions:
mbl_exception_parse_errorif the parse fails.

Reimplemented from clsfy_builder_base.

Definition at line 145 of file clsfy_binary_1d_wrapper_builder.cxx.

vcl_string clsfy_binary_1d_wrapper_builder::is_a ( ) const [virtual]

Name of the class.

Reimplemented from clsfy_builder_base.

Definition at line 40 of file clsfy_binary_1d_wrapper_builder.cxx.

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

Name of the class.

Reimplemented from clsfy_builder_base.

Definition at line 47 of file clsfy_binary_1d_wrapper_builder.cxx.

vcl_auto_ptr< clsfy_builder_base > clsfy_builder_base::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_base derivative and return that.

Exceptions:
ifthe parse fails.

Definition at line 42 of file clsfy_builder_base.cxx.

clsfy_classifier_base * clsfy_binary_1d_wrapper_builder::new_classifier ( ) const [virtual]

Create a new untrained linear classifier with binary output.

Implements clsfy_builder_base.

Definition at line 28 of file clsfy_binary_1d_wrapper_builder.cxx.

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

Print class to os.

Implements clsfy_builder_base.

Definition at line 54 of file clsfy_binary_1d_wrapper_builder.cxx.

void clsfy_binary_1d_wrapper_builder::set_builder_1d ( const clsfy_builder_1d builder) [inline]

Set the underlying builder.

The object will take and maintain its own deep copy of the data. This method should only be used by builders.

Definition at line 29 of file clsfy_binary_1d_wrapper_builder.h.


Member Data Documentation

Definition at line 20 of file clsfy_binary_1d_wrapper_builder.h.


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