![]() |
Multivariate Pattern Analysis in Python |
Collection of dataset splitters.
The comprehensive API documentation for this module, including all technical details, is available in the Epydoc-generated API reference for mvpa.datasets.splitter (for developers).
Bases: mvpa.datasets.splitter.Splitter
Split a dataset using an arbitrary custom rule.
The splitter is configured by passing a custom spitting rule (splitrule) to its constructor. Such a rule is basically a sequence of split definitions. Every single element in this sequence results in excatly one split generated by the Splitter. Each element is another sequence for sequences of sample ids for each dataset that shall be generated in the split.
Example:
Generate two splits. In the first split the second dataset contains all samples with sample attributes corresponding to either 0, 1 or 2. The first dataset of the first split contains all samples which are not split into the second dataset.
The second split yields three datasets. The first with all samples corresponding to sample attributes 1 and 2, the second dataset contains only samples with attrbiute 3 and the last dataset contains the samples with attribute 5 and 6.
CustomSplitter([(None, [0, 1, 2]), ([1,2], [3], [5, 6])])
Cheap init.
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the CustomSplitter documentation.
Full API documentation of CustomSplitter in module mvpa.datasets.splitter.
Bases: mvpa.datasets.splitter.Splitter
Split a dataset into two halves of the sample attribute.
The splitter yields to splits: first (1st half, 2nd half) and second (2nd half, 1st half).
Cheap init.
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the HalfSplitter documentation.
Full API documentation of HalfSplitter in module mvpa.datasets.splitter.
Bases: mvpa.datasets.splitter.Splitter
Generic N-fold data splitter.
XXX: This docstring is a shame for such an important class!
Initialize the N-fold splitter.
Parameters: |
|
---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the NFoldSplitter documentation.
Full API documentation of NFoldSplitter in module mvpa.datasets.splitter.
Bases: mvpa.datasets.splitter.Splitter
This is a dataset splitter that does not split. It simply returns the full dataset that it is called with.
The passed dataset is returned as the second element of the 2-tuple. The first element of that tuple will always be ‘None’.
Cheap init – nothing special
Parameters: |
|
---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the NoneSplitter documentation.
Full API documentation of NoneSplitter in module mvpa.datasets.splitter.
Bases: mvpa.datasets.splitter.Splitter
Split a dataset into odd and even values of the sample attribute.
The splitter yields to splits: first (odd, even) and second (even, odd).
Cheap init.
Parameters: |
|
---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the OddEvenSplitter documentation.
Full API documentation of OddEvenSplitter in module mvpa.datasets.splitter.
Bases: object
Base class of dataset splitters.
Each splitter should be initialized with all its necessary parameters. The final splitting is done running the splitter object on a certain Dataset via __call__(). This method has to be implemented like a generator, i.e. it has to return every possible split with a yield() call.
Each split has to be returned as a sequence of Datasets. The properties of the splitted dataset may vary between implementations. It is possible to declare a sequence element as ‘None’.
Please note, that even if there is only one Dataset returned it has to be an element in a sequence and not just the Dataset object!
Initialize splitter base.
Parameters: |
|
---|
Set the number of samples per label in the split datasets.
‘equal’ sets sample size to highest possible number of samples that can be provided by each class. ‘all’ uses all available samples (default).
Split a dataset by separating the samples where the configured sample attribute matches an element of specs.
Parameters: |
|
---|---|
Returns: | Tuple of splitted datasets. |
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the Splitter documentation.
Full API documentation of Splitter in module mvpa.datasets.splitter.