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

PLearn::TestInTrainSplitter Class Reference

#include <TestInTrainSplitter.h>

Inheritance diagram for PLearn::TestInTrainSplitter:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TestInTrainSplitter ()
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 (TestInTrainSplitter)
 Declares name and deepCopy methods.

virtual void setDataSet (VMat the_dataset)
 Overridden to forward to underlying splitter and reset 'first_source_split'.

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

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

virtual void getFirstSplit () const
 Compute the first split of source_splitter and store it in 'first_source_split'.

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


Public Attributes

real percentage_added
PP< Splittersource_splitter

Static Protected Member Functions

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


Protected Attributes

TVec< VMatfirst_source_split
 Store the first split provided by the source_splitter.

int n_left
 The number of samples in the test set that would be left if we didn't make sure they were all added once.

int n_splits_per_source_split
 The number of splits to make for each split given by the source_splitter.

int n_train
 The number of samples in the train and test parts, as given by the source_splitter.

int n_test
 The number of samples in the train and test parts, as given by the source_splitter.

int n_to_add
 The number of sample to add each time in the train set.


Private Types

typedef Splitter inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

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

Reimplemented from PLearn::Splitter.

Definition at line 57 of file TestInTrainSplitter.h.


Constructor & Destructor Documentation

PLearn::TestInTrainSplitter::TestInTrainSplitter  ) 
 

Definition at line 51 of file TestInTrainSplitter.cc.


Member Function Documentation

void PLearn::TestInTrainSplitter::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 105 of file TestInTrainSplitter.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::Object.

Definition at line 94 of file TestInTrainSplitter.cc.

Referenced by build().

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

Declares this class' options.

Reimplemented from PLearn::Object.

Definition at line 75 of file TestInTrainSplitter.cc.

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

void PLearn::TestInTrainSplitter::getFirstSplit  )  const [virtual]
 

Compute the first split of source_splitter and store it in 'first_source_split'.

Definition at line 162 of file TestInTrainSplitter.cc.

References first_source_split, PLearn::TVec< VMat >::length(), n_test, n_train, and source_splitter.

Referenced by getSplit(), and nsplits().

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

Returns split number i.

Implements PLearn::Splitter.

Definition at line 171 of file TestInTrainSplitter.cc.

References first_source_split, getFirstSplit(), PLearn::TVec< VMat >::isEmpty(), k, PLearn::TVec< T >::length(), PLearn::VMat::length(), n_left, n_splits_per_source_split, n_test, n_to_add, n_train, PLERROR, source_splitter, PLearn::vconcat(), and PLearn::VMat::width().

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::Splitter.

Definition at line 111 of file TestInTrainSplitter.cc.

References PLERROR.

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

Returns the number of sets per split.

Implements PLearn::Splitter.

Definition at line 154 of file TestInTrainSplitter.cc.

References source_splitter.

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

Returns the number of available different "splits".

Implements PLearn::Splitter.

Definition at line 128 of file TestInTrainSplitter.cc.

References first_source_split, getFirstSplit(), PLearn::TVec< VMat >::isEmpty(), n_left, n_splits_per_source_split, n_test, n_to_add, n_train, percentage_added, PLERROR, and source_splitter.

PLearn::TestInTrainSplitter::PLEARN_DECLARE_OBJECT TestInTrainSplitter   ) 
 

Declares name and deepCopy methods.

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

Overridden to forward to underlying splitter and reset 'first_source_split'.

Reimplemented from PLearn::Splitter.

Definition at line 217 of file TestInTrainSplitter.cc.

References first_source_split, PLearn::TVec< VMat >::resize(), and source_splitter.


Member Data Documentation

TVec<VMat> PLearn::TestInTrainSplitter::first_source_split [mutable, protected]
 

Store the first split provided by the source_splitter.

This is because we need it the number of points in the train and test parts in the nsplits() method.

Definition at line 72 of file TestInTrainSplitter.h.

Referenced by getFirstSplit(), getSplit(), nsplits(), and setDataSet().

int PLearn::TestInTrainSplitter::n_left [mutable, protected]
 

The number of samples in the test set that would be left if we didn't make sure they were all added once.

Definition at line 76 of file TestInTrainSplitter.h.

Referenced by getSplit(), and nsplits().

int PLearn::TestInTrainSplitter::n_splits_per_source_split [mutable, protected]
 

The number of splits to make for each split given by the source_splitter.

Definition at line 79 of file TestInTrainSplitter.h.

Referenced by getSplit(), and nsplits().

int PLearn::TestInTrainSplitter::n_test [mutable, protected]
 

The number of samples in the train and test parts, as given by the source_splitter.

Definition at line 83 of file TestInTrainSplitter.h.

Referenced by getFirstSplit(), getSplit(), and nsplits().

int PLearn::TestInTrainSplitter::n_to_add [mutable, protected]
 

The number of sample to add each time in the train set.

Definition at line 86 of file TestInTrainSplitter.h.

Referenced by getSplit(), and nsplits().

int PLearn::TestInTrainSplitter::n_train [mutable, protected]
 

The number of samples in the train and test parts, as given by the source_splitter.

Definition at line 83 of file TestInTrainSplitter.h.

Referenced by getFirstSplit(), getSplit(), and nsplits().

real PLearn::TestInTrainSplitter::percentage_added
 

Definition at line 94 of file TestInTrainSplitter.h.

Referenced by nsplits().

PP<Splitter> PLearn::TestInTrainSplitter::source_splitter
 

Definition at line 95 of file TestInTrainSplitter.h.

Referenced by getFirstSplit(), getSplit(), nSetsPerSplit(), nsplits(), and setDataSet().


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