Package org.apache.mahout.cf.taste.impl.common

Examples of org.apache.mahout.cf.taste.impl.common.RefreshHelper


    Preconditions.checkArgument(dataModel != null, "dataModel is null");
    Preconditions.checkArgument(samplingRate > 0.0 && samplingRate <= 1.0, "samplingRate must be in (0,1]");
    this.userSimilarity = userSimilarity;
    this.dataModel = dataModel;
    this.samplingRate = samplingRate;
    this.refreshHelper = new RefreshHelper(null);
    this.refreshHelper.addDependency(this.dataModel);
    this.refreshHelper.addDependency(this.userSimilarity);
  }
View Full Code Here


    super(dataModel);
    this.itemAverages = new FastByIDMap<RunningAverage>();
    this.userAverages = new FastByIDMap<RunningAverage>();
    this.overallAveragePrefValue = new FullRunningAverage();
    this.buildAveragesLock = new ReentrantReadWriteLock();
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        buildAverageDiffs();
        return null;
      }
View Full Code Here

  private final RefreshHelper refreshHelper;

  protected AbstractItemSimilarity(DataModel dataModel) {
    Preconditions.checkArgument(dataModel != null, "dataModel is null");
    this.dataModel = dataModel;
    this.refreshHelper = new RefreshHelper(null);
    refreshHelper.addDependency(this.dataModel);
  }
View Full Code Here

 
  public ItemAverageRecommender(DataModel dataModel) throws TasteException {
    super(dataModel);
    this.itemAverages = new FastByIDMap<RunningAverage>();
    this.buildAveragesLock = new ReentrantReadWriteLock();
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        buildAverageDiffs();
        return null;
      }
View Full Code Here

   */
  public CachingUserSimilarity(UserSimilarity similarity, int maxCacheSize) {
    Preconditions.checkArgument(similarity != null, "similarity is null");
    this.similarity = similarity;
    this.similarityCache = new Cache<LongPair,Double>(new SimilarityRetriever(similarity), maxCacheSize);
    this.refreshHelper = new RefreshHelper(new Callable<Void>() {
      @Override
      public Void call() {
        similarityCache.clear();
        return null;
      }
View Full Code Here

    this.getRecommendableItemsSQL = getRecommendableItemsSQL;
    this.deleteDiffsSQL = deleteDiffsSQL;
    this.createDiffsSQL = createDiffsSQL;
    this.diffsExistSQL = diffsExistSQL;
    this.minDiffCount = minDiffCount;
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        buildAverageDiffs();
        return null;
      }
View Full Code Here

                                     UserSimilarity similarity) {
    super(dataModel);
    Preconditions.checkArgument(neighborhood != null, "neighborhood is null");
    this.neighborhood = neighborhood;
    this.similarity = similarity;
    this.refreshHelper = new RefreshHelper(new Callable<Void>() {
      @Override
      public Void call() {
        capper = buildCapper();
        return null;
      }
View Full Code Here

    // Use "num users" as an upper limit on cache size. Rough guess.
    int numUsers = recommender.getDataModel().getNumUsers();
    recommendationsRetriever = new RecommendationRetriever();
    recommendationCache = new Cache<Long, Recommendations>(recommendationsRetriever, numUsers);
    estimatedPrefCache = new Cache<LongPair, Float>(new EstimatedPrefRetriever(), numUsers);
    refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() {
        clear();
        return null;
      }
View Full Code Here

    super(dataModel);
    this.weighted = weighting == Weighting.WEIGHTED;
    this.centerData = centerData;
    this.cachedNumItems = dataModel.getNumItems();
    this.cachedNumUsers = dataModel.getNumUsers();
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        cachedNumItems = dataModel.getNumItems();
        cachedNumUsers = dataModel.getNumUsers();
        return null;
View Full Code Here

    this.clusterSimilarity = Preconditions.checkNotNull(clusterSimilarity);
    this.numClusters = numClusters;
    this.clusteringThreshold = Double.NaN;
    this.clusteringByThreshold = false;
    this.samplingRate = samplingRate;
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        buildClusters();
        return null;
      }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.impl.common.RefreshHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.