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

#include <ManualBinner.h>

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

List of all members.

Public Types

typedef Binner inherited

Public Member Functions

 ManualBinner ()
 ManualBinner (Vec bin_positions_)
 Constructor with predefined cut points.
virtual void build ()
 Post-constructor.
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual ManualBinnerdeepCopy (CopiesMap &copies) const
virtual PP< RealMappinggetBinning (VMat v) const
 Returns a binning for a single column vmatrix v.
virtual PP< RealMappinggetBinning () const

Static Public Member Functions

static string _classname_ ()
 Declares name and deepCopy methods.
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static Object_new_instance_for_typemap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()

Public Attributes

Vec bin_positions
 The supplied cut points; should be sorted in ascending order.

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

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

Protected Attributes

PP< RealMappingthe_mapping
 pre-calculated in build_

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 48 of file ManualBinner.h.


Member Typedef Documentation

Reimplemented from PLearn::Binner.

Definition at line 59 of file ManualBinner.h.


Constructor & Destructor Documentation

PLearn::ManualBinner::ManualBinner ( )

Definition at line 45 of file ManualBinner.cc.

    :Binner(), the_mapping(0), bin_positions()
{
    // ...

    // ### You may or may not want to call build_() to finish building the object
    // build_();
}
PLearn::ManualBinner::ManualBinner ( Vec  bin_positions_)

Constructor with predefined cut points.

Definition at line 54 of file ManualBinner.cc.

References build_().

    :Binner(), the_mapping(0), bin_positions(bin_positions_.copy())
{
    build_();
}

Here is the call graph for this function:


Member Function Documentation

string PLearn::ManualBinner::_classname_ ( ) [static]

Declares name and deepCopy methods.

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

OptionList & PLearn::ManualBinner::_getOptionList_ ( ) [static]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

RemoteMethodMap & PLearn::ManualBinner::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

bool PLearn::ManualBinner::_isa_ ( const Object o) [static]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

Object * PLearn::ManualBinner::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

StaticInitializer ManualBinner::_static_initializer_ & PLearn::ManualBinner::_static_initialize_ ( ) [static]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

void PLearn::ManualBinner::build ( ) [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::Binner.

Definition at line 89 of file ManualBinner.cc.

References PLearn::Binner::build(), and build_().

Here is the call graph for this function:

void PLearn::ManualBinner::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::Binner.

Definition at line 78 of file ManualBinner.cc.

References bin_positions, i, PLearn::TVec< T >::length(), and the_mapping.

Referenced by build(), and ManualBinner().

{
    // create the pre-calculated RealMapping from bin_position
    if(the_mapping == 0)
        the_mapping= new RealMapping();
    the_mapping->clear();
    for(int i= 1; i < bin_positions.length(); ++i)
        the_mapping->addMapping(RealRange(']', bin_positions[i-1], bin_positions[i], ']'), i-1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

string PLearn::ManualBinner::classname ( ) const [virtual]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

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

Declares this class' options.

Reimplemented from PLearn::Binner.

Definition at line 66 of file ManualBinner.cc.

References bin_positions, PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::Binner::declareOptions(), PLearn::OptionBase::learntoption, and the_mapping.

{
    declareOption(ol, "bin_positions", &ManualBinner::bin_positions, OptionBase::buildoption,
                  "The supplied cut points; should be sorted in ascending order.");

    declareOption(ol, "the_mapping", &ManualBinner::the_mapping, OptionBase::learntoption,
                  "Pre-calculated RealMapping object that is returned by getBinning");

    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

static const PPath& PLearn::ManualBinner::declaringFile ( ) [inline, static]

Reimplemented from PLearn::Binner.

Definition at line 101 of file ManualBinner.h.

:
ManualBinner * PLearn::ManualBinner::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

PP< RealMapping > PLearn::ManualBinner::getBinning ( ) const [virtual]

Definition at line 115 of file ManualBinner.cc.

References the_mapping.

{ return the_mapping; }
PP< RealMapping > PLearn::ManualBinner::getBinning ( VMat  v) const [virtual]

Returns a binning for a single column vmatrix v.

Reimplemented from PLearn::Binner.

Definition at line 112 of file ManualBinner.cc.

References the_mapping.

{ return the_mapping; }
OptionList & PLearn::ManualBinner::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

OptionMap & PLearn::ManualBinner::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

RemoteMethodMap & PLearn::ManualBinner::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Binner.

Definition at line 64 of file ManualBinner.cc.

void PLearn::ManualBinner::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::Binner.

Definition at line 96 of file ManualBinner.cc.

References PLearn::Binner::makeDeepCopyFromShallowCopy(), and PLERROR.

{
    inherited::makeDeepCopyFromShallowCopy(copies);

    // ### Call deepCopyField on all "pointer-like" fields 
    // ### that you wish to be deepCopied rather than 
    // ### shallow-copied.
    // ### ex:
    // deepCopyField(trainvec, copies);

    // ### Remove this line when you have fully implemented this method.
    PLERROR("ManualBinner::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::Binner.

Definition at line 101 of file ManualBinner.h.

The supplied cut points; should be sorted in ascending order.

Definition at line 66 of file ManualBinner.h.

Referenced by build_(), and declareOptions().

pre-calculated in build_

Definition at line 55 of file ManualBinner.h.

Referenced by build_(), declareOptions(), and getBinning().


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