Exemplo n.º 1
0
        public CachingUserNeighborhood(UserNeighborhood neighborhood, DataModel dataModel)
        {
            this.neighborhood = neighborhood;
            int maxEntries = dataModel.getNumUsers();

            this.neighborhoodCache = new Cache <long, long[]>(new NeighborhoodRetriever(neighborhood), maxEntries);
        }
 public GenericUserBasedRecommender(DataModel dataModel,
                                    UserNeighborhood neighborhood,
                                    UserCorrelation correlation)
     : base(dataModel)
 {
     if (neighborhood == null)
     {
         throw new ArgumentNullException("Neighborhood is null");
     }
     this.neighborhood = neighborhood;
     this.correlation  = correlation;
     this.refreshLock  = new ReentrantLock();
 }
Exemplo n.º 3
0
        public GenericUserBasedRecommender(DataModel dataModel, UserNeighborhood neighborhood, UserSimilarity similarity)
            : base(dataModel)
        {
            Action refreshRunnable = null;

            this.neighborhood = neighborhood;
            this.similarity   = similarity;
            if (refreshRunnable == null)
            {
                refreshRunnable = () => this.capper = this.buildCapper();
            }
            this.refreshHelper = new RefreshHelper(refreshRunnable);
            this.refreshHelper.addDependency(dataModel);
            this.refreshHelper.addDependency(similarity);
            this.refreshHelper.addDependency(neighborhood);
            this.capper = this.buildCapper();
        }
Exemplo n.º 4
0
 public GenericBooleanPrefUserBasedRecommender(DataModel dataModel, UserNeighborhood neighborhood, UserSimilarity similarity)
     : base(dataModel, neighborhood, similarity)
 {
 }
Exemplo n.º 5
0
 internal NeighborhoodRetriever(UserNeighborhood neighborhood)
 {
     this.neighborhood = neighborhood;
 }