Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A Ranking algorithm

I need to sort some products base on user ratings.

Suppose we have 3 products {a,b,c} and we have user's feedbacks about this products. It's not important which user give us feedback (this question is not about correlative filtering if you are familiar with it - user interests is not the case here)

Each of these below lines is feedback from users when they tried to compare the 3 products:

a 150 points - b 0 points (this user just told us what he thinks of 2 products a and b and in comparison of a and b he thought that if he gives a 150 point then b worth 0 points)

a 150 points - c 20 points

c 200 points - a 10 points (despite the previous one this user thinks that c is better that a)

a 200 points - b 40 points - c 100 points

a 150 points - b 50 points

a 150 points - b 20 points

(These ratings are just a sample and in the real world number of products and ratings are much bigger than this)

Now I need an algorithm to find product's rankings based on user votes. In my point of view, the best way is to describe this problem with a correlation graph and connect all the products to each other.

Any kind of help or tips is appreciated.

/********************************************************************************/

You cannot just add the points and calculate the mean of product's points because it's important how it got his points. Suppose a has got 800 points against b - then c get 10 points against a like this:

a 200 - b 0

a 200 - b 0

a 200 - b 0

a 200 - b 0

c 10 - a 0 (this means that c is better than a)

so definitely a is better than b but with a small 10 points c got a better rank from a

/********************************************************************************/

like image 647
EBAG Avatar asked Jul 17 '09 10:07

EBAG


People also ask

What is a ranking model?

What is a ranking model? Ranking is a type of supervised machine learning (ML) that uses labeled datasets to train its data and models to classify future data to predict outcomes. Quite simply, the goal of a ranking model is to sort data in an optimal and relevant order.

What is the best algorithm for learning to rank?

RankNet, LambdaRank, and LambdaMART are popular learning to rank algorithms developed by researchers at Microsoft Research. All make use of pairwise ranking.

What is Google's ranking algorithm called?

PageRank (PR) is an algorithm used by Google Search to rank web pages in their search engine results. It is named after both the term "web page" and co-founder Larry Page. PageRank is a way of measuring the importance of website pages.

How are ranking algorithms implemented?

There are two main approaches for this: Approach 1 – Implement your ranking algorithm as part of your database query. Approach 2 – Run a job that calculates 'ranking' for each item and updates that field in your database. Then simply query your data and sort by ranking.


1 Answers

You have some challenges. Add a ranking c 0 - b 20 and you got a circle, where c < b < a < c.

And of course your order is not only not transitif ( from a < b < c does not follow a < c ), it is also not total (there might be elements you cannot decide which is better because no user voting has been done, even through other elements.

What you get is a disconnected, directed, finite graph. (use the direction of the edges to say which element(node is better).

Starting at a certain node you can find better nodes marching through the graph, maybe finding multiple non comparable solutions. If you visit the starting node again, stop processing that path.

Maybe order theory in math can help you: look for order theory, partial order, Hasse diagram.

To make this more practical:

Use a two dimensional array with a row and a column per element. In the cell(a,b) calculate the sum of the ratings. Starting at a certain element a, follow all positiv (>0) connections, until you either reach a node that has no positiv connections or come back to a node you visited already. These nodes are your solutions.

like image 148
Ralph M. Rickenbach Avatar answered Sep 22 '22 23:09

Ralph M. Rickenbach