예제 #1
0
파일: Base.cs 프로젝트: roryf/Recommendify
 public Base(int maxNeighbours, string redisPrefix, IRedisClient redisClient)
 {
     RedisClient      = redisClient;
     MaxNeighbours    = maxNeighbours;
     RedisPrefix      = redisPrefix;
     InputMatrices    = new Dictionary <string, InputMatrix>();
     SimilarityMatrix = new SimilarityMatrix(
         new Options {
         Key = "similarities", MaxNeighbours = MaxNeighbours, RedisPrefix = RedisPrefix
     },
         redisClient);
 }
예제 #2
0
파일: Base.cs 프로젝트: roryf/Recommendify
 private void ProcessItem(string itemId)
 {
     foreach (var inputMatrix in InputMatrices.Values)
     {
         var neighbours = inputMatrix.SimilaritiesFor(itemId);
         foreach (var neighbour in neighbours)
         {
             neighbour.Score = neighbour.Score * inputMatrix.Weight;
         }
         SimilarityMatrix.Update(itemId, neighbours);
     }
     SimilarityMatrix.CommitItem(itemId);
 }