Public Member Functions | Protected Attributes
clsfy_binary_1d_wrapper Class Reference

Make a clsfy_classifier_1d derivative look like a clsfy_classifierbase derivative. More...

#include <clsfy_binary_1d_wrapper.h>

Inheritance diagram for clsfy_binary_1d_wrapper:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 clsfy_binary_1d_wrapper ()
virtual void class_probabilities (vcl_vector< double > &outputs, const vnl_vector< double > &input) const
 Find the posterior probability of the input being in the positive class.
virtual unsigned classify (const vnl_vector< double > &input) const
 Classify the input vector.
virtual double log_l (const vnl_vector< double > &input) const
 Log likelihood of being in the positive class.
void set_classifier_1d (const clsfy_classifier_1d &classifier)
 Set the underlying classifier.
const clsfy_classifier_1dclassifier_1d () const
 Get the underlying classifier.
virtual unsigned n_dims () const
 The dimensionality of input vectors.
virtual unsigned n_classes () const
 The number of possible output classes.
virtual vcl_string is_a () const
 Name of the class.
virtual bool is_class (vcl_string const &s) const
 Name of the class.
virtual void print_summary (vcl_ostream &os) const
 Print class to os.
virtual void b_write (vsl_b_ostream &bfs) const
 Save class to a binary File Stream.
virtual void b_read (vsl_b_istream &bfs)
 Load the class from a Binary File Stream.
virtual clsfy_classifier_baseclone () const
 Create a deep copy.
virtual void classify_many (vcl_vector< unsigned > &outputs, mbl_data_wrapper< vnl_vector< double > > &inputs) const
 Classify many input vectors.

Protected Attributes

mbl_cloneable_nzptr
< clsfy_classifier_1d
classifier_1d_
 Underlying 1d classifier.

Detailed Description

Make a clsfy_classifier_1d derivative look like a clsfy_classifierbase derivative.

Definition at line 16 of file clsfy_binary_1d_wrapper.h.


Constructor & Destructor Documentation

clsfy_binary_1d_wrapper::clsfy_binary_1d_wrapper ( )

Definition at line 22 of file clsfy_binary_1d_wrapper.cxx.


Member Function Documentation

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

Load the class from a Binary File Stream.

Implements clsfy_classifier_base.

Definition at line 59 of file clsfy_binary_1d_wrapper.cxx.

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

Save class to a binary File Stream.

Implements clsfy_classifier_base.

Definition at line 50 of file clsfy_binary_1d_wrapper.cxx.

virtual void clsfy_binary_1d_wrapper::class_probabilities ( vcl_vector< double > &  outputs,
const vnl_vector< double > &  input 
) const [inline, virtual]

Find the posterior probability of the input being in the positive class.

The result is outputs(0)

Implements clsfy_classifier_base.

Definition at line 28 of file clsfy_binary_1d_wrapper.h.

const clsfy_classifier_1d& clsfy_binary_1d_wrapper::classifier_1d ( ) const [inline]

Get the underlying classifier.

Definition at line 48 of file clsfy_binary_1d_wrapper.h.

virtual unsigned clsfy_binary_1d_wrapper::classify ( const vnl_vector< double > &  input) const [inline, virtual]

Classify the input vector.

Returns a number between 0 and nClasses-1 inclusive to represent the most likely class

Reimplemented from clsfy_classifier_base.

Definition at line 33 of file clsfy_binary_1d_wrapper.h.

void clsfy_classifier_base::classify_many ( vcl_vector< unsigned > &  outputs,
mbl_data_wrapper< vnl_vector< double > > &  inputs 
) const [virtual, inherited]

Classify many input vectors.

Definition at line 55 of file clsfy_classifier_base.cxx.

virtual clsfy_classifier_base* clsfy_binary_1d_wrapper::clone ( ) const [inline, virtual]

Create a deep copy.

Client is responsible for deleting returned object.

Implements clsfy_classifier_base.

Definition at line 75 of file clsfy_binary_1d_wrapper.h.

vcl_string clsfy_binary_1d_wrapper::is_a ( ) const [virtual]

Name of the class.

Reimplemented from clsfy_classifier_base.

Definition at line 26 of file clsfy_binary_1d_wrapper.cxx.

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

Name of the class.

Reimplemented from clsfy_classifier_base.

Definition at line 33 of file clsfy_binary_1d_wrapper.cxx.

virtual double clsfy_binary_1d_wrapper::log_l ( const vnl_vector< double > &  input) const [inline, virtual]

Log likelihood of being in the positive class.

Class probability = 1 / (1+exp(-log_l))

Implements clsfy_classifier_base.

Definition at line 38 of file clsfy_binary_1d_wrapper.h.

virtual unsigned clsfy_binary_1d_wrapper::n_classes ( ) const [inline, virtual]

The number of possible output classes.

1 indicates a binary classifier

Implements clsfy_classifier_base.

Definition at line 56 of file clsfy_binary_1d_wrapper.h.

virtual unsigned clsfy_binary_1d_wrapper::n_dims ( ) const [inline, virtual]

The dimensionality of input vectors.

Implements clsfy_classifier_base.

Definition at line 52 of file clsfy_binary_1d_wrapper.h.

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

Print class to os.

required if data is present in this class

Implements clsfy_classifier_base.

Definition at line 42 of file clsfy_binary_1d_wrapper.cxx.

void clsfy_binary_1d_wrapper::set_classifier_1d ( const clsfy_classifier_1d classifier) [inline]

Set the underlying classifier.

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

Definition at line 44 of file clsfy_binary_1d_wrapper.h.


Member Data Documentation

Underlying 1d classifier.

Definition at line 20 of file clsfy_binary_1d_wrapper.h.


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