Package PyML :: Package classifiers :: Module platt :: Class Platt2
[frames] | no frames]

Class Platt2

source code

base.pymlObject.PyMLobject --+            
                             |            
    baseClassifiers.Classifier --+        
                                 |        
     composite.CompositeClassifier --+    
                                     |    
                                 Platt --+
                                         |
                                        Platt2

Converts a real valued classifier into a conditional probability estimator. This is achieved by fitting a sigmoid with parameters A and B to the values of the decision function: f(x) --> 1/(1+exp(A*f(x)+B)

The fitting procedure is a Levenberg-Marquardt optimization derived by Tobias Mann using Mathematica, to optimize the objective function in:

John C. Platt. Probabilistic Outputs for Support Vector Machines and Comparisons to Regularized Likelihood Methods. in: Advances in Large Margin Classifiers A. J. Smola, B. Schoelkopf, D. Schuurmans, eds. MIT Press (1999).

Nested Classes
    Inherited from baseClassifiers.Classifier
  resultsObject
Instance Methods
 
fit_A_B(self, prior1, prior0, out, deci, Y) source code
 
get_proposed_update_vec(self, m, v) source code
 
condition_number(self, M) source code
 
log_likelihood(self, t, f, A, B) source code
 
two_by_two_inverse(self, M) source code
 
gradient(self, t, f, A, B) source code
 
hessian(self, t, f, A, B) source code
 
dF_dA(self, t, f, A, B) source code
 
dF_dB(self, t, f, A, B) source code
 
dF_dAA(self, t, f, A, B) source code
 
dF_dBB(self, t, f, A, B) source code
 
dF_dAB(self, t, f, A, B) source code
    Inherited from Platt
 
classify(self, data, i) source code
 
decisionFunc(self, data, i) source code
 
load(self, fileName) source code
 
save(self, fileName) source code
 
test(classifier, data, **args)
test a classifier on a given dataset
source code
 
train(self, data, **args) source code
    Inherited from composite.CompositeClassifier
 
__init__(self, classifier, **args) source code
 
__repr__(self) source code
 
getTest(self) source code
 
preproject(self, data) source code
 
setTest(self) source code
    Inherited from baseClassifiers.Classifier
 
cv(classifier, data, numFolds=5, **args)
perform k-fold cross validation
source code
 
getTrainingTime(self) source code
 
logger(self) source code
 
loo(classifier, data, **args)
perform Leave One Out
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
 
stratifiedCV(classifier, data, numFolds=5, **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
 
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 Platt
  attributes = {'mode': 'holdOut', 'numFolds': 3, 'fittingFracti...
    Inherited from composite.CompositeClassifier
  deepcopy = True
    Inherited from baseClassifiers.Classifier
  type = 'classifier'
Method Details

fit_A_B(self, prior1, prior0, out, deci, Y)

source code 
Overrides: Platt.fit_A_B