Intelly
[work in progress]
Introduction
var intelly = ;
1. Recommendations
1.1 Similarity
1.1.1 Score
1.1.1.1 Euclidean Distance Score
Simple method to determine the similarity between two people based on how they ranked common items.
Not fair when data is not normalized (some people tend to be more harsh even though they mean the same, aka grade inflation).
Usage: euclideanDistance(a, b, callback)
Returns a value between 0 and 1, 0 being very distant, and 1 being exactly the same.
var euclideanDistanceScore = intellyrecommendationssimilarityscoreeuclideanDistance; ;
1.1.1.2 Pearson Correlation Score
Measures how well two sets of data fit on a straight line. The closer the two people are to the straight line, the more similar they are.
Similar to Euclidean Distance Score, but provides better results when ranking is not normalized (some people tend to be more harsh, aka grade inflation).
Usage: pearsonCorrelation(a, b, callback)
Returns a value between -1 and 1, where 1 is total positive correlation, 0 is no correlation, and −1 is total negative correlation
var pearsonCorrelationScore = intellyrecommendationssimilarityscorepearsonCorrelation; ;
1.1.2 Top
Find the top n similar people to a specific person.
Usage: top(rankings, target, n, similarityScoringFunc, callback)
Note that if n
is 0
, all people are returned.
// let's find the most similar people to me (Marco)intellyrecommendationssimilaritytop marco: 'Major Lazer - Get Free': 5 'The Roots - The Fire': 5 'Stromae - Formidable': 45 'Santigold - Disparate Youth': 4 'SOMETHING I MADE UP': 3 // note that the sets don't need to // contain the exact same elements, and any // exclusive element will be ignored diana: 'Major Lazer - Get Free': 5 'The Roots - The Fire': 5 'Stromae - Formidable': 45 'Santigold - Disparate Youth': 39 filipe: 'Major Lazer - Get Free': 35 'The Roots - The Fire': 37 'Stromae - Formidable': 4 'Santigold - Disparate Youth': 4 andre: 'Major Lazer - Get Free': 25 'The Roots - The Fire': 25 'Stromae - Formidable': 5 'Santigold - Disparate Youth': 3 marcelo: 'Major Lazer - Get Free': 2 'The Roots - The Fire': 25 'Stromae - Formidable': 27 'Santigold - Disparate Youth': 3 similar_harsher_person: 'Major Lazer - Get Free': 36 'The Roots - The Fire': 34 'Stromae - Formidable': 3 'Santigold - Disparate Youth': 29 'marco' 0 pearsonCorrelationScore { console; /* [ { key: 'diana', score: 0.9988907373180359 }, { key: 'similar_harsher_person', score: 0.9220108971042157 }, { key: 'andre', score: -0.36563621206356534 }, { key: 'filipe', score: -0.8528028654224343 }, { key: 'marcelo', score: -0.8697311348907081 } ] */};
1.1.3 Suggestions
Find the top n suggestions for a specific person.
Usage: suggest(rankings, target, n, similarityScoringFunc, callback)
Note that if n
is 0
, all items that the target
person does not know will be returned sorted by suggestion quality in descending order.
intellyrecommendations;
TODO
- Implement tests.
- Implement these similarity functions: Jaccard coefficient, Manhattan distance. More info at https://en.wikipedia.org/wiki/Metric_(mathematics)#Examples