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

Class GeneralizedCascade

source code

ml.Predictor --+            
               |            
  cla.Classifier --+        
                   |        
cla.BinaryClassifier --+    
                       |    
           ScoredCascade --+
                           |
                          GeneralizedCascade

A cascade of M weak binary classifiers. Each classifier f_m(x) \in
{-1,+1} is associated with an score c_m, and a boolean value z_m which
tells whether the weak classifier is 'an improver' (z_m = 1) or 'a filter'
(z_m = 0) (to be explained below). Define the total scores of point x
up to stage m:
    F_m(x) = \sum{i=1}^m z_i c_i f_i(x)
An improver at stage m does not classify x, but improves F_m(x)
to reach a certain goal (e.g. to minimize the total classification error up
to stage m). A filter, on the other hand, classifies x as negative
immediately iff:
    G_m(x) = F_{m-1}(x) + c_i f_i(x) < 0
Or pass x to the next stage. Finally, the cascade classifies x as
positive iff F_M(x) >= 0, and negative otherwise.



Nested Classes [hide private]

Inherited from ml.Predictor: EarlyPrediction

Instance Methods [hide private]
 
__init__(self) source code
 
add_binary_classifier(self, binary_classifier, c, is_improver) source code
 
score(self, input_point, *args, **kwds)
Compute the score of an input point.
source code

Inherited from ScoredCascade: generate_negatives, predict, scores

Inherited from cla.Classifier: get_error_rates, test

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Overrides: ScoredCascade.__init__

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

source code 

Compute the score of an input point.

Input:

input_point: an input point

Output:

z: (boolean) whether it passes the cascade y: predicted class s: the score value

Overrides: ScoredCascade.score
(inherited documentation)