Builds clsfy_random_classifier classifiers. More...
#include <clsfy_random_builder.h>
Public Member Functions | |
clsfy_random_builder () | |
virtual clsfy_classifier_base * | new_classifier () const |
Create empty model. | |
virtual double | build (clsfy_classifier_base &model, mbl_data_wrapper< vnl_vector< double > > &inputs, unsigned nClasses, const vcl_vector< unsigned > &outputs) const |
Build classifier from data. | |
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 |
IO Version number. | |
virtual clsfy_builder_base * | clone () 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. | |
double | confidence () const |
The standard deviation of confidence noise added to class probabilities. | |
void | set_confidence (double) |
Set the standard deviation of confidence noise added to class probabilities. | |
virtual 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 | |
double | confidence_ |
Standard deviation of confidence noise added to class probabilities. |
Builds clsfy_random_classifier classifiers.
This class doesn't do any calculation, it is easy to create a random classifier directly - but it allows for consistent swappable classifiers.
Definition at line 28 of file clsfy_random_builder.h.
clsfy_random_builder::clsfy_random_builder | ( | ) |
Definition at line 23 of file clsfy_random_builder.cxx.
void clsfy_random_builder::b_read | ( | vsl_b_istream & | bfs | ) | [virtual] |
Load class from binary file stream.
Implements clsfy_builder_base.
Definition at line 72 of file clsfy_random_builder.cxx.
void clsfy_random_builder::b_write | ( | vsl_b_ostream & | bfs | ) | const [virtual] |
Save class to binary file stream.
Implements clsfy_builder_base.
Definition at line 64 of file clsfy_random_builder.cxx.
double clsfy_random_builder::build | ( | clsfy_classifier_base & | model, |
mbl_data_wrapper< vnl_vector< double > > & | inputs, | ||
unsigned | nClasses, | ||
const vcl_vector< unsigned > & | outputs | ||
) | const [virtual] |
Build classifier from data.
Build model from data.
return the mean error over the training set.
return the mean error over the training set. For many classifiers, you may use nClasses==1 to indicate a binary classifier
Implements clsfy_builder_base.
Definition at line 96 of file clsfy_random_builder.cxx.
clsfy_builder_base * clsfy_random_builder::clone | ( | ) | const [virtual] |
Create a copy on the heap and return base class pointer.
Implements clsfy_builder_base.
Definition at line 50 of file clsfy_random_builder.cxx.
double clsfy_random_builder::confidence | ( | ) | const |
The standard deviation of confidence noise added to class probabilities.
Definition at line 131 of file clsfy_random_builder.cxx.
void clsfy_builder_base::config | ( | vcl_istream & | as | ) | [virtual, inherited] |
Initialise the parameters from a text stream.
Default case accepts no parameters.
Reimplemented in clsfy_rbf_svm_smo_1_builder, clsfy_parzen_builder, clsfy_knn_builder, clsfy_null_builder, and clsfy_binary_1d_wrapper_builder.
Definition at line 26 of file clsfy_builder_base.cxx.
vcl_string clsfy_random_builder::is_a | ( | ) | const [virtual] |
Name of the class.
Reimplemented from clsfy_builder_base.
Definition at line 36 of file clsfy_random_builder.cxx.
bool clsfy_random_builder::is_class | ( | vcl_string const & | s | ) | const [virtual] |
Name of the class.
Reimplemented from clsfy_builder_base.
Definition at line 43 of file clsfy_random_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_random_builder::new_classifier | ( | ) | const [virtual] |
Create empty model.
Create empty classifier.
Caller is responsible for deletion
Implements clsfy_builder_base.
Definition at line 147 of file clsfy_random_builder.cxx.
void clsfy_random_builder::print_summary | ( | vcl_ostream & | os | ) | const [virtual] |
Print class to os.
Implements clsfy_builder_base.
Definition at line 57 of file clsfy_random_builder.cxx.
void clsfy_random_builder::set_confidence | ( | double | confidence | ) |
Set the standard deviation of confidence noise added to class probabilities.
Definition at line 138 of file clsfy_random_builder.cxx.
short clsfy_random_builder::version_no | ( | ) | const |
IO Version number.
Definition at line 29 of file clsfy_random_builder.cxx.
double clsfy_random_builder::confidence_ [private] |
Standard deviation of confidence noise added to class probabilities.
Definition at line 31 of file clsfy_random_builder.h.