|
SHOGUN
v1.1.0
|
Abstract base class for all splitting types. Takes a CLabels instance and generates a desired number of subsets which are being accessed by their indices via the method generate_subset_indices(...).
When being extended, the abstract method build_subsets() has to be implemented AND to be called in the constructor of sub-classes. Implementations have to fill the DynArray<index_t> elements in the (inherited) m_subset_indices variable. Note that these elements are already created by the constructor of this class - they just have to be filled. Every element represents one index subset.
Definition at line 34 of file SplittingStrategy.h.

Protected Member Functions | |
| virtual void | build_subsets ()=0 |
Protected Member Functions inherited from CSGObject | |
| virtual void | load_serializable_pre () throw (ShogunException) |
| virtual void | load_serializable_post () throw (ShogunException) |
| virtual void | save_serializable_pre () throw (ShogunException) |
| virtual void | save_serializable_post () throw (ShogunException) |
Protected Attributes | |
| CLabels * | m_labels |
| CDynamicObjectArray < CDynamicArray< index_t > > * | m_subset_indices |
Additional Inherited Members | |
Public Attributes inherited from CSGObject | |
| SGIO * | io |
| Parallel * | parallel |
| Version * | version |
| Parameter * | m_parameters |
| Parameter * | m_model_selection_parameters |
constructor
Definition at line 16 of file SplittingStrategy.cpp.
| CSplittingStrategy | ( | CLabels * | labels, |
| index_t | num_subsets | ||
| ) |
constructor
| labels | labels to be (possibly) used for splitting |
| num_subsets | desired number of subsets, the labels are split into |
Definition at line 21 of file SplittingStrategy.cpp.
|
virtual |
destructor
Definition at line 81 of file SplittingStrategy.cpp.
|
protectedpure virtual |
Abstract method. Has to fill the elements of the m_subset_indices variable with concrete indices. Note that CDynamicArray<index_t> instances for every subset are created in the constructor of this class - they just have to be filled.
Implemented in CStratifiedCrossValidationSplitting.
generates a newly created SGVector<index_t> with indices of the subset with the desired index
| subset_idx | subset index of the to be generated vector indices |
Definition at line 87 of file SplittingStrategy.cpp.
generates a newly created SGVector<index_t> with inverse indices of the subset with the desired index. inverse here means all other indices.
| subset_idx | subset index of the to be generated inverse indices |
Definition at line 104 of file SplittingStrategy.cpp.
|
virtual |
Implements CSGObject.
Reimplemented in CStratifiedCrossValidationSplitting.
Definition at line 74 of file SplittingStrategy.h.
| index_t get_num_subsets | ( | ) | const |
Definition at line 69 of file SplittingStrategy.h.
|
protected |
labels
Definition at line 90 of file SplittingStrategy.h.
|
protected |
subset indices
Definition at line 92 of file SplittingStrategy.h.