PLearn 0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Protected Attributes | Private Types
PLearn::StatsIterator Class Reference

#include <StatsIterator.h>

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

List of all members.

Public Member Functions

virtual bool requiresMultiplePasses ()
 Should return true if several passes are required (default version returns false)
virtual void init (int inputsize)=0
 Call this method once with the correct inputsize.
virtual void update (const Vec &input)=0
 Then iterate over the data set and call this method for each row.
virtual void update (const Mat &inputs)
virtual bool finish ()=0
virtual Vec getResult ()
 You can call this method after finish has returned true.
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.
virtual StatsIteratordeepCopy (CopiesMap &copies) const
virtual void build ()
 Post-constructor.
virtual void oldwrite (ostream &out) const

Static Public Member Functions

static string _classname_ ()
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declare options (data fields) for the class.

Protected Attributes

Vec result

Private Types

typedef Object inherited

Detailed Description

Definition at line 58 of file StatsIterator.h.


Member Typedef Documentation


Member Function Documentation

string PLearn::StatsIterator::_classname_ ( ) [static]
OptionList & PLearn::StatsIterator::_getOptionList_ ( ) [static]
RemoteMethodMap & PLearn::StatsIterator::_getRemoteMethodMap_ ( ) [static]
bool PLearn::StatsIterator::_isa_ ( const Object o) [static]
StaticInitializer StatsIterator::_static_initializer_ & PLearn::StatsIterator::_static_initialize_ ( ) [static]
virtual void PLearn::StatsIterator::build ( ) [inline, virtual]

Post-constructor.

The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::Object.

Definition at line 97 of file StatsIterator.h.

{}
void PLearn::StatsIterator::declareOptions ( OptionList ol) [static, protected]

Declare options (data fields) for the class.

Redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options). Please call the inherited method AT THE END to get the options listed in a consistent order (from most recently defined to least recently defined).

  static void MyDerivedClass::declareOptions(OptionList& ol)
  {
      declareOption(ol, "inputsize", &MyObject::inputsize_,
                    OptionBase::buildoption,
                    "The size of the input; it must be provided");
      declareOption(ol, "weights", &MyObject::weights,
                    OptionBase::learntoption,
                    "The learned model weights");
      inherited::declareOptions(ol);
  }
Parameters:
olList of options that is progressively being constructed for the current class.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::MeanStatsIterator, PLearn::ExpMeanStatsIterator, PLearn::StddevStatsIterator, PLearn::StderrStatsIterator, PLearn::SharpeRatioStatsIterator, PLearn::MinStatsIterator, PLearn::MaxStatsIterator, PLearn::LiftStatsIterator, and PLearn::QuantilesStatsIterator.

Definition at line 63 of file StatsIterator.cc.

References PLearn::declareOption(), PLearn::OptionBase::learntoption, and result.

Referenced by PLearn::QuantilesStatsIterator::declareOptions(), and PLearn::LiftStatsIterator::declareOptions().

Here is the call graph for this function:

Here is the caller graph for this function:

static const PPath& PLearn::StatsIterator::declaringFile ( ) [inline, static]
StatsIterator * PLearn::StatsIterator::deepCopy ( CopiesMap copies) const [virtual]
virtual bool PLearn::StatsIterator::finish ( ) [pure virtual]

Call this method when all the data has been shown (through update) If the method returns false, then a further pass through the data is required.

Implemented in PLearn::MeanStatsIterator, PLearn::ExpMeanStatsIterator, PLearn::StddevStatsIterator, PLearn::StderrStatsIterator, PLearn::SharpeRatioStatsIterator, PLearn::MinStatsIterator, PLearn::MaxStatsIterator, PLearn::LiftStatsIterator, and PLearn::QuantilesStatsIterator.

Vec PLearn::StatsIterator::getResult ( ) [virtual]

You can call this method after finish has returned true.

Definition at line 61 of file StatsIterator.cc.

{ return result; }
virtual void PLearn::StatsIterator::init ( int  inputsize) [pure virtual]
void PLearn::StatsIterator::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.

This needs to be overridden by every class that adds "complex" data members to the class, such as Vec, Mat, PP<Something>, etc. Typical implementation:

  void CLASS_OF_THIS::makeDeepCopyFromShallowCopy(CopiesMap& copies)
  {
      inherited::makeDeepCopyFromShallowCopy(copies);
      deepCopyField(complex_data_member1, copies);
      deepCopyField(complex_data_member2, copies);
      ...
  }
Parameters:
copiesA map used by the deep-copy mechanism to keep track of already-copied objects.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::StddevStatsIterator, PLearn::StderrStatsIterator, PLearn::SharpeRatioStatsIterator, PLearn::LiftStatsIterator, and PLearn::QuantilesStatsIterator.

Definition at line 53 of file StatsIterator.cc.

References PLearn::deepCopyField().

Referenced by PLearn::LiftStatsIterator::makeDeepCopyFromShallowCopy().

Here is the call graph for this function:

Here is the caller graph for this function:

void PLearn::StatsIterator::oldwrite ( ostream &  out) const [virtual]
bool PLearn::StatsIterator::requiresMultiplePasses ( ) [virtual]

Should return true if several passes are required (default version returns false)

Definition at line 59 of file StatsIterator.cc.

{ return false; }
virtual void PLearn::StatsIterator::update ( const Mat inputs) [inline, virtual]

Definition at line 76 of file StatsIterator.h.

References i, PLearn::TMat< T >::length(), and PLearn::update().

    { 
        for (int i=0;inputs.length();i++)
        {
            Vec input = inputs(i);
            update(input);
        }
    }

Here is the call graph for this function:

virtual void PLearn::StatsIterator::update ( const Vec input) [pure virtual]

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines