WIP
This commit is contained in:
@ -24,9 +24,14 @@ def _entropy(temp, prob):
|
|||||||
f = (c + 1) * prob
|
f = (c + 1) * prob
|
||||||
return -f * math.log2(f)
|
return -f * math.log2(f)
|
||||||
|
|
||||||
def _inverse_prob(temp, prob):
|
def _weighted_inverse(temp, prob):
|
||||||
|
alpha = 10
|
||||||
|
beta = 1
|
||||||
|
|
||||||
iprob = 1 - prob
|
iprob = 1 - prob
|
||||||
return (temp / 100) * iprob + ((100 - temp) / 100) * prob
|
inverse_weighted = (temp / 100) * iprob + ((100 - temp) / 100) * prob
|
||||||
|
|
||||||
|
return (alpha * inverse_weighted + beta * prob) / (alpha + beta)
|
||||||
|
|
||||||
class Temperature(object):
|
class Temperature(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -35,7 +40,7 @@ class Temperature(object):
|
|||||||
self._adjustmentFormulas = {
|
self._adjustmentFormulas = {
|
||||||
'original' : _original,
|
'original' : _original,
|
||||||
'entropy' : _entropy,
|
'entropy' : _entropy,
|
||||||
'inverse' : _inverse_prob}
|
'inverse' : _weighted_inverse}
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self.actual_value = 100.0
|
self.actual_value = 100.0
|
||||||
|
|||||||
Reference in New Issue
Block a user