Base for classes to build clsfy_classifier_base objects. More...
#include <clsfy_builder_base.h>
Public Member Functions | |
virtual | ~clsfy_builder_base () |
virtual clsfy_classifier_base * | new_classifier () const =0 |
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 =0 |
Build model 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. | |
virtual clsfy_builder_base * | clone () 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_base > | new_builder (vcl_istream &as) |
Load description from a text stream. |
Base for classes to build clsfy_classifier_base objects.
Definition at line 25 of file clsfy_builder_base.h.
virtual clsfy_builder_base::~clsfy_builder_base | ( | ) | [inline, virtual] |
Definition at line 29 of file clsfy_builder_base.h.
virtual void clsfy_builder_base::b_read | ( | vsl_b_istream & | bfs | ) | [pure virtual] |
Load class from binary file stream.
Implemented in clsfy_direct_boost_builder, clsfy_binary_tree_builder, clsfy_binary_hyperplane_gmrho_builder, clsfy_adaboost_sorted_builder, clsfy_rbf_svm_smo_1_builder, clsfy_binary_hyperplane_logit_builder, clsfy_binary_1d_wrapper_builder, clsfy_parzen_builder, clsfy_random_builder, clsfy_knn_builder, clsfy_null_builder, clsfy_random_forest_builder, and clsfy_binary_hyperplane_ls_builder.
virtual void clsfy_builder_base::b_write | ( | vsl_b_ostream & | bfs | ) | const [pure virtual] |
Save class to binary file stream.
Implemented in clsfy_direct_boost_builder, clsfy_binary_tree_builder, clsfy_binary_hyperplane_gmrho_builder, clsfy_adaboost_sorted_builder, clsfy_rbf_svm_smo_1_builder, clsfy_binary_hyperplane_logit_builder, clsfy_binary_1d_wrapper_builder, clsfy_parzen_builder, clsfy_random_builder, clsfy_knn_builder, clsfy_null_builder, clsfy_random_forest_builder, and clsfy_binary_hyperplane_ls_builder.
virtual double clsfy_builder_base::build | ( | clsfy_classifier_base & | model, |
mbl_data_wrapper< vnl_vector< double > > & | inputs, | ||
unsigned | nClasses, | ||
const vcl_vector< unsigned > & | outputs | ||
) | const [pure virtual] |
Build model from data.
Return the mean error over the training set. For many classifiers, you may use nClasses==1 to indicate a binary classifier
Implemented in clsfy_direct_boost_builder, clsfy_binary_tree_builder, clsfy_adaboost_sorted_builder, clsfy_binary_hyperplane_gmrho_builder, clsfy_binary_hyperplane_logit_builder, clsfy_binary_1d_wrapper_builder, clsfy_parzen_builder, clsfy_random_builder, clsfy_knn_builder, clsfy_null_builder, clsfy_random_forest_builder, clsfy_rbf_svm_smo_1_builder, and clsfy_binary_hyperplane_ls_builder.
virtual clsfy_builder_base* clsfy_builder_base::clone | ( | ) | const [pure virtual] |
Create a copy on the heap and return base class pointer.
Implemented in clsfy_direct_boost_builder, clsfy_binary_tree_builder, clsfy_binary_hyperplane_gmrho_builder, clsfy_adaboost_sorted_builder, clsfy_rbf_svm_smo_1_builder, clsfy_binary_hyperplane_logit_builder, clsfy_binary_1d_wrapper_builder, clsfy_parzen_builder, clsfy_random_builder, clsfy_knn_builder, clsfy_null_builder, clsfy_random_forest_builder, and clsfy_binary_hyperplane_ls_builder.
void clsfy_builder_base::config | ( | vcl_istream & | as | ) | [virtual] |
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_builder_base::is_a | ( | ) | const [virtual] |
Name of the class.
Reimplemented in clsfy_direct_boost_builder, clsfy_binary_tree_builder, clsfy_binary_hyperplane_gmrho_builder, clsfy_adaboost_sorted_builder, clsfy_rbf_svm_smo_1_builder, clsfy_binary_hyperplane_logit_builder, clsfy_binary_1d_wrapper_builder, clsfy_parzen_builder, clsfy_random_builder, clsfy_knn_builder, clsfy_null_builder, clsfy_random_forest_builder, and clsfy_binary_hyperplane_ls_builder.
Definition at line 73 of file clsfy_builder_base.cxx.
bool clsfy_builder_base::is_class | ( | vcl_string const & | s | ) | const [virtual] |
Name of the class.
Reimplemented in clsfy_direct_boost_builder, clsfy_binary_tree_builder, clsfy_binary_hyperplane_gmrho_builder, clsfy_adaboost_sorted_builder, clsfy_rbf_svm_smo_1_builder, clsfy_binary_hyperplane_logit_builder, clsfy_binary_1d_wrapper_builder, clsfy_parzen_builder, clsfy_random_builder, clsfy_knn_builder, clsfy_null_builder, clsfy_random_forest_builder, and clsfy_binary_hyperplane_ls_builder.
Definition at line 80 of file clsfy_builder_base.cxx.
vcl_auto_ptr< clsfy_builder_base > clsfy_builder_base::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_base derivative and return that.
if | the parse fails. |
Definition at line 42 of file clsfy_builder_base.cxx.
virtual clsfy_classifier_base* clsfy_builder_base::new_classifier | ( | ) | const [pure virtual] |
Create empty model.
Implemented in clsfy_binary_tree_builder, clsfy_direct_boost_builder, clsfy_adaboost_sorted_builder, clsfy_parzen_builder, clsfy_random_builder, clsfy_binary_1d_wrapper_builder, clsfy_knn_builder, clsfy_null_builder, clsfy_random_forest_builder, clsfy_rbf_svm_smo_1_builder, and clsfy_binary_hyperplane_ls_builder.
virtual void clsfy_builder_base::print_summary | ( | vcl_ostream & | os | ) | const [pure virtual] |
Print class to os.
Implemented in clsfy_direct_boost_builder, clsfy_binary_tree_builder, clsfy_adaboost_sorted_builder, clsfy_binary_hyperplane_gmrho_builder, clsfy_rbf_svm_smo_1_builder, clsfy_binary_hyperplane_logit_builder, clsfy_parzen_builder, clsfy_random_builder, clsfy_binary_1d_wrapper_builder, clsfy_knn_builder, clsfy_null_builder, clsfy_random_forest_builder, and clsfy_binary_hyperplane_ls_builder.