FAQ Database Discussion Community

What's the algorithm to assign people their most preferred value based on a list of their top choices?

algorithm,sorting,language-agnostic,ranking,choice
Let's say users input their top three (or N) preferred baseball positions: // first element of each list being most preferred userA = ["backcatcher", "center field", "short stop"]; userB = ["pitcher", "backcatcher", "center field"]; userC = ["pitcher", "center field", "short stop"]; userD = ["short stop", "backcatcher", "pitcher"]; ... users =...

TF - IDF vs only IDF

nlp,ranking,tf-idf
Is there any case when IDF is better than TF-IDF? As far I understood TF is important to give a weight to a word within a document to match that document with a predefined query. If I'd like just to sort the importance of words in a collection of documents...

Ranking without an order by

oracle,ranking
Is there a way to create a row_number "on the fly" without ordering by a column? I've got this query : select regexp_substr(',A-B,B-C,C-D', '[^,]+', 1, level) as legs from dual connect by regexp_substr(',A-B,B-C,C-D', '[^,]+', 1, level) is not null And I need to keep the order of my rotation, but...

Algorithm for ranking with a star rating (1-5) like Amazon?

algorithm,amazon,ranking,voting
I'm a CS student doing a report on alternative voting systems. One of the best systems I believe is a ranked vote. For example.. In a presidential election, each president would be ranked 1-5. (IMO the problem with the US system is that only votes for the winner actually count)...

How to remove duplicate search result in elasticsearch?

elasticsearch,ranking
First Create some example data (e1,e2,e3 are types and test is the index name): PUT test/e1/1 { "id":1 "subject": "subject 1" } PUT test/e2/1 { "id":1 "subject": "subject 2" } PUT test/e3/2 { "id":2 "subject": "subject 3" } Now my question is: how can I get just these two data?...

Customize score for certain condition in Lucene TFIDF

java,sorting,lucene,ranking,tf-idf
I have a program that takes an input query and ranks the similar documents based on its TFIDF score. The thing is, I want to add some keywords and treat them as the "input" as well. These keywords will be different for each query. For example if the query is...

Rank Average with PHP

php,math,formula,ranking
In Excel there's a function Rank Average (see documentation). I wish to do the same in PHP. Looking online, I find a lot of ranking solutions, but not a lot of those take duplicates into account and when they do, the result I get is not the same as Excel...

How to tune parameters of SVM Rank?

machine-learning,kernel,svm,ranking
I am using SVM Rank, which has multiple parameters, changing whom I am getting a variety of results. Is there some mechanism to tune and get the best parameters, as tuned according to the best results on validation set? Below are the different parameters: Learning Options: -c float -> C:...

The most efficient way to calculate rankings in real time games [closed]

php,mysql,algorithm,ranking,ranking-functions
I want to know the fastest and most efficient way to compute points and ranking in real time. I'm doing a betting football game (a game where users try to predict the outcome of a game before it). In my country is called "Quiniela". Players put "predictions" just before the...

Sum and Ranking - Excel

excel,sum,ranking
My goal is to sum the scores with removing the top 2 highest and lowest 2 scores (Row T). I have been trying to figure out how make the number error change to zero, but am having a difficult time. My formula is =(SUM(D9:N9)-LARGE(D9:N9,1)-LARGE(D9:N9,2)-SMALL(D9:N9,1)-SMALL(D9:N9,2)) Your time and help is very...

r rank value in vector

r,vector,ranking,rank
I have a sequence of numbers and vectors that should be used to evaluate each of the sequence of numbers according to their ranks. Example a <- c(20, 29, 22) b <- c(21, 22, 27) data <- data.frame(cbind(a,b)) c1 <- c(12,23,34,21,33,22,35,3,5,6,7,29,49) c2 <- c(12,23,34,21,33,22,35,3,5,6,7,29,49) How can I check the rank...

GSA - Determining which queries need higher Click Rank from ASR

I have been analyzing click data from our Google Search Appliance (GSA) Advanced Search Reports (ASR), and I have run into a bit of an issue. I am trying to generate a .csv report that is ordered by a "priority" that determines which queries would benefit from a manual boost...

R function for weighting teams by strength of opponent?

r,ranking,ranking-functions,weighting
I'm analyzing some sports data, and I have a set of win/loss records for about 40 teams. I would like to come up with a ranking where each win is weighted by the strength of the opponent. This would have to be some iterative/recursive sort of thing where the weights...

Order results by time added, but rank them by vote count

php,mysql,order,ranking
I'm writing a web app where people can add and vote on ideas. When outputting the ideas I want them to be ordered by their total vote count or time added, but always have a rank based on the vote count. This is what I have now: function get_ideas(\$status, \$sortby,...

Algorithm/formula to calculate Product ranking on a ecommerce website(Based on following criteria)

algorithm,elasticsearch,e-commerce,ranking,ranking-functions
I have been Working on algorithms and formulas to find out a score for the products available on my ecommerce website.Basically, I want to calculate some kind of score to rank the products when a user searches it. I'll give some background on the criteria i am planning to define...

Modelling a leaderboard/ranking list in Riak

I am currently researching databases for a scalable game backend. Riak looks very nice from an operational point of view. I can easily see how to model user and game data and statistics in Riak. But I have trouble with leaderboards/ranking lists. Assuming we have millions of players and the...

Horizontal Leader Board based on organisation

excel-formula,lookup,ranking
I am trying to work out the ranking of top 3 users at different organisations and have the data presented horizontally for each user so it can be inputted into our email system to personalise emails. I am able to create a ranking vertically but I am not sure how...

mysql ranking for a single user

php,mysql,ranking
Im using a suggestion from Daniel Vassallo here to rank entries in my mysql table. The suggestion doesn't deal with ties and thats the way I want it as a newer entry does not get a higher rank than an older entry with the same score on my scoreboard that...

How to boost index type in elasticsearch?

elasticsearch,ranking
I used to search like this: curl -XGET localhost:9200/users/_search but users contains user a,b,c like this: curl -XGET localhost:9200/users/a,b,c/_search users is the first index, a/b/c is type. How to boost type a in this query? Best with sample code, thanks....

Rank formula-type in LimeSurvey

ranking,limesurvey
I have four formula type questions in a LimeSurvey were the resultants are integers e.g Q-1=23 Q-4=19 Q-7=45 Q-9=24 I need to find the greatest number and its related question # In this case the greatest # is 45 and the question # is Q-7 I have been reading the...