Last active
July 11, 2018 18:40
-
-
Save tusharmakkar08/20dcf5654829302948e7927302fe76aa to your computer and use it in GitHub Desktop.
Exponential decay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def time_impact_on_reliability(reliability, input_time): | |
""" | |
Calculates Impact of time on quote's reliability | |
:param reliability: Float. Current Reliability of the Quote | |
:param input_time: Datetime. Time when the quote was made | |
:return: Float. Impact of time on quote's reliability | |
""" | |
return reliability * numpy.exp(-1 * UserReliabilityCalculator.RELIABILITY_DECAY_RATE * | |
(datetime.datetime.now() - input_time).days) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment