Package org.apache.mahout.cf.taste.eval

Examples of org.apache.mahout.cf.taste.eval.RecommenderIRStatsEvaluator


      @Override
      public Recommender buildRecommender(DataModel dataModel) throws TasteException {
        return new SlopeOneRecommender(dataModel);
      }
    };
    RecommenderIRStatsEvaluator evaluator = new GenericRecommenderIRStatsEvaluator();
    IRStatistics stats = evaluator.evaluate(builder, null, model, null, 1, 0.2, 1.0);
    assertNotNull(stats);
    assertEquals(0.75, stats.getPrecision(), EPSILON);
    assertEquals(0.75, stats.getRecall(), EPSILON);
    assertEquals(0.75, stats.getF1Measure(), EPSILON);
    assertEquals(0.75, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
View Full Code Here


      @Override
      public DataModel buildDataModel(FastByIDMap<PreferenceArray> trainingData) {
        return new GenericBooleanPrefDataModel(GenericBooleanPrefDataModel.toDataMap(trainingData));
      }
    };
    RecommenderIRStatsEvaluator evaluator = new GenericRecommenderIRStatsEvaluator();
    IRStatistics stats = evaluator.evaluate(
        builder, dataModelBuilder, model, null, 1, GenericRecommenderIRStatsEvaluator.CHOOSE_THRESHOLD, 1.0);

    assertNotNull(stats);
    assertEquals(0.666666666, stats.getPrecision(), EPSILON);
    assertEquals(0.666666666, stats.getRecall(), EPSILON);
View Full Code Here

      @Override
      public Recommender buildRecommender(DataModel dataModel) throws TasteException {
        return new SlopeOneRecommender(dataModel);
      }
    };
    RecommenderIRStatsEvaluator evaluator = new GenericRecommenderIRStatsEvaluator();
    IRStatistics stats = evaluator.evaluate(builder, null, model, null, 1, 0.2, 1.0);
    assertNotNull(stats);
    assertEquals(0.75, stats.getPrecision(), EPSILON);
    assertEquals(0.75, stats.getRecall(), EPSILON);
    assertEquals(0.75, stats.getF1Measure(), EPSILON);
    assertEquals(0.75, stats.getFNMeasure(2.0), EPSILON);
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.eval.RecommenderIRStatsEvaluator

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.