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);
assertEquals(0.666666666, stats.getF1Measure(), EPSILON);
assertEquals(0.666666666, stats.getFNMeasure(2.0), EPSILON);
assertEquals(0.666666666, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
}