PLearn 0.1
|
#include <TestMethod.h>
Public Member Functions | |
TestMethod () | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual TestMethod * | deepCopy (CopiesMap &copies) const |
virtual void | build () |
Post-constructor. | |
Static Public Member Functions | |
static string | _classname_ () |
Train/Tests the given learner against the given dataset And returns a Vec with the computed statistics corresponding to the requested statnames. | |
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 () |
static void | declareOptions (OptionList &ol) |
Declare options (data fields) for the class. | |
Public Attributes | |
PP< Splitter > | splitter |
a n by 4 matrix of parsed statnames | |
TVec< string > | statnames |
a list of n statistics name of the form ex: "E[E[train.class_error]]" | |
bool | forget_learner |
should we call forget on the learner prior to every train? | |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Protected Attributes | |
TMat< string > | requested_stats |
Private Types | |
typedef Object | inherited |
Private Member Functions | |
void | build_ () |
Object-specific post-constructor. |
Definition at line 58 of file TestMethod.h.
typedef Object PLearn::TestMethod::inherited [private] |
Reimplemented from PLearn::Object.
Definition at line 60 of file TestMethod.h.
PLearn::TestMethod::TestMethod | ( | ) | [inline] |
Definition at line 76 of file TestMethod.h.
:forget_learner(true) {}
string PLearn::TestMethod::_classname_ | ( | ) | [static] |
Train/Tests the given learner against the given dataset And returns a Vec with the computed statistics corresponding to the requested statnames.
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
OptionList & PLearn::TestMethod::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
RemoteMethodMap & PLearn::TestMethod::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
Object * PLearn::TestMethod::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
StaticInitializer TestMethod::_static_initializer_ & PLearn::TestMethod::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
void PLearn::TestMethod::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::Object.
Definition at line 126 of file TestMethod.cc.
References PLearn::Object::build(), and build_().
{ inherited::build(); build_(); }
void PLearn::TestMethod::build_ | ( | ) | [private] |
Object-specific post-constructor.
This method should be redefined in subclasses and do the actual building of the object according to previously set option fields. Constructors can just set option fields, and then call build_. This method is NOT virtual, and will typically be called only from three places: a constructor, the public virtual build()
method, and possibly the public virtual read method (which calls its parent's read). build_()
can assume that its parent's build_()
has already been called.
Reimplemented from PLearn::Object.
Definition at line 122 of file TestMethod.cc.
Referenced by build().
{ }
string PLearn::TestMethod::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
void PLearn::TestMethod::declareOptions | ( | OptionList & | ol | ) | [static] |
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); }
ol | List of options that is progressively being constructed for the current class. |
Reimplemented from PLearn::Object.
Definition at line 133 of file TestMethod.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::Object::declareOptions(), forget_learner, splitter, and statnames.
{ declareOption(ol, "splitter", &TestMethod::splitter, OptionBase::buildoption, "Splitter object defining the test method"); declareOption(ol, "statnames", &TestMethod::statnames, OptionBase::buildoption, "A vector of strings containing train/test statistics definitions of the train/test stats whose values should be returned by the test method.\n" "Ex: E[E[train.class_error]]"); declareOption(ol, "forget_learner", &TestMethod::forget_learner, OptionBase::buildoption, "Should we call forget on the learner prior to every train?"); inherited::declareOptions(ol); }
static const PPath& PLearn::TestMethod::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::Object.
Definition at line 82 of file TestMethod.h.
TestMethod * PLearn::TestMethod::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
OptionList & PLearn::TestMethod::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
OptionMap & PLearn::TestMethod::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
RemoteMethodMap & PLearn::TestMethod::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file TestMethod.cc.
Reimplemented from PLearn::Object.
Definition at line 82 of file TestMethod.h.
should we call forget on the learner prior to every train?
Definition at line 73 of file TestMethod.h.
Referenced by declareOptions().
TMat<string> PLearn::TestMethod::requested_stats [protected] |
Definition at line 66 of file TestMethod.h.
a n by 4 matrix of parsed statnames
Definition at line 71 of file TestMethod.h.
Referenced by declareOptions().
TVec<string> PLearn::TestMethod::statnames |
a list of n statistics name of the form ex: "E[E[train.class_error]]"
Definition at line 72 of file TestMethod.h.
Referenced by declareOptions().