Skip to content

Instantly share code, notes, and snippets.

@tusharmakkar08
Last active July 11, 2018 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tusharmakkar08/20dcf5654829302948e7927302fe76aa to your computer and use it in GitHub Desktop.
Save tusharmakkar08/20dcf5654829302948e7927302fe76aa to your computer and use it in GitHub Desktop.
Exponential decay
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