Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::ClassifierFromDensity Class Reference

#include <ClassifierFromDensity.h>

Inheritance diagram for PLearn::ClassifierFromDensity:

Inheritance graph
[legend]
Collaboration diagram for PLearn::ClassifierFromDensity:

Collaboration graph
[legend]
List of all members.

Public Types

typedef PLearner inherited

Public Member Functions

 ClassifierFromDensity ()
virtual void build ()
 simply calls inherited::build() then build_()

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.

 PLEARN_DECLARE_OBJECT (ClassifierFromDensity)
virtual int outputsize () const
 returns the size of this learner's output, (which typically may depend on its inputsize(), targetsize() and set options)

virtual void forget ()
 (Re-)initializes the PLearner in its fresh state (that state may depend on the 'seed' option) And sets 'stage' back to 0 (this is the stage of a fresh learner!)

virtual void train ()
 The role of the train method is to bring the learner up to stage==nstages, updating the train_stats collector with training costs measured on-line in the process.

virtual void computeOutput (const Vec &input, Vec &output) const
 Computes the output from the input.

virtual void computeCostsFromOutputs (const Vec &input, const Vec &output, const Vec &target, Vec &costs) const
 Computes the costs from already computed output.

virtual TVec< stringgetTestCostNames () const
 Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method).

virtual TVec< stringgetTrainCostNames () const
 Returns the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats.


Public Attributes

int nclasses
TVec< PP< PLearner > > estimators
Vec log_priors
bool output_log_probabilities
bool normalize_probabilities

Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declares this class' options.


Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

typedef PLearner PLearn::ClassifierFromDensity::inherited
 

Reimplemented from PLearn::PLearner.

Definition at line 53 of file ClassifierFromDensity.h.


Constructor & Destructor Documentation

PLearn::ClassifierFromDensity::ClassifierFromDensity  ) 
 

Definition at line 51 of file ClassifierFromDensity.cc.


Member Function Documentation

void PLearn::ClassifierFromDensity::build  )  [virtual]
 

simply calls inherited::build() then build_()

Reimplemented from PLearn::PLearner.

Definition at line 93 of file ClassifierFromDensity.cc.

References build_().

void PLearn::ClassifierFromDensity::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::PLearner.

Definition at line 80 of file ClassifierFromDensity.cc.

References PLearn::deepCopy(), estimators, nclasses, PLERROR, PLearn::TVec< PP< PLearner > >::resize(), and PLearn::TVec< PP< PLearner > >::size().

Referenced by build().

void PLearn::ClassifierFromDensity::computeCostsFromOutputs const Vec input,
const Vec output,
const Vec target,
Vec costs
const [virtual]
 

Computes the costs from already computed output.

Implements PLearn::PLearner.

Definition at line 210 of file ClassifierFromDensity.cc.

References PLearn::class_error(), PLearn::condprob_cost(), PLearn::CostFunc, and PLearn::TVec< T >::resize().

void PLearn::ClassifierFromDensity::computeOutput const Vec input,
Vec output
const [virtual]
 

Computes the output from the input.

Implements PLearn::PLearner.

Definition at line 172 of file ClassifierFromDensity.cc.

References estimators, PLearn::exp(), log_priors, PLearn::logadd(), nclasses, normalize_probabilities, output_log_probabilities, and PLearn::TVec< T >::resize().

void PLearn::ClassifierFromDensity::declareOptions OptionList ol  )  [static, protected]
 

Declares this class' options.

Reimplemented from PLearn::PLearner.

Definition at line 62 of file ClassifierFromDensity.cc.

References PLearn::declareOption(), and PLearn::OptionList.

void PLearn::ClassifierFromDensity::forget  )  [virtual]
 

(Re-)initializes the PLearner in its fresh state (that state may depend on the 'seed' option) And sets 'stage' back to 0 (this is the stage of a fresh learner!)

Implements PLearn::PLearner.

Definition at line 113 of file ClassifierFromDensity.cc.

References estimators, and PLearn::TVec< PP< PLearner > >::length().

Referenced by train().

TVec< string > PLearn::ClassifierFromDensity::getTestCostNames  )  const [virtual]
 

Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method).

Implements PLearn::PLearner.

Definition at line 225 of file ClassifierFromDensity.cc.

TVec< string > PLearn::ClassifierFromDensity::getTrainCostNames  )  const [virtual]
 

Returns the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats.

Implements PLearn::PLearner.

Definition at line 233 of file ClassifierFromDensity.cc.

void PLearn::ClassifierFromDensity::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Definition at line 100 of file ClassifierFromDensity.cc.

References PLearn::deepCopyField(), estimators, and log_priors.

int PLearn::ClassifierFromDensity::outputsize  )  const [virtual]
 

returns the size of this learner's output, (which typically may depend on its inputsize(), targetsize() and set options)

Implements PLearn::PLearner.

Definition at line 108 of file ClassifierFromDensity.cc.

References nclasses.

PLearn::ClassifierFromDensity::PLEARN_DECLARE_OBJECT ClassifierFromDensity   ) 
 

void PLearn::ClassifierFromDensity::train  )  [virtual]
 

The role of the train method is to bring the learner up to stage==nstages, updating the train_stats collector with training costs measured on-line in the process.

Implements PLearn::PLearner.

Definition at line 120 of file ClassifierFromDensity.cc.

References PLearn::endl(), estimators, forget(), PLearn::PLearner::getExperimentDirectory(), PLearn::hconcat(), PLearn::indicesOfOccurencesInColumn(), PLearn::PLearner::inputsize(), PLearn::VMat::length(), PLearn::log(), log_priors, nclasses, PLERROR, PLearn::TVec< T >::resize(), PLearn::VMat::rows(), PLearn::VMat::subMatColumns(), PLearn::PLearner::targetsize(), and PLearn::tostring().


Member Data Documentation

TVec< PP<PLearner> > PLearn::ClassifierFromDensity::estimators
 

Definition at line 60 of file ClassifierFromDensity.h.

Referenced by build_(), computeOutput(), forget(), makeDeepCopyFromShallowCopy(), and train().

Vec PLearn::ClassifierFromDensity::log_priors
 

Definition at line 61 of file ClassifierFromDensity.h.

Referenced by computeOutput(), makeDeepCopyFromShallowCopy(), and train().

int PLearn::ClassifierFromDensity::nclasses
 

Definition at line 59 of file ClassifierFromDensity.h.

Referenced by build_(), computeOutput(), outputsize(), and train().

bool PLearn::ClassifierFromDensity::normalize_probabilities
 

Definition at line 63 of file ClassifierFromDensity.h.

Referenced by computeOutput().

bool PLearn::ClassifierFromDensity::output_log_probabilities
 

Definition at line 62 of file ClassifierFromDensity.h.

Referenced by computeOutput().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:27:07 2004 for PLearn by doxygen 1.3.7