You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: