Skip to content

Instantly share code, notes, and snippets.

@ssbozy
Created June 16, 2017 18:23
Show Gist options
  • Save ssbozy/e60c914f1d9b33787d744687bba2bc47 to your computer and use it in GitHub Desktop.
Save ssbozy/e60c914f1d9b33787d744687bba2bc47 to your computer and use it in GitHub Desktop.
#This little script takes into consideration a cooling rate and creates a new value for the ratings as time progresses
from datetime import datetime
import time
COOLINGRATE = 0.2
def fetch_new_rating(rating, timestamp):
diff_time = time.time() - timestamp
new_ratings = current_rating * exp(-cooling_rate * diff_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment