Package pycv :: Package cs :: Package ml :: Package cla :: Module score :: Class Shifter
[hide private]
[frames] | no frames]

Class Shifter

source code

ml.Predictor --+                
               |                
  cla.Classifier --+            
                   |            
cla.BinaryClassifier --+        
                       |        
       ScoringClassifier --+    
                           |    
          AdditiveClassifier --+
                               |
                              Shifter

Shifter

An AdditiveClassifier that shifts (subtracts) the current score by a threshold to adapt the new score towards a different goal.



Nested Classes [hide private]

Inherited from ml.Predictor: EarlyPrediction

Instance Methods [hide private]
 
__init__(self, sc=None, thresh=0)
Initialize an Shifter.
source code
 
score(self, input_point, *args, **kwds)
Return the score of an input point.
source code

Inherited from AdditiveClassifier: preceeding_score, predict

Inherited from ScoringClassifier: scores

Inherited from cla.Classifier: get_error_rates, test

Method Details [hide private]

__init__(self, sc=None, thresh=0)
(Constructor)

source code 
Initialize an Shifter.
Parameters:
  • sc (ScoringClassifier) - a ScoringClassifier to preceed this classifier, or None if there's no classifier to preceed
  • thresh (double) - a threshold value, default is 0
Overrides: 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: AdditiveClassifier.score