php - Calculating a File's popularity by specific factors -


i'm developing website users can share, download, rate , favorite files. in order display popular files, i've come algorithm calculate score value every file.

right now, score consists out of 50% like/dislike ratio , 50% amount of downloads (i use exponential function upper limit). however, algorithm neither include age of file nor include amount of favorites.

how include factors popular files? there best practices out there? developing in php, pseudocode fine of course.

thanks in advance,

crushedpixel

the way reddit sorts out posts works nicely. in case don't know, reddit, @ first sorts upvotes. after period of time (that don't know) adds weights posts allow newer posts surface. suggest use idea base 6 different sorting methods go 3 groups. groups favorites, downloads, , l/d ratio (each group have sort most/least making 6 sorting methods). since each video have of these numbers stored in sort of database, use same algorithm of them. replace variables whatever sorting method has been chosen. 4th, general purpose one, maybe take average of post's position on 3 other sorting systems. example, if video 1st on l/d, 2nd on favorites, , 2nd on downloads , competes against video 1st on favorites, 2nd in l/d , 3rd in downloads. 1st posts average 1 , 1/3 while 2nd posts average 2 (the lower better). so, first post 1st on overall list , 2nd post 2nd on overall list.

hope helps! rad


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -