Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::TrainValidTestSplitter Class Reference

#include <TrainValidTestSplitter.h>

Inheritance diagram for PLearn::TrainValidTestSplitter:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TrainValidTestSplitter ()
virtual void build ()
 Should call simply inherited::build(), then this class's build_().

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.

 PLEARN_DECLARE_OBJECT (TrainValidTestSplitter)
 Declares name and deepCopy methods.

virtual void setDataSet (VMat the_dataset)
 Sets the dataset on which the splits are to be based (overridden because build() needs to be called).

virtual int nsplits () const
 Returns the number of available different "splits".

virtual int nSetsPerSplit () const
 Returns the number of sets per split.

virtual TVec< VMatgetSplit (int i=0)
 Returns split number i.


Public Attributes

bool append_train
bool append_valid
int n_splits
int n_train
int n_valid
bool shuffle_valid_and_test

Static Protected Member Functions

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


Protected Attributes

VMat train_set
 The first n_train samples of the dataset.

TMat< intvalid_indices
 Matrix containing the indices of the validation samples.

TMat< inttest_indices
 Matrix containing the indices of the test samples.


Private Types

typedef Splitter inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

typedef Splitter PLearn::TrainValidTestSplitter::inherited [private]
 

Reimplemented from PLearn::Splitter.

Definition at line 54 of file TrainValidTestSplitter.h.


Constructor & Destructor Documentation

PLearn::TrainValidTestSplitter::TrainValidTestSplitter  ) 
 

Definition at line 55 of file TrainValidTestSplitter.cc.


Member Function Documentation

void PLearn::TrainValidTestSplitter::build  )  [virtual]
 

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 109 of file TrainValidTestSplitter.cc.

References build_().

void PLearn::TrainValidTestSplitter::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::Object.

Definition at line 118 of file TrainValidTestSplitter.cc.

References PLearn::VMat::length(), n_splits, n_train, n_valid, PLERROR, PLearn::TMat< int >::resize(), shuffle_valid_and_test, PLearn::shuffleElements(), PLearn::sortElements(), PLearn::TVec< T >::subVec(), test_indices, train_set, valid_indices, and PLearn::VMat::width().

Referenced by build(), and setDataSet().

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

Declares this class' options.

Reimplemented from PLearn::Object.

Definition at line 76 of file TrainValidTestSplitter.cc.

References PLearn::declareOption(), and PLearn::OptionList.

TVec< VMat > PLearn::TrainValidTestSplitter::getSplit int  i = 0  )  [virtual]
 

Returns split number i.

Implements PLearn::Splitter.

Definition at line 153 of file TrainValidTestSplitter.cc.

References PLearn::TVec< T >::append(), append_train, append_valid, k, test_indices, train_set, valid_indices, and PLearn::vconcat().

void PLearn::TrainValidTestSplitter::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::Splitter.

Definition at line 172 of file TrainValidTestSplitter.cc.

References PLERROR.

int PLearn::TrainValidTestSplitter::nSetsPerSplit  )  const [virtual]
 

Returns the number of sets per split.

Implements PLearn::Splitter.

Definition at line 198 of file TrainValidTestSplitter.cc.

References append_train, and append_valid.

int PLearn::TrainValidTestSplitter::nsplits  )  const [virtual]
 

Returns the number of available different "splits".

Implements PLearn::Splitter.

Definition at line 189 of file TrainValidTestSplitter.cc.

References n_splits.

PLearn::TrainValidTestSplitter::PLEARN_DECLARE_OBJECT TrainValidTestSplitter   ) 
 

Declares name and deepCopy methods.

void PLearn::TrainValidTestSplitter::setDataSet VMat  the_dataset  )  [virtual]
 

Sets the dataset on which the splits are to be based (overridden because build() needs to be called).

Reimplemented from PLearn::Splitter.

Definition at line 214 of file TrainValidTestSplitter.cc.

References build_().


Member Data Documentation

bool PLearn::TrainValidTestSplitter::append_train
 

Definition at line 82 of file TrainValidTestSplitter.h.

Referenced by getSplit(), and nSetsPerSplit().

bool PLearn::TrainValidTestSplitter::append_valid
 

Definition at line 83 of file TrainValidTestSplitter.h.

Referenced by getSplit(), and nSetsPerSplit().

int PLearn::TrainValidTestSplitter::n_splits
 

Definition at line 84 of file TrainValidTestSplitter.h.

Referenced by build_(), and nsplits().

int PLearn::TrainValidTestSplitter::n_train
 

Definition at line 85 of file TrainValidTestSplitter.h.

Referenced by build_().

int PLearn::TrainValidTestSplitter::n_valid
 

Definition at line 86 of file TrainValidTestSplitter.h.

Referenced by build_().

bool PLearn::TrainValidTestSplitter::shuffle_valid_and_test
 

Definition at line 87 of file TrainValidTestSplitter.h.

Referenced by build_().

TMat<int> PLearn::TrainValidTestSplitter::test_indices [protected]
 

Matrix containing the indices of the test samples.

Definition at line 74 of file TrainValidTestSplitter.h.

Referenced by build_(), and getSplit().

VMat PLearn::TrainValidTestSplitter::train_set [protected]
 

The first n_train samples of the dataset.

Definition at line 68 of file TrainValidTestSplitter.h.

Referenced by build_(), and getSplit().

TMat<int> PLearn::TrainValidTestSplitter::valid_indices [protected]
 

Matrix containing the indices of the validation samples.

Definition at line 71 of file TrainValidTestSplitter.h.

Referenced by build_(), and getSplit().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:26:54 2004 for PLearn by doxygen 1.3.7