Wrap a builder_1d in general builder_base derivative. More...
#include <clsfy_binary_1d_wrapper_builder.h>
Public Member Functions | |
clsfy_binary_1d_wrapper_builder () | |
void | set_builder_1d (const clsfy_builder_1d &builder) |
Set the underlying builder. | |
const clsfy_builder_1d & | builder_1d () const |
Get the underlying builder. | |
virtual clsfy_classifier_base * | new_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_base * | clone () 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_ |
Wrap a builder_1d in general builder_base derivative.
Definition at line 18 of file clsfy_binary_1d_wrapper_builder.h.
clsfy_binary_1d_wrapper_builder::clsfy_binary_1d_wrapper_builder | ( | ) |
Definition at line 23 of file clsfy_binary_1d_wrapper_builder.cxx.
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) }
mbl_exception_parse_error | if 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.
if | the 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.
Definition at line 20 of file clsfy_binary_1d_wrapper_builder.h.