PyML :: classifiers :: modelSelection :: ParamGrid :: Class ParamGrid
[frames] | no frames]

Class ParamGrid

source code

base.pymlObject.PyMLobject --+            
                             |            
    baseClassifiers.Classifier --+        
                                 |        
baseClassifiers.IteratorClassifier --+    
                                     |    
                                 Param --+
                                         |
                                        ParamGrid

A class for training and testing a classifier on a grid of parameter values for two attributes of the classifier.

Example:

p = ParamGrid(svm.SVM(ker.Gaussian()), 'C', [0.1, 1, 10, 100, 1000],
              'kernel.gamma', [0.001, 0.01, 0.1, 1, 10])
Nested Classes
    Inherited from baseClassifiers.Classifier
  resultsObject
Instance Methods
 
__init__(self, arg, attribute1='C', values1=[0.1,1,10,100,1000], attribute2='kernel.gamma', values2=[0.001,0.01,0.1,1,10]) source code
 
__repr__(self) source code
    Inherited from Param
 
__len__(self) source code
 
train(self, data, **args) source code
    Inherited from baseClassifiers.IteratorClassifier
 
__iter__(self) source code
 
cv(self, data, **args)
perform k-fold cross validation
source code
 
getClassifier(self) source code
 
loo(self, data, **args)
perform Leave One Out
source code
 
next(self) 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
 
test(self, data, **args)
test a classifier on a given dataset
source code
    Inherited from baseClassifiers.Classifier
 
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
 
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 baseClassifiers.Classifier
  deepcopy = False
  type = 'classifier'
Method Details

__init__(self, arg, attribute1='C', values1=[0.1,1,10,100,1000], attribute2='kernel.gamma', values2=[0.001,0.01,0.1,1,10])
(Constructor)

source code 
Parameters:
  • arg - another Param object, or the classifier to be used
  • attribute1 - the first attribute of the classifier that needs tuning
  • values1 - a list of values to try for attribute1
  • attribute2 - the second attribute
  • values2 - a list of values to try for attribute2
Overrides: baseClassifiers.Classifier.__init__

__repr__(self)
(Representation operator)

source code 
Overrides: baseClassifiers.Classifier.__repr__