本文整理汇总了Java中org.apache.mahout.cf.taste.common.Refreshable类的典型用法代码示例。如果您正苦于以下问题:Java Refreshable类的具体用法?Java Refreshable怎么用?Java Refreshable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Refreshable类属于org.apache.mahout.cf.taste.common包,在下文中一共展示了Refreshable类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refresh
import org.apache.mahout.cf.taste.common.Refreshable; //导入依赖的package包/类
@Override
public void refresh(Collection<Refreshable> collection) {
userCache.clear();
itemCache.clear();
userIDsFromItemCache.clear();
itemIDsFromUserCache.clear();
userCountCache.set(null);
itemCountCache.set(null);
}
示例2: getSimularity
import org.apache.mahout.cf.taste.common.Refreshable; //导入依赖的package包/类
/**
* Get the similarity instance that is used to check which users and items
* are similar. There are several implementations for this, these are specified
* by the this.alg value of the RecommendEntityServlet instance.
* NOTE: Since there are two interfaces: ItemSimilarity and UserSimilarity the
* returned type is of the interface Refreshable since both interfaces inherit
* that type as well. Cast it to the right type.
* @param model The database model to use for the similarity calculations
* @return The UserSimilarity or ItemSimilarity instance.
* @throws TasteException If an exception is thrown by Mahout it is forwarded upwards.
*/
private Refreshable getSimularity(DataModel model) throws TasteException {
if(this.alg.equalsIgnoreCase(A_EUCLIDEAN)){
return new EuclideanDistanceSimilarity(model);
} else if(this.alg.equalsIgnoreCase(A_PEARSON)){
return new PearsonCorrelationSimilarity(model);
} else if(this.alg.equalsIgnoreCase(A_TANIMOTO)){
return new TanimotoCoefficientSimilarity(model);
} else if(this.alg.equalsIgnoreCase(A_LOGLIKELIHOOD) || this.alg == null){ // == null is the default case
return new LogLikelihoodSimilarity(model);
} else {
throw new TasteException("Unknown algorithm type: " + this.alg);
}
}
示例3: refresh
import org.apache.mahout.cf.taste.common.Refreshable; //导入依赖的package包/类
@Override
public void refresh(Collection<Refreshable> alreadyRefreshed)
{
// TODO Auto-generated method stub
// probably do nothing -
}
示例4: refresh
import org.apache.mahout.cf.taste.common.Refreshable; //导入依赖的package包/类
@Deprecated
@Override
public void refresh(Collection<Refreshable> alreadyRefreshed) {
if (alreadyRefreshed != null) {
log.warn("Ignoring argument {}", alreadyRefreshed);
}
refresh();
}
示例5: refresh
import org.apache.mahout.cf.taste.common.Refreshable; //导入依赖的package包/类
@Override
public void refresh(Collection<Refreshable> alreadyRefreshed) {
easyrecDataModelDelegate.refresh(alreadyRefreshed);
intializeDelegate();
}
示例6: refresh
import org.apache.mahout.cf.taste.common.Refreshable; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void refresh(final Collection<Refreshable> clctn) {
wrapper.refresh(clctn);
}
示例7: refresh
import org.apache.mahout.cf.taste.common.Refreshable; //导入依赖的package包/类
/**
* @deprecated call {@link #refresh()}
*/
@Deprecated
@Override
void refresh(Collection<Refreshable> refreshables);
示例8: refresh
import org.apache.mahout.cf.taste.common.Refreshable; //导入依赖的package包/类
/**
* <p>
* Triggers "refresh" -- whatever that means -- of the implementation. The general contract is that any
* should always leave itself in a consistent, operational state, and that the refresh
* atomically updates internal state from old to new.
* </p>
*
* @param alreadyRefreshed s that are known to have already been
* refreshed as a result of an initial call to a method on some
* object. This ensure that objects in a refresh dependency graph aren't refreshed twice
* needlessly.
*/
public void refresh(Collection<Refreshable> alreadyRefreshed) {
cutoffDate = new Date();
}
示例9: refresh
import org.apache.mahout.cf.taste.common.Refreshable; //导入依赖的package包/类
/**
* Refresh the recommender.
*
* @param clctn the data.
*/
@Override
public void refresh(final Collection<Refreshable> clctn) {
}