I have a Django application in which I need to implement a simple trending/ranking algorithm. I'm very lost as a :
I have two models, Book
and Reader
. Every night, new books are added to my database. The number of readers for each book are updated too every night i.e. One book will have multiple reader statistic records (one record for each day).
Over a given period (past week, past month or past year), I would like to list the most popular books, what algorithm should I use for this?
The popularity doesn't need to be realtime in any way because the reader count for each book is only updated daily.
I found one article which was referenced in another SO post that showed how they calculated trending Wikipedia articles but the post only showed how the current trend was calculated.
As someone pointed out on SO, it is a very simple baseline trend algorithm and only calculates the slope between two data points so I guess it shows the trend between yesterday and today.
I'm not looking for a uber complex trending algorithm like those used on Hacker News, Reddit, etc.
I have only two data axes, reader count and date.
Any ideas on what and how I should implement. For someone who's never worked with anything statistics/algorithm related, this seems to be a very daunting undertaking.
Thanks in advance everyone.
α
. Do you have any ideas how I can calculate this? – Glossolalia