ranking

Best way to update user rankings without killing the server

半世苍凉 提交于 2019-12-03 19:34:45
I have a website that has user ranking as a central part, but the user count has grown to over 50,000 and it is putting a strain on the server to loop through all of those to update the rank every 5 minutes. Is there a better method that can be used to easily update the ranks at least every 5 minutes? It doesn't have to be with php, it could be something that is run like a perl script or something if something like that would be able to do the job better (though I'm not sure why that would be, just leaving my options open here). This is what I currently do to update ranks: $get_users = mysql

Voting algorithm: how to calculate rank?

故事扮演 提交于 2019-12-03 16:13:37
I am trying to figure our a way to calculate rank. Right now it simply takes ratio of wins / losses of each individual entry, so e.g. one won 99 times out of a 100, it has 99% winning rank. BUT if an entry won 1 out of total 1 votes, it will have a 100% winning rank, but definitely it can't be higher that of the one that won 99 times. What would be a better way to do this? Depending on how complicated you want to make it, the Elo system chess uses (or something similar) may be what you want: http://en.wikipedia.org/wiki/Elo_rating_system Even if a person has won 1/1 matches, his rating would

How to create a Decile and Quintile columns to rank another variable based on size using Python, Pandas?

不打扰是莪最后的温柔 提交于 2019-12-03 10:20:19
问题 I have a data frame with a column containing Investment which represents the amount invested by a trader. I would like to create 2 new columns in the data frame; one giving a decile rank and the other a quintile rank based on the Investment size. I want 1 to represent the decile with the largest Investments and 10 representing the smallest. Smilarly, I want 1 to represent the quintile with the largest investments and 5 representing the smallest. I am new to Pandas, so is there a way that I

Sorting A List Of Songs By Popularity

江枫思渺然 提交于 2019-12-03 09:44:53
问题 For student council this year, I'm on the "songs" committee, we pick the songs. Unfortunately, the kids at the dances always end up hating some of the stupid song choices. I thought I could make it different this year. Last thursday, I created a simple PHP application so kids could submit songs into the database, supplying a song name, artist, and genre (from a drop-down). I also implemented a voting feature similar to Reddit's. Click an upvote button, you've upvoted the song, incremented the

How to get item ranking in list sorted by multiple fields in Mongoose

别等时光非礼了梦想. 提交于 2019-12-03 07:13:18
I have a number of user records (> 10000) in a MongoDB collection which can be sorted by score desc + time asc + bonus desc. How can I get the ranking of one user in the list according to this sorting using Mongoose? Assume index has been built correctly. Count the number of users that come before this user in your sort order. I'll start with the case of a simple (non-compound sort) because the query in the compound case is more complicated, even though the idea is exactly the same. > db.test.drop() > for (var i = 0; i < 10; i++) db.test.insert({ "x" : i }) > db.test.find({ }, { "_id" : 0 })

Simple ranking algorithm

拥有回忆 提交于 2019-12-03 06:14:23
I need to create a poll that is to create a ranking list of items in order of how good they are. I intend to show each user two items together and make them choose one which they think is better, and repeat the process multiple times over. It is sort of similar to what you could see in the Social Network movie. How should I be ranking the items based on the received answers? Look at the ELO chess rating system if you want something fancy. I think you can use the Elo Algorithm which was used to rank chess players and was created by Professor Arpad Elo. You can read more abot this algorithm on

Algorithm to calculate a page importance based on its views / comments

萝らか妹 提交于 2019-12-03 03:59:00
问题 I need an algorithm that allows me to determine an appropriate <priority> field for my website's sitemap based on the page's views and comments count. For those of you unfamiliar with sitemaps, the priority field is used to signal the importance of a page relative to the others on the same website. It must be a decimal number between 0 and 1. The algorithm will accept two parameters, viewCount and commentCount , and will return the priority value. For example: GetPriority(100000, 100000); //

ranking entries in mysql table

☆樱花仙子☆ 提交于 2019-12-03 03:37:34
I have a MySQL table with many rows. The table has a popularity column. If I sort by popularity, I can get the rank of each item. Is it possible to retrieve the rank of a particular item without sorting the entire table? I don't think so. Is that correct? An alternative would be to create a new column for storing rank, sort the entire table, and then loop through all the rows and update the rank. That is extremely inefficient. Is there perhaps a way to do this in a single query? There is no way to calculate the order (what you call rank) of something without first sorting the table or storing

How to get back the new value after an update in a embedded array?

匿名 (未验证) 提交于 2019-12-03 03:09:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Given the following MongoDB collection: { "_id": ObjectId("56d6a7292c06e85687f44541"), "name": "My ranking list", "rankings": [ { "_id": ObjectId("46d6a7292c06e85687f55542"), "name": "Ranking 1", "score": 1 }, { "_id": ObjectId("46d6a7292c06e85687f55543"), "name": "Ranking 2", "score": 10 }, { "_id": ObjectId("46d6a7292c06e85687f55544"), "name": "Ranking 3", "score": 15 }, ] } Here is how I increase the score of a given ranking: db.collection.update( { "_id": ObjectId("56d6a7292c06e85687f44541"), "rankings._id" : ObjectId(

用深度学习(DNN)构建推荐系统 - Deep Neural Networks for YouTube Recommendations论文精读

匿名 (未验证) 提交于 2019-12-03 00:19:01
用深度学习(DNN)构建推荐系统 - Deep Neural Networks for YouTube Recommendations论文精读 清凇 勇敢闯一闯 292 人赞了该文章 这篇论文 Deep Neural Networks for YouTube Recommendations 是google的YouTube团队在推荐系统上DNN方面的尝试,发表在16年9月的RecSys会议。虽然去年读过,一方面因为这篇paper的来源于youtube团队的工业实践,G家的东西,非常值得好好研究下;另一方面,目前正在公司推进的项目对该论文有参考(both method and insight),也正准备在team内部分享下,因此整理下论文精读笔记。(PS:为方便阅读,下文以第一人称代替作者) 虽然国内必须翻墙才能登录YouTube,但想必大家都知道这个网站。基本上算是世界范围内视频领域的最大的网站了,坐拥10亿量级的用户,网站内的视频推荐自然是一个非常重要的功能。本文就focus在 YouTube视频推荐的DNN算法,文中不但详细介绍了Youtube推荐算法和架构细节,还给了不少 practical lessons and insights,很值得精读一番 。下图便是YouTube APP视频推荐的一个例子。 在推荐系统领域,特别是YouTube的所在视频推荐领域,主要面临三个挑战: