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); }
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); }