Adjust package score frecency factor

This commit is contained in:
rubenwardy 2024-03-07 21:20:32 +00:00
parent a79337cc31
commit 0b76982d63
2 changed files with 2 additions and 2 deletions

@ -19,7 +19,7 @@ score = avg_downloads + reviews_sum;
## Pseudo rolling average of downloads
Each package adds 1 to `avg_downloads` for each unique download,
and then loses 5% (=1/20) of the value every day.
and then loses 6.66% (=1/15) of the value every day.
This is called a [Frecency](https://en.wikipedia.org/wiki/Frecency) heuristic,
a measure which combines both frequency and recency.

@ -20,7 +20,7 @@ from app.tasks import celery
@celery.task()
def update_package_scores():
Package.query.update({ "score_downloads": Package.score_downloads * 0.95 })
Package.query.update({ "score_downloads": Package.score_downloads * 0.93 })
db.session.commit()
for package in Package.query.all():