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

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


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


  public InverseUserFrequency(DataModel dataModel, double logBase) throws TasteException {
    Preconditions.checkArgument(logBase > 1.0, "logBase should be > 1.0");
    this.dataModel = Preconditions.checkNotNull(dataModel);
    this.logBase = logBase;
    this.iufFactors = new FastByIDMap<Double>();
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        recompute();
        return null;
      }
View Full Code Here

   */
  public CachingItemSimilarity(ItemSimilarity 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

    emSvd = new ExpectationMaximizationSVD(numUsers, numItems, numFeatures, defaultValue);
    cachedPreferences = new ArrayList<Preference>(numUsers);
    recachePreferences();

    refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        recachePreferences();
        //TODO: train again
        return null;
View Full Code Here

    int numUsers = recommender.getDataModel().getNumUsers();
    this.recommendationCache =
        new Cache<Long, Recommendations>(new RecommendationRetriever(this.recommender), numUsers);
    this.estimatedPrefCache =
        new Cache<LongPair, Float>(new EstimatedPrefRetriever(this.recommender), numUsers);
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() {
        clear();
        return null;
      }
View Full Code Here

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

    this.clusterSimilarity = clusterSimilarity;
    this.numClusters = Integer.MIN_VALUE;
    this.clusteringThreshold = clusteringThreshold;
    this.clusteringByThreshold = true;
    this.buildClustersLock = new ReentrantLock();
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        buildClusters();
        return null;
      }
View Full Code Here

    super(dataModel);
    if (similarity == null) {
      throw new IllegalArgumentException("similarity is null");
    }
    this.similarity = similarity;
    this.refreshHelper = new RefreshHelper(null);
    refreshHelper.addDependency(dataModel);
    refreshHelper.addDependency(similarity);
  }
View Full Code Here

      throw new IllegalArgumentException("logBase is NaN or <= 1.0");
    }
    this.dataModel = dataModel;
    this.logBase = logBase;
    this.iufFactors = new AtomicReference<FastByIDMap<Double>>(new FastByIDMap<Double>());
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        recompute();
        return null;
      }
View Full Code Here

      throw new IllegalArgumentException("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

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.