Package PyML :: Package classifiers :: Module baseClassifiers :: Class IteratorClassifier
[frames] | no frames]

Class IteratorClassifier

source code

base.pymlObject.PyMLobject --+    
                             |    
                    Classifier --+
                                 |
                                IteratorClassifier

Nested Classes
    Inherited from Classifier
  resultsObject
Instance Methods
 
__iter__(self) source code
 
getClassifier(self) source code
 
next(self) source code
 
test(self, data, **args)
test a classifier on a given dataset
source code
 
cv(self, data, **args)
perform k-fold cross validation
source code
 
stratifiedCV(self, data, **args)
perform k-fold stratified cross-validation; in each fold the number of patterns from each class is proportional to the relative fraction of the class in the dataset
source code
 
loo(self, data, **args)
perform Leave One Out
source code
    Inherited from Classifier
 
__init__(self, arg=None, **args) source code
 
__repr__(self) source code
 
classify(self, data, i) source code
 
getTrainingTime(self) source code
 
logger(self) source code
 
nCV(classifier, data, **args)
runs CV n times, returning a 'ResultsList' object.
source code
 
project(self, data)
project a test dataset to the training data features.
source code
 
save(self, fileHandle) source code
 
train(self, data, **args) source code
 
trainFinalize(self) source code
 
trainTest(classifierTemplate, data, trainingPatterns, testingPatterns, **args)
Train a classifier on the list of training patterns, and test it on the test patterns
source code
 
twoClassClassify(self, data, i) source code
Class Variables
    Inherited from Classifier
  deepcopy = False
  type = 'classifier'
Method Details

test(self, data, **args)

source code 
test a classifier on a given dataset
Parameters:
  • classifier - a trained classifier
  • data - a dataset
  • stats - whether to compute the statistics of the match between the predicted labels and the given labels [True by default]
Returns:
a Results class instance
Overrides: evaluators.assess.test
(inherited documentation)

cv(self, data, **args)

source code 
perform k-fold cross validation
Parameters:
  • classifier - a classifier template
  • data - a dataset
  • numFolds - number of cross validation folds (default = 5)
  • numFolds - number of cross validation folds (default = 5)
  • seed - random number generator seed
  • foldsToPerform - number of folds to actually perform (in case you're doing n fold CV, and want to save time, and only do some of the folds)
Returns:
a Results object.
Overrides: evaluators.assess.cv
(inherited documentation)

stratifiedCV(self, data, **args)

source code 
perform k-fold stratified cross-validation; in each fold the number of patterns from each class is proportional to the relative fraction of the class in the dataset
Parameters:
  • classifier - a classifier template
  • data - a dataset
  • numFolds - number of cross validation folds (default = 5)
  • numFolds - number of cross-validation folds -- overrides the numFolds parameter
  • seed - random number generator seed
  • trainingAllFolds - a list of patterns that are to be used as training examples in all CV folds.
  • intermediateFile - a file name to save intermediate results under if this argument is not given, not intermediate results are saved
  • foldsToPerform - number of folds to actually perform (in case you're doing n fold CV, and want to save time, and only do some of the folds)
Returns:
a Results object.
Overrides: evaluators.assess.stratifiedCV
(inherited documentation)

loo(self, data, **args)

source code 

perform Leave One Out

USAGE: loo(classifier, data)

Returns:
a results object
Overrides: evaluators.assess.loo
(inherited documentation)