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

Class OnlineDiscreteBoostedClassifier

source code

ml.Predictor --+                    
               |                    
  cla.Classifier --+                
                   |                
cla.BinaryClassifier --+            
                       |            
 score.ScoringClassifier --+        
                           |        
    score.AdditiveClassifier --+    
                               |    
       DiscreteBoostedClassifier --+
                                   |
      ml.OnlineLearningInterface --+
                                   |
                                  OnlineDiscreteBoostedClassifier

DiscreteBoostedClassifier with an ability to learn online.

Nested Classes [hide private]

Inherited from ml.Predictor: EarlyPrediction

Instance Methods [hide private]
 
__init__(self, sc=None, weaks=[], c=array([], dtype=float64), k=1.0, skewness_balancing=0, polarity_balancing=1)
Initialize the OnlineDiscreteBoostedClassifier with some parameters
source code
 
learn(self, input_point, j, weight=None, *args, **kwds)
Learn incrementally Learn incrementally with a new input point, its class, and optionally its weight.
source code

Inherited from DiscreteBoostedClassifier: current_score, normalize_c, refine, score

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), k=1.0, skewness_balancing=0, polarity_balancing=1)
(Constructor)

source code 
Initialize the OnlineDiscreteBoostedClassifier 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
  • k (double) - false negatives penalized k times more than false positives
  • skewness_balancing (int) -
    type of skewness balancing among weak classifiers
    0 = no balancing at all, this is the original AdaBoost's
    method

    1 = asymmetric weight balancing, Viola-Jones (NIPS'02) 2 = skewness balancing, Pham-Cham (CVPR'07)

  • polarity_balancing (int) -
    use polarity balancing?
    0 = no polarity balancing, same as Oza-Rusell (ICSMC'05) 1 = polarity balancing, Pham-Cham (CVPR'07)
Overrides: DiscreteBoostedClassifier.__init__

learn(self, input_point, j, weight=None, *args, **kwds)

source code 
Learn incrementally

Learn incrementally with a new input point, its class, and optionally 
its weight. Other parameters like k and balancing are derived from 
the class itself.

TODO: Re-test this function extensively.

Input:
    input_point: a new input point
    j: its corresponding class
    w: optionally its weight, or 1 if not specified
    polaritybalancing: use polarity balancing?
        0 = no polarity balancing, same as Oza-Rusell (ICSMC'05)
        1 = polarity balancing, Pham-Cham (CVPR'07)

Overrides: ml.OnlineLearningInterface.learn