List of usage examples for org.apache.mahout.cf.taste.impl.common FullRunningAverageAndStdDev FullRunningAverageAndStdDev
public FullRunningAverageAndStdDev()
From source file:lib.eval.AbstractRecommenderEvaluator.java
License:Apache License
private static Collection<Callable<Void>> wrapWithStatsCallables(Collection<Callable<Void>> callables, AtomicInteger noEstimateCounter) { int size = callables.size(); Collection<Callable<Void>> wrapped = new ArrayList<Callable<Void>>(size); int count = 0; RunningAverageAndStdDev timing = new FullRunningAverageAndStdDev(); for (Callable<Void> callable : callables) { boolean logStats = count++ % 200 == 0; // log every 200 or so iterations wrapped.add(new StatsCallable(callable, logStats, timing, noEstimateCounter)); }//from ww w . j a v a 2 s. c o m return wrapped; }
From source file:net.myrrix.common.stats.RunningStatistics.java
License:Apache License
public RunningStatistics() { this(new FullRunningAverageAndStdDev(), Double.NaN, Double.NaN); }
From source file:net.ufida.info.mahout.common.MemoryDiffStorage.java
License:Apache License
private RunningAverage buildRunningAverage() { return stdDevWeighted ? new FullRunningAverageAndStdDev() : new FullRunningAverage(); }
From source file:recommender.GenericRecommenderIRStatsEvaluatorCustom.java
License:Apache License
private static double computeThreshold(PreferenceArray prefs) { if (prefs.length() < 2) { // Not enough data points -- return a threshold that allows everything return Double.NEGATIVE_INFINITY; }// w w w . j av a 2s . c o m RunningAverageAndStdDev stdDev = new FullRunningAverageAndStdDev(); int size = prefs.length(); for (int i = 0; i < size; i++) { stdDev.addDatum(prefs.getValue(i)); } return stdDev.getAverage() + stdDev.getStandardDeviation(); }
From source file:recsys.evaluator.TopKRecommenderEvaluator.java
License:Apache License
private Double getEvaluation(FastByIDMap<PreferenceArray> testPrefs, Recommender recommender) throws TasteException { reset();/*from w ww. j a v a2 s. c om*/ Collection<Callable<Void>> estimateCallables = Lists.newArrayList(); noEstimateCounter = new AtomicInteger(); estimateCounter = new AtomicInteger(); for (Map.Entry<Integer, PreferenceArray> entry : testPrefs.entrySet()) { estimateCallables.add(new PreferenceEstimateCallable(recommender, entry.getKey(), entry.getValue(), noEstimateCounter, estimateCounter)); } log.info("Beginning evaluation of {} users", estimateCallables.size()); RunningAverageAndStdDev timing = new FullRunningAverageAndStdDev(); execute(estimateCallables, noEstimateCounter, estimateCounter, timing); return computeFinalEvaluation(); }