Package pycv :: Package cs :: Package ml :: Package cla :: Package boost :: Module boosting :: Class DiscreteBoostedClassifier
[hide private]
[frames] | no frames]

Class DiscreteBoostedClassifier

source code

ml.Predictor --+                
               |                
  cla.Classifier --+            
                   |            
cla.BinaryClassifier --+        
                       |        
 score.ScoringClassifier --+    
                           |    
    score.AdditiveClassifier --+
                               |
                              DiscreteBoostedClassifier
Known Subclasses:
OnlineDiscreteBoostedClassifier

Discrete Boosted Classifier of this form:
F_M(x) = preceeding_classifier(x) + \sum_{m=1}^M c_m f_m(x) + b,
where
    c_m: coefficient, >= 0
    f_m(x): a binary classifier outputing {-1,1}
    b: shifting amount, default is 0



Nested Classes [hide private]

Inherited from ml.Predictor: EarlyPrediction

Instance Methods [hide private]
 
__init__(self, sc=None, weaks=[], c=array([], dtype=float64), b=0)
Initialize the DiscreteBoostedClassifier with some parameters.
source code
 
current_score(self, input_point, *args, **kwds)
Return the score of the classifier before being aggregated.
source code
 
score(self, input_point, *args, **kwds)
Return the score of an input point.
source code
 
refine(self)
Refine the classifier.
source code
 
normalize_c(self) source code

Inherited from score.AdditiveClassifier: preceeding_score, predict

Inherited from score.ScoringClassifier: scores

Inherited from cla.Classifier: get_error_rates, test

Method Details [hide private]

__init__(self, sc=None, weaks=[], c=array([], dtype=float64), b=0)
(Constructor)

source code 
Initialize the DiscreteBoostedClassifier with some parameters.
Parameters:
  • sc (ScoringClassifier) - a ScoringClassifier to preceed this classifier, or None if there's no classifier to preceed
  • weaks (list) - list of weak classifiers trained
  • c (numpy.array of real values) - array of coefficients for weak classifiers
  • b (double) - threshold of the classifier
Overrides: score.AdditiveClassifier.__init__

score(self, input_point, *args, **kwds)

source code 
Return the score of an input point.
Parameters:
  • input_point (a numpy.array) - an input point
Returns:
val : double
the input point's score
Overrides: score.AdditiveClassifier.score

refine(self)

source code 

Refine the classifier.

Refine the classifier by throwing away weak classifiers with zero coefficients.

Returns the filtering array so superclass(es) can filter their data.