PLearn 0.1
|
#include <ManualBinner.h>
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 OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual ManualBinner * | deepCopy (CopiesMap &copies) const |
virtual PP< RealMapping > | getBinning (VMat v) const |
Returns a binning for a single column vmatrix v. | |
virtual PP< RealMapping > | getBinning () 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 PPath & | declaringFile () |
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< RealMapping > | the_mapping |
pre-calculated in build_ | |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 48 of file ManualBinner.h.
Reimplemented from PLearn::Binner.
Definition at line 59 of file ManualBinner.h.
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_(); }
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.
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_().
{ inherited::build(); build_(); }
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); }
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); }
static const PPath& PLearn::ManualBinner::declaringFile | ( | ) | [inline, static] |
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] |
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!"); }
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().
PP<RealMapping> PLearn::ManualBinner::the_mapping [protected] |
pre-calculated in build_
Definition at line 55 of file ManualBinner.h.
Referenced by build_(), declareOptions(), and getBinning().