#include <clsfy_binary_hyperplane_gmrho_builder.h>
Inheritance diagram for clsfy_binary_hyperplane_gmrho_builder:

Uses a Geman-McClure robust function, rather than a least squares fit, on points that are not mis-classified This increases the weighting given to points near the boundary in determining its fit A conventional least squares fit is perform first to determine a starting solution, and also the sigma scaling factor used in the GM function. Several iterations are performed during which sigma is reduced (i.e. deterministic annealing), to try and avoid local minima
Definition at line 29 of file clsfy_binary_hyperplane_gmrho_builder.h.
Public Member Functions | |
| clsfy_binary_hyperplane_gmrho_builder () | |
| 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. | |
| virtual double | build (clsfy_classifier_base &model, mbl_data_wrapper< vnl_vector< double > > &inputs, unsigned nClasses, const vcl_vector< unsigned > &outputs) const |
| Build model from data. | |
| short | version_no () const |
| Version number for I/O. | |
| 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. | |
| void | set_auto_estimate_sigma (bool bAuto) |
| should sigma be estimate during the build or a pre-defined value used. | |
| void | set_sigma_preset (double sigma_preset) |
| use this for sigma if auto_estimate_sigma is true. | |
| 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. | |
| virtual clsfy_classifier_base * | new_classifier () const |
| Create a new untrained linear classifier with binary output. | |
Private Member Functions | |
| double | estimate_sigma (const vnl_matrix< double > &data, const vnl_vector< double > &y) const |
| Estimate the scale (sigma) used in the Geman-McClure function. | |
| void | determine_weights (const vnl_matrix< double > &data, const vnl_vector< double > &y, double sigma) const |
| Determine the weights for the hyperplane. | |
Private Attributes | |
| vnl_vector< double > | weights_ |
| The classifier weights (weight N is the constant). | |
| unsigned | num_examples_ |
| Number of training examples (data.rows()). | |
| unsigned | num_vars_ |
| Number of variables (data.cols()). | |
| double | epsilon_ |
| Tolerance for non-linear optimiser convergence. | |
| bool | auto_estimate_sigma_ |
| should sigma be estimated during the build or a pre-defined value used. | |
| double | sigma_preset_ |
| use this for sigma if auto_estimate_sigma is true. | |
| clsfy_binary_hyperplane_gmrho_builder::clsfy_binary_hyperplane_gmrho_builder | ( | ) | [inline] |
Definition at line 58 of file clsfy_binary_hyperplane_gmrho_builder.h.
| double clsfy_binary_hyperplane_gmrho_builder::estimate_sigma | ( | const vnl_matrix< double > & | data, | |
| const vnl_vector< double > & | y | |||
| ) | const [private] |
Estimate the scale (sigma) used in the Geman-McClure function.
This is increased by the mis-classification overlap region if any
Definition at line 209 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| void clsfy_binary_hyperplane_gmrho_builder::determine_weights | ( | const vnl_matrix< double > & | data, | |
| const vnl_vector< double > & | y, | |||
| double | sigma | |||
| ) | const [private] |
Determine the weights for the hyperplane.
Definition at line 192 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| double clsfy_binary_hyperplane_gmrho_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.
Return the mean error over the training set.
Reimplemented from clsfy_binary_hyperplane_ls_builder.
Definition at line 108 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| double clsfy_binary_hyperplane_gmrho_builder::build | ( | clsfy_classifier_base & | model, | |
| mbl_data_wrapper< vnl_vector< double > > & | inputs, | |||
| unsigned | nClasses, | |||
| const vcl_vector< unsigned > & | outputs | |||
| ) | const [virtual] |
Build model from data.
Return the mean error over the training set. For this classifiers, you must nClasses==1 to indicate a binary classifier
Reimplemented from clsfy_binary_hyperplane_ls_builder.
Definition at line 96 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| short clsfy_binary_hyperplane_gmrho_builder::version_no | ( | ) | const |
Version number for I/O.
Reimplemented from clsfy_binary_hyperplane_ls_builder.
Definition at line 306 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| vcl_string clsfy_binary_hyperplane_gmrho_builder::is_a | ( | ) | const [virtual] |
Name of the class.
Reimplemented from clsfy_binary_hyperplane_ls_builder.
Definition at line 292 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| bool clsfy_binary_hyperplane_gmrho_builder::is_class | ( | vcl_string const & | s | ) | const [virtual] |
Name of the class.
Reimplemented from clsfy_binary_hyperplane_ls_builder.
Definition at line 299 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| void clsfy_binary_hyperplane_gmrho_builder::print_summary | ( | vcl_ostream & | os | ) | const [virtual] |
Print class to os.
Reimplemented from clsfy_binary_hyperplane_ls_builder.
Definition at line 313 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| clsfy_builder_base * clsfy_binary_hyperplane_gmrho_builder::clone | ( | ) | const [virtual] |
Create a deep copy.
client is responsible for deleting returned object.
Reimplemented from clsfy_binary_hyperplane_ls_builder.
Definition at line 319 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| void clsfy_binary_hyperplane_gmrho_builder::set_auto_estimate_sigma | ( | bool | bAuto | ) | [inline] |
should sigma be estimate during the build or a pre-defined value used.
Definition at line 95 of file clsfy_binary_hyperplane_gmrho_builder.h.
| void clsfy_binary_hyperplane_gmrho_builder::set_sigma_preset | ( | double | sigma_preset | ) | [inline] |
use this for sigma if auto_estimate_sigma is true.
Definition at line 97 of file clsfy_binary_hyperplane_gmrho_builder.h.
| void clsfy_binary_hyperplane_gmrho_builder::b_write | ( | vsl_b_ostream & | ) | const [virtual] |
Save class to binary file stream.
Reimplemented from clsfy_binary_hyperplane_ls_builder.
Definition at line 263 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| void clsfy_binary_hyperplane_gmrho_builder::b_read | ( | vsl_b_istream & | ) | [virtual] |
Load class from binary file stream.
Reimplemented from clsfy_binary_hyperplane_ls_builder.
Definition at line 272 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
| virtual clsfy_classifier_base* clsfy_binary_hyperplane_ls_builder::new_classifier | ( | ) | const [inline, virtual, inherited] |
Create a new untrained linear classifier with binary output.
Implements clsfy_builder_base.
Definition at line 23 of file clsfy_binary_hyperplane_ls_builder.h.
vnl_vector<double> clsfy_binary_hyperplane_gmrho_builder::weights_ [mutable, private] |
The classifier weights (weight N is the constant).
Definition at line 33 of file clsfy_binary_hyperplane_gmrho_builder.h.
unsigned clsfy_binary_hyperplane_gmrho_builder::num_examples_ [mutable, private] |
Number of training examples (data.rows()).
Definition at line 36 of file clsfy_binary_hyperplane_gmrho_builder.h.
unsigned clsfy_binary_hyperplane_gmrho_builder::num_vars_ [mutable, private] |
Number of variables (data.cols()).
Definition at line 38 of file clsfy_binary_hyperplane_gmrho_builder.h.
double clsfy_binary_hyperplane_gmrho_builder::epsilon_ [mutable, private] |
Tolerance for non-linear optimiser convergence.
Definition at line 40 of file clsfy_binary_hyperplane_gmrho_builder.h.
bool clsfy_binary_hyperplane_gmrho_builder::auto_estimate_sigma_ [private] |
should sigma be estimated during the build or a pre-defined value used.
Definition at line 43 of file clsfy_binary_hyperplane_gmrho_builder.h.
double clsfy_binary_hyperplane_gmrho_builder::sigma_preset_ [private] |
use this for sigma if auto_estimate_sigma is true.
Definition at line 45 of file clsfy_binary_hyperplane_gmrho_builder.h.
1.5.1