Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RACCOON for bill in website #39

Open
ngtson93 opened this issue Jan 25, 2016 · 0 comments
Open

RACCOON for bill in website #39

ngtson93 opened this issue Jan 25, 2016 · 0 comments

Comments

@ngtson93
Copy link

client.zrevrange(similaritySet, 0, config.nearestNeighbors -1, function(err, mostSimilarUserIds){
// returns an array of the users that are least simimilar within k nearest neighbors
client.zrange(similaritySet, 0, config.nearestNeighbors -1, function(err, leastSimilarUserIds){
// iterate through the user ids to create the redis keys for all those users likes
_.each(mostSimilarUserIds, function(id, key){
setsToUnion.push([config.className,id,'liked'].join(":"));
});
// if you want to factor in the least similar least likes, you change this in config
// left it off because it was recommending items that every disliked universally
if (config.factorLeastSimilarLeastLiked){
_.each(leastSimilarUserIds, function(id, key){
setsToUnion.push([config.className,id,'disliked'].join(":"));
});
}
...
how it finds the nearest neighbor? and recommendedSet?
With k=1 it get biggest value in similaritySet
but k=3 and k=5 is not true
i changed finalJaccardScore = 1.0*(similarity / ratedInCommon)
I use RC cho web and use "for" to add more products in the bill
var oid = req.query.oid;
var ids = req.query.ids;
if (!oid || !ids){
//tra ve loi o day
returnData(res,"ERROR");
}
var uid = toUI(oid);
var arr = ids.split(",");
var c = 0;
var id = "";
var max = arr.length;
for(var i=0;i<max;i++) {
id = arr[i];
raccoon.liked(uid, id, function(results){
c++;//tan dem
if (c == max){//neu la finish cuoi cung
returnData(res,{status:"OK", msg:"Added UID = " + uid + ", ids = " + ids});
}
});
}
is it right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant