ranking

Combining heuristics when ranking social network news feed items

痞子三分冷 提交于 2019-12-08 15:44:44
问题 We have a news feed, and we want to surface items to the user based on a number of criteria. Certain items will be surfaced because of factor A, another because of factor B, and yet another because of factor C. We can create individual heuristics for each factor, but we then need to combine these heuristics in such a way that it promotes the best content considering each factor while still giving a mix of content from each factor. Our naive approach is to load the top n from each factor, take

How to select or skip to the next row if meets certain criteria

旧时模样 提交于 2019-12-08 11:13:02
问题 I really am not even sure which direction to go with this... I'm trying to select a list of customers based on the following rules: Select all rows from Customer where Ranking = 1, OR if Ranking = 1 AND Type = Store then Rank 1 and return the row with Rank 2. OR if the customer only has 1 row, return it even if the type = Store. The Ranking is not assigned with a Rank statement in the query. Rather it is an actual column in the Customer table (populated by a stored proc that does the ranking)

Rank and unrank permutation with special properties

雨燕双飞 提交于 2019-12-08 08:16:34
问题 I want to rank and unrank permutations with special properties. How can i do this? The both properties of permutations in the set are: each permutation has only 1 cycle each permutation consist of subsets of permutation elements, where the subsets are in some special ordering. For example: The permutations with length 6 (N := 6) has following permutation elements: (1,2,3,4,5,6) with subsets: Subset S1 := (5,6) Subset S2 := (3,4) Subset S3 := (1,2) Where the elements are S1 > S2 > S3 . So the

Ranking objects in List<> by multiple criteria

喜夏-厌秋 提交于 2019-12-08 03:00:01
问题 I have a list of objects representing plants - each of which have member properties which represent a range of tolerable environmental conditions. I want to re-order this list such that the plant objects are ranked in order of suitability. I figure I want to give each item in the list a rank for temperature/pH suitability based on the proximity of the middle of their temperature/pH range to the environment data supplied. I would then average the ranks and sort the list by this number. However

Frequency count of 5 rankings in R

爱⌒轻易说出口 提交于 2019-12-08 02:58:25
问题 Say I have 5 items A, B, C, D, E in a questionnaire and got respondents to rank them. The data looks like this, > df rank1 rank2 rank3 rank4 rank5 1 A B C D E 2 A C B D E 3 C A B E D 4 B A C D E 5 A B D C E How do I count the frequency of each rank by item so the output looks like this, item rank1 rank2 rank3 rank4 rank5 1 A 3 2 0 0 0 2 B 1 2 2 0 0 3 C 1 1 2 1 0 4 D 0 0 1 3 1 5 E 0 0 0 1 4 回答1: We can use table after converting to factor using base R lvls <- sort(unique(unlist(df))) sapply(df

Ranking Elements of multiple Lists by their count in Python

时光毁灭记忆、已成空白 提交于 2019-12-07 16:11:50
问题 I want to rank multiple lists according to their elements how often they appear in each list. Example: list1 = 1,2,3,4 list2 = 4,5,6,7 list3 = 4,1,8,9 result = 4,1,2,3,4,5,6,7,8 (4 is counted three times, 1 two times and the rest once) I've tried the following but i need something more intelligent and something i can do with any ammount of lists. l = [] l.append([ 1, 2, 3, 4, 5]) l.append([ 1, 9, 3, 4, 5]) l.append([ 1, 10, 8, 4, 5]) l.append([ 1, 12, 13, 7, 5]) l.append([ 1, 14, 13, 13, 6])

Generate standard competition rankings from a list of scores

倖福魔咒の 提交于 2019-12-07 13:46:49
问题 Given a list of scores (e.g. 5, 5, 4, 2, 2, 0), I'm looking to return the standard competition rankings (1, 1, 3, 4, 4, 6). From Wikipedia's ranking page, here's a summary of SRC: Standard competition ranking ("1224" ranking) In competition ranking, items that compare equal receive the same ranking number, and then a gap is left in the ranking numbers. The number of ranking numbers that are left out in this gap is one less than the number of items that compared equal. Equivalently, each item

Rank and unrank Combination with constraints

天涯浪子 提交于 2019-12-06 13:21:18
问题 I want to rank and unrank combinations with an Element distance constraint. Selected elements cannot repeated. For example: n := 10 elements choose from k := 5 elements being choosen d := 3 max distance between 2 choosen elements 1,3,5,8,9 matches the constraint 1,5,6,7,8 dont matches the constraint How can ranking the combination with given distance constraint, where 1,2,3,4,5 is smaller than 1,2,3,4,6 ? Is there a way do the ranking without compute the combinations with smaller Rank? 回答1:

Ranking objects in List<> by multiple criteria

僤鯓⒐⒋嵵緔 提交于 2019-12-06 12:41:50
I have a list of objects representing plants - each of which have member properties which represent a range of tolerable environmental conditions. I want to re-order this list such that the plant objects are ranked in order of suitability. I figure I want to give each item in the list a rank for temperature/pH suitability based on the proximity of the middle of their temperature/pH range to the environment data supplied. I would then average the ranks and sort the list by this number. However, I'm unsure what the best approach would be for tracking the ranks given to each item in the list.

How to boost index type in elasticsearch?

陌路散爱 提交于 2019-12-06 07:47:30
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. You can boost index types using terms query. First Create some test data (e1,e2,e3 are types and test is the index name): PUT test/e1/1 { "subject": "subject 1" } PUT test/e2/1 { "subject": "subject 1" } PUT test/e3/1 { "subject": "subject 1" } Now using term query with custom boost by type: GET test/_search { "query": { "bool": {