ranking

Display a ranking grid for game : optimization of left outer join and find a player

Hello, I want to do a ranking grid. I have a table with different values indexed by a key: Table SimpleValue : key varchar, value int, playerId int I have a player which have several SimpleValue. Table Player: id int, nickname varchar Now imagine these records: SimpleValue: Key value playerId for 1 1 int ...

Optimize slow ranking query

I need to optimize a query for a ranking that is taking forever (the query itself works, but I know it's awful and I've just tried it with a good number of records and it gives a timeout). I'll briefly explain the model. I have 3 tables: player, team and player_team. I have players, that can belong to a team. Obvious as it sounds, playe...

Google Page Rank

Hi All I've heard and read that Google's Ranking System is like a points system, and that certain things such as Backlinks, properly-formatted html and many other things are each worth a certain amount of points. Can somebody please provide some sources on this? I have Google'd for this, but just came across a whole bunch of... nothing...

Trust metrics and related algorithms

I'm trying to learn more about trust metrics (including related algorithms) and how user voting, ranking and rating systems can be wired to stiffle abuse. I've read abstract articles and papers describing trust metrics but haven't seen any actual implementations. My goal is to create a system that allows users to vote on other users and ...

Keyword sorting algorithm

I have over 1000 surveys, many of which contains open-ended replies. I would like to be able to 'parse' in all the words and get a ranking of the most used words (disregarding common words) to spot a trend. How can I do this? Is there a program I can use? EDIT If a 3rd party solution is not available, it would be great if we can keep...

SQL Server - Fulltext Weights/Ranking based on matched Column

How can I apply a higher rank to a search result if a search word was found in a specific column? For example, if the search term is "King", and it was found in "LastName", I want that to be ranked higher than if it appears as part of "King Street" in the address. How do I do that? ...

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

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 ...

Simple ranking algorithm in Groovy

I have a short groovy algorithm for assigning rankings to food based on their rating. This can be run in the groovy console. The code works perfectly, but I'm wondering if there is a more Groovy or functional way of writing the code. Thinking it would be nice to get rid of the previousItem and rank local variables if possible. def fo...

Convert rank-per-candidate format to OpenSTV BLT format

I recently gathered, using a questionnaire, a set of opinions on the importance of various software components. Figuring that some form of Condorcet voting method would be the best way to obtain an overall rank, I opted to use OpenSTV to analyze it. My data is in tabular format, space delimited, and looks more or less like: A B C D E...

How do I assign different weights to columns in SQL Server Full Text Search?

I'm using SQL Server 2008 FTS and I'd like to be able to integrate weighted rankings into my search results. However, I'd like to weight the columns that a search term is found in differently. For example, if I have a Title column and a Description column, I want matches fond in Title to rank higher than matches in Description. Is th...

How to implement rank structure

What is the best way to implement a rank system: here is the code i will use public class MyRank { private int LevelOneMaxPoints = 100; private int LevelTwoMinPoints = 200; private int LevelTwoMaxPoints = 299; private int LevelThreeMinPoints = 300; private int LevelThreeMaxPoints = 399; private int LevelFourMinP...

How do I find the top N batters per year?

I'm playing around with the Lahman Baseball Database in a MySQL instance. I want to find the players who topped home runs (HR) for each year. The Batting table has the following (relevant parts) of its schema: +-----------+----------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default ...

Efficient method to calculate the rank vector of a list in Python

I'm looking for an efficient way to calculate the rank vector of a list in Python, similar to R's rank function. In a simple list with no ties between the elements, element i of the rank vector of a list l should be x if and only if l[i] is the x-th element in the sorted list. This is simple so far, the following code snippet does the tr...

How to select a row for certain (or give preference in the selection) in mysql?

Need your help guys in forming a query. Example. Company - Car Rental Table - Cars ID NAME STATUS 1 Mercedes Showroom 2 Mercedes On-Road Now, how do I select only one entry from this table which satisfies the below conditions? If Mercedes is available in Showroom, then fetch only that row. (i.e. row 1 in above examp...

mysql: group by ID, get highest priority per each ID

I have the following mysql table called "pics", with the following fields and sample data: id vehicle_id filename priority 1 45 a.jpg 4 2 45 b.jpg 1 3 56 f.jpg 4 4 67 cc.jpg 4 5 45 kt.jpg 3 6 67 gg.jpg 1 Is it p...

Matching, ranking based on relevance of each criteria

I have a growing database containing: a table of demands (multiple criteria) a table of offers (multiple criteria) Criteria can be string (e.g.: country name), boolean, numeric, ... I would like to find all demand-offer which match more or less (a little like job banks, matchmaking, ...) If tables didn't contain many rows I would c...

Join single row from a table in MySQL

I have two tables players and scores. I want to generate a report that looks something like this: player first score points foo 2010-05-20 19 bar 2010-04-15 29 baz 2010-02-04 13 Right now, my query looks something like this: select p.name player, m...

Ranking. Linq to sql question

I have a table of orders made by persons: Orders { Guid PersonId, int Priority, Guid GoodId } Priority is some integer number. For example: AlenId 1 CarId DianaId 0 HouseId AlenId 3 FoodId DianaId 2 FlowerId I want to retrieve highest priority orders for each person: AlenId 1 CarId DianaId 0 HouseId ...

What is the actual meaning of 'Rank' in Lucene when view by Luke?

Hi all, I am using Luke to view a Lucene index. There is a column named 'Rank'. What is the actual meaning of it? My guess is that the Rank means number of occurrence and the larger Rank number meaning the term is more significant. But I don't understand is that it is a full text search. If I search for 'apple', all the 'apple' index wil...

MySQL update statement to store ranking positions

Hi, I'm trying to get my head around a query and I just can't figure it out. I would appreciate if someone give me a pointer. As a simple example of what I'm trying to achieve, I have these records in the database Score|Ranking ------------- 100 |0 200 |0 300 |0 And I would like the Ranking field to contain 1,2,3 based on who's got...