Questions tagged [ranking]

Ranking is the sorted order of an element in a list of elements. Usually a high ranking means the element is good in terms of certain metric.

is used in:

  • sorting algorithms
  • information retrieval to represent the relevance of documents with respective to the search queries.
  • recommendation to rank top-k items.
1634 questions
0
votes
2 answers

Rolling decile rankings over time series without loop or using "running" from pkg:gregmisc

I've been using gregmisc library to perform a rolling decile ranking. Let's say I have vector 'X' of 1000 continuous value and I apply my function with a look back window of 250 (which is what I use). My current function works as follows: The…
ML_for_now
  • 63
  • 6
0
votes
2 answers

How to get correct position on ties in mysql rankings

This is my code and works for ties but it does not skip position on ties SELECT `item`, (`totalrate` / `nrrates`), @rank_count := @rank_count + (totalrate/nrrates < @prev_value) rank, @prev_value := totalrate/nrrates avg FROM …
0
votes
1 answer

Re-order a ranked-list based on new partial rank

I have a question about ranking algorithm that might hasn't exist so far: I have a list ordered by a score, for example a following list (denotes list-a): Now I have new information to know that the list should be ranked as follow (denotes…
sonvx
  • 411
  • 4
  • 7
0
votes
2 answers

Group and Rank Algorithm

I am trying to calculate rank based on grouping of score. Here is the example of data, the actual data is dynamic. higher and lowest score depends on result value. $data = array( array('id' => 1, 'name' => 'John Snow', 'score' => 80), …
rslhdyt
  • 149
  • 2
  • 14
0
votes
1 answer

Get the rank of a user in a score table

I have a simple MySQL table where I save the score of play. It looks like that: **Id - UserId - Score** The question is: How do I get what's a users rank? I have a users Id An Example **Id - UserId - Score** 1 - AAAA - 150 2 - BBBB - 110 3 -…
Marco Caltagirone
  • 1,206
  • 1
  • 14
  • 23
0
votes
2 answers

PostgreSQL query for calculating rotisserie baseball points

I am trying to write a PostgreSQL query to calculate fantasy baseball points, as described here. What I have so far is available in this SQLfiddle, which calculates the points for each statistic correctly, except in the case of ties. Points for…
tonycpsu
  • 407
  • 5
  • 13
0
votes
1 answer

Ranking query not working properly in mysql

I have this query that is trying to make a ranking from the total number of positive votes, that each user is getting. The problem is that the ranking is made by THE USER ID, not by VOTES. The problem is because of GROUP BY, but I have to use it…
AndreiTiberiu
  • 55
  • 2
  • 6
0
votes
1 answer

How can I select the top 2 values in a column per column and report this with both values and row names?

I have columns of a matrix with the names of users' unique ID's. Each row in the column represents a risk factor score based on a regression model that predicted risk. I want to report each individual's top 2 risk factors (both the row name…
Hack-R
  • 22,422
  • 14
  • 75
  • 131
0
votes
3 answers

SQL Ranking with multiple columns

I'm making a leaderboard with rankings. Its using SQL to get the data. Now I'm wondering, how can I actually let it rank? For example: Name: Wins: Points: Skills: Matt 1 2009 2 Mark 4 2014 …
Matt
  • 69
  • 7
0
votes
2 answers

Star ranking ( numerous criteria) in css

Here is a code of what I'm looking for : http://jsfiddle.net/bumbu/rXWpy/5/light/ However, if I try to put the html code twice :
Thomas54
  • 55
  • 1
  • 1
  • 5
0
votes
1 answer

Rank an overall score created by SUM in MySQL

I have a table of gymnastics results where only the individual apparatus scores are recorded so I'm using SUM to create an overall score. Obviously I can sort on that but I would really like to add an extra column for 'rank/position' based on the…
Nathan Pitman
  • 2,286
  • 4
  • 30
  • 46
0
votes
2 answers

Can I make an App Engine model property call a function?

I'm implementing a frontpage with "hot" stories based on a certain ranking algorithm. However, I can't figure out how to pass App Engine Datastore my own sort function (like I can in Python with sort(key=ranking_function)). I want something like…
dave paola
  • 1,815
  • 3
  • 16
  • 27
0
votes
1 answer

SQL Server: issue with adapting Rank statement in Select

I have a dynamic stored procedure that start as follows with the declaration of a temp table and then an insert statement. Can someone here tell me how I need to adapt the following line so that it creates a rank based on the groupCount (desc)…
user2571510
  • 11,167
  • 39
  • 92
  • 138
0
votes
1 answer

Laravel groupBy rank resulting in multiple grouped rows

I'm using the groupby() function on my query to get some stats on two groups of athletes. I have a table with my athletes and one with their performance. - athletes table -- id -- name -- group_id -performance table -- id -- DateTime --…
Wistar
  • 3,770
  • 4
  • 45
  • 70
0
votes
1 answer

Using a mysql-variable in java (for a ranking-query)

I'd like to create a ranking in a MySQL-Table for Users, sorted by their score. I already found a nice Query for that, but this Query is only working with phpmyadmin, not in java... I got the following MySQL-Query which works well in phpmyadmin to…
hiivin
  • 3
  • 2