#include <TrainValidTestSplitter.h>
Inheritance diagram for PLearn::TrainValidTestSplitter:
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< VMat > | getSplit (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< int > | valid_indices |
Matrix containing the indices of the validation samples. | |
TMat< int > | test_indices |
Matrix containing the indices of the test samples. | |
Private Types | |
typedef Splitter | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
|
Reimplemented from PLearn::Splitter. Definition at line 54 of file TrainValidTestSplitter.h. |
|
Definition at line 55 of file TrainValidTestSplitter.cc. |
|
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_(). |
|
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(). |
|
Declares this class' options.
Reimplemented from PLearn::Object. Definition at line 76 of file TrainValidTestSplitter.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
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(). |
|
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::Splitter. Definition at line 172 of file TrainValidTestSplitter.cc. References PLERROR. |
|
Returns the number of sets per split.
Implements PLearn::Splitter. Definition at line 198 of file TrainValidTestSplitter.cc. References append_train, and append_valid. |
|
Returns the number of available different "splits".
Implements PLearn::Splitter. Definition at line 189 of file TrainValidTestSplitter.cc. References n_splits. |
|
Declares name and deepCopy methods.
|
|
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_(). |
|
Definition at line 82 of file TrainValidTestSplitter.h. Referenced by getSplit(), and nSetsPerSplit(). |
|
Definition at line 83 of file TrainValidTestSplitter.h. Referenced by getSplit(), and nSetsPerSplit(). |
|
Definition at line 84 of file TrainValidTestSplitter.h. |
|
Definition at line 85 of file TrainValidTestSplitter.h. Referenced by build_(). |
|
Definition at line 86 of file TrainValidTestSplitter.h. Referenced by build_(). |
|
Definition at line 87 of file TrainValidTestSplitter.h. Referenced by build_(). |
|
Matrix containing the indices of the test samples.
Definition at line 74 of file TrainValidTestSplitter.h. Referenced by build_(), and getSplit(). |
|
The first n_train samples of the dataset.
Definition at line 68 of file TrainValidTestSplitter.h. Referenced by build_(), and getSplit(). |
|
Matrix containing the indices of the validation samples.
Definition at line 71 of file TrainValidTestSplitter.h. Referenced by build_(), and getSplit(). |