A stateful cutoff calculator. The client interacts with it by checking
wheter a score meets the cutoff. Each such transaction has the side
effect of adjusting the cutoff in order to keep the acceptance rate close
to the target rate.
The calculator keeps a "current cutoff", meaning the one
that was used to test the last score to be seen, and a "next
cutoff", which is the latest cutoff to be computed, to be used for
testing the next score.
|
__init__(self,
target_rate=0.1,
induction_period=30,
move_size=10.0,
csvwriter=None)
x.__init__(...) initializes x; see help(type(x)) for signature |
|
|
{str: float}
|
getCutoffs(self)
Return a dict with the current and next cutoff. |
|
|
|
|
|
computeInitialCutoff(self,
tolerance=1.5,
max_rate=0.99)
Using the statistical distribution of the scores collected so far,
compute a cutoff that should accept the target rate, times a
tolerance factor. |
|
|
{str: float}
|
addPoses(self,
poses)
Add multiple poses at once, and return the current and next cutoffs. |
|
|
list of float
|
getScores(self)
Return a list with all the scores that have been processed by the
calculator. |
|
|
|
|
|
_addScore(self,
score)
Add a score to the calculator without updating the cutoff. |
|
|
|
|
bool
|
_checkScore(self,
score)
Test a pose to see if it passes the filters, WITHOUT updating the
cutoff. |
|
|
bool
|
checkScore(self,
score,
title)
Test a pose to see if it passes the filters and update the cutoff as
a side effect. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|