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

This class is an abstract base class for mechanisms allowing to "split" a dataset into one or several partitions (or "splits"). More...

#include <Splitter.h>

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

List of all members.

Public Member Functions

virtual SplitterdeepCopy (CopiesMap &copies) const
 Splitter ()
virtual void setDataSet (VMat the_dataset)
 Sets the dataset on which the splits are to be based.
VMat getDataSet ()
 Returns the dataset given with setDataSet.
virtual int nsplits () const =0
 Returns the number of available different "splits".
virtual int nSetsPerSplit () const =0
 Returns the number of sets per split.
virtual TVec< VMatgetSplit (int i=0)=0
 Returns split number i.
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.

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)
 Declares the class options.
static void declareMethods (RemoteMethodMap &rmm)
 Declare the methods that are remote-callable.

Protected Attributes

VMat dataset

Private Types

typedef Object inherited

Detailed Description

This class is an abstract base class for mechanisms allowing to "split" a dataset into one or several partitions (or "splits").

Thus for instance a subclass can be used to implement k-fold splits (for k-fold cross validation), where each of the k splits returned by getSplit(i=0..k-1) would be an 2-element array containing the corresponding training-set and test-set.

A splitter is an essential part of a PTester.

Definition at line 61 of file Splitter.h.


Member Typedef Documentation


Constructor & Destructor Documentation

PLearn::Splitter::Splitter ( ) [inline]

Definition at line 79 of file Splitter.h.

{};

Member Function Documentation

string PLearn::Splitter::_classname_ ( ) [static]
OptionList & PLearn::Splitter::_getOptionList_ ( ) [static]
RemoteMethodMap & PLearn::Splitter::_getRemoteMethodMap_ ( ) [static]
bool PLearn::Splitter::_isa_ ( const Object o) [static]
StaticInitializer Splitter::_static_initializer_ & PLearn::Splitter::_static_initialize_ ( ) [static]
void PLearn::Splitter::declareMethods ( RemoteMethodMap rmm) [static, protected]

Declare the methods that are remote-callable.

TODO export virtual TVec<VMat> getSplit(int i=0) = 0;

Reimplemented from PLearn::Object.

Definition at line 73 of file Splitter.cc.

References PLearn::declareMethod(), getSplit(), PLearn::RemoteMethodMap::inherited(), nSetsPerSplit(), nsplits(), and setDataSet().

{
    // Insert a backpointer to remote methods; note that this
    // different than for declareOptions()
    rmm.inherited(inherited::_getRemoteMethodMap_());

    declareMethod(
        rmm, "setDataSet", &Splitter::setDataSet,
        (BodyDoc("Set this splitter's dataset\n"),
         ArgDoc ("the_dataset","The dataset to split")));
    declareMethod(
        rmm, "nSetsPerSplit", &Splitter::nSetsPerSplit,
        (BodyDoc("Returns the number of sets per split\n"),
         RetDoc ("the numer of sets per split")));
    declareMethod(
        rmm, "nsplits", &Splitter::nsplits,
        (BodyDoc(" Returns the number of available different 'splits'\n"),
         RetDoc (" the numer of available splits")));
    declareMethod(
        rmm, "getSplit", &Splitter::getSplit,
        (BodyDoc("Get one of the splits\n"),
         ArgDoc ("i","The split to get"),
         RetDoc ("The ith split (vec. of N sets)")));



}

Here is the call graph for this function:

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

Declares the class options.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::BinSplitter, PLearn::BootstrapSplitter, PLearn::ClassSeparationSplitter, PLearn::ConcatSetsSplitter, PLearn::DBSplitter, PLearn::ExplicitSplitter, PLearn::FilterSplitter, PLearn::FractionSplitter, PLearn::KFoldSplitter, PLearn::MultiTaskSeparationSplitter, PLearn::NoSplitSplitter, PLearn::RepeatSplitter, PLearn::SelectSetsSplitter, PLearn::SequentialSplitter, PLearn::SourceVMatrixSplitter, PLearn::StackedSplitter, PLearn::TestInTrainSplitter, PLearn::ToBagSplitter, PLearn::TrainTestSplitter, and PLearn::TrainValidTestSplitter.

Definition at line 63 of file Splitter.cc.

References dataset, PLearn::declareOption(), PLearn::OptionBase::learntoption, PLearn::OptionBase::nosave, and PLearn::OptionBase::remotetransmit.

Referenced by PLearn::TrainValidTestSplitter::declareOptions(), PLearn::TrainTestSplitter::declareOptions(), PLearn::ToBagSplitter::declareOptions(), PLearn::TestInTrainSplitter::declareOptions(), PLearn::StackedSplitter::declareOptions(), PLearn::SourceVMatrixSplitter::declareOptions(), PLearn::SequentialSplitter::declareOptions(), PLearn::RepeatSplitter::declareOptions(), PLearn::MultiTaskSeparationSplitter::declareOptions(), PLearn::KFoldSplitter::declareOptions(), PLearn::FractionSplitter::declareOptions(), PLearn::FilterSplitter::declareOptions(), PLearn::DBSplitter::declareOptions(), PLearn::ClassSeparationSplitter::declareOptions(), PLearn::BootstrapSplitter::declareOptions(), and PLearn::BinSplitter::declareOptions().

Here is the call graph for this function:

Here is the caller graph for this function:

static const PPath& PLearn::Splitter::declaringFile ( ) [inline, static]
Splitter * PLearn::Splitter::deepCopy ( CopiesMap copies) const [virtual]
VMat PLearn::Splitter::getDataSet ( ) [inline]

Returns the dataset given with setDataSet.

Definition at line 85 of file Splitter.h.

    { return dataset; }
virtual TVec<VMat> PLearn::Splitter::getSplit ( int  i = 0) [pure virtual]
void PLearn::Splitter::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::BinSplitter, PLearn::BootstrapSplitter, PLearn::ClassSeparationSplitter, PLearn::ConcatSetsSplitter, PLearn::DBSplitter, PLearn::ExplicitSplitter, PLearn::FilterSplitter, PLearn::FractionSplitter, PLearn::MultiTaskSeparationSplitter, PLearn::NoSplitSplitter, PLearn::RepeatSplitter, PLearn::SelectSetsSplitter, PLearn::SourceVMatrixSplitter, PLearn::StackedSplitter, PLearn::TestInTrainSplitter, PLearn::ToBagSplitter, PLearn::TrainTestSplitter, and PLearn::TrainValidTestSplitter.

Definition at line 101 of file Splitter.cc.

References PLearn::deepCopyField().

Referenced by PLearn::TrainValidTestSplitter::makeDeepCopyFromShallowCopy(), PLearn::TrainTestSplitter::makeDeepCopyFromShallowCopy(), PLearn::ToBagSplitter::makeDeepCopyFromShallowCopy(), PLearn::TestInTrainSplitter::makeDeepCopyFromShallowCopy(), PLearn::StackedSplitter::makeDeepCopyFromShallowCopy(), PLearn::SourceVMatrixSplitter::makeDeepCopyFromShallowCopy(), PLearn::RepeatSplitter::makeDeepCopyFromShallowCopy(), PLearn::MultiTaskSeparationSplitter::makeDeepCopyFromShallowCopy(), PLearn::FractionSplitter::makeDeepCopyFromShallowCopy(), PLearn::FilterSplitter::makeDeepCopyFromShallowCopy(), PLearn::DBSplitter::makeDeepCopyFromShallowCopy(), PLearn::ClassSeparationSplitter::makeDeepCopyFromShallowCopy(), PLearn::BootstrapSplitter::makeDeepCopyFromShallowCopy(), and PLearn::BinSplitter::makeDeepCopyFromShallowCopy().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual int PLearn::Splitter::nSetsPerSplit ( ) const [pure virtual]
virtual int PLearn::Splitter::nsplits ( ) const [pure virtual]
void PLearn::Splitter::setDataSet ( VMat  the_dataset) [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