Package mvpa :: Package datasets :: Module splitters :: Class NFoldSplitter
[hide private]
[frames] | no frames]

Class NFoldSplitter

source code


Generic N-fold data splitter.

Provide folding splitting. Given a dataset with N chunks, with cvtype=1 (which is default), it would generate N splits, where each chunk sequentially is taken out (with replacement) for cross-validation. Example, if there is 4 chunks, splits for cvtype=1 are:

[[1, 2, 3], [0]] [[0, 2, 3], [1]] [[0, 1, 3], [2]] [[0, 1, 2], [3]]

If cvtype>1, then all possible combinations of cvtype number of chunks are taken out for testing, so for cvtype=2 in previous example:

[[2, 3], [0, 1]] [[1, 3], [0, 2]] [[1, 2], [0, 3]] [[0, 3], [1, 2]] [[0, 2], [1, 3]] [[0, 1], [2, 3]]
Instance Methods [hide private]
 
__init__(self, cvtype=1, **kwargs)
Initialize the N-fold splitter.
source code
 
__str__(self)
String summary over the object
source code
 
_getSplitConfig(self, uniqueattrs)
Returns proper split configuration for N-M fold split.
source code

Inherited from Splitter: __call__, setNPerLabel, splitDataset, splitcfg

Inherited from Splitter (private): _setStrategy

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  __doc__ = enhancedDocString('NFoldSplitter', locals(), Splitter)

Inherited from Splitter: strategy

Inherited from Splitter (private): _NPERLABEL_STR, _STRATEGIES

Instance Variables [hide private]

Inherited from Splitter: count

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cvtype=1, **kwargs)
(Constructor)

source code 
Initialize the N-fold splitter.
Parameters:
  • cvtype, int - Type of cross-validation: N-(cvtype)
  • kwargs - Additional parameters are passed to the Splitter base class.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 
String summary over the object
Overrides: object.__str__

_getSplitConfig(self, uniqueattrs)

source code 
Returns proper split configuration for N-M fold split.
Overrides: Splitter._getSplitConfig