示例#1
0
 public GenericUserBasedRecommender(IDataModel dataModel,
                                    IUserNeighborhood neighborhood,
                                    IUserSimilarity similarity) : base(dataModel)
 {
     //Preconditions.checkArgument(neighborhood != null, "neighborhood is null");
     this.neighborhood  = neighborhood;
     this.similarity    = similarity;
     this.refreshHelper = new RefreshHelper(() => {
         capper = buildCapper();
     });
     refreshHelper.AddDependency(dataModel);
     refreshHelper.AddDependency(similarity);
     refreshHelper.AddDependency(neighborhood);
     capper = buildCapper();
 }
示例#2
0
 public GenericItemBasedRecommender(IDataModel dataModel,
                                    IItemSimilarity similarity,
                                    ICandidateItemsStrategy candidateItemsStrategy,
                                    IMostSimilarItemsCandidateItemsStrategy mostSimilarItemsCandidateItemsStrategy) :
     base(dataModel, candidateItemsStrategy)
 {
     //Preconditions.checkArgument(similarity != null, "similarity is null");
     this.similarity = similarity;
     //Preconditions.checkArgument(mostSimilarItemsCandidateItemsStrategy != null,
     //    "mostSimilarItemsCandidateItemsStrategy is null");
     this.mostSimilarItemsCandidateItemsStrategy = mostSimilarItemsCandidateItemsStrategy;
     this.refreshHelper = new RefreshHelper(() => {
         capper = buildCapper();
     });
     refreshHelper.AddDependency(dataModel);
     refreshHelper.AddDependency(similarity);
     refreshHelper.AddDependency(candidateItemsStrategy);
     refreshHelper.AddDependency(mostSimilarItemsCandidateItemsStrategy);
     capper = buildCapper();
 }