org.apache.mahout.cf.taste.impl.eval.AverageAbsoluteDifferenceRecommenderEvaluator Java Examples

The following examples show how to use org.apache.mahout.cf.taste.impl.eval.AverageAbsoluteDifferenceRecommenderEvaluator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BookRecommender.java    From Machine-Learning-in-Java with MIT License 5 votes vote down vote up
public static void evaluateRecommender() throws Exception{
	StringItemIdFileDataModel dataModel = loadFromFile("data/BX-Book-Ratings.csv",";");
	RecommenderEvaluator evaluator = new AverageAbsoluteDifferenceRecommenderEvaluator();
	RecommenderBuilder builder = new BookRecommender();
	double result = evaluator.evaluate(builder, null, dataModel, 0.9, 1.0);
	System.out.println(result);
}
 
Example #2
Source File: MovieUserEvaluator.java    From hiped2 with Apache License 2.0 5 votes vote down vote up
public static void evaluate(String ratingsFile)
    throws TasteException, IOException {
  DataModel model = new FileDataModel(new File(ratingsFile));
  RecommenderEvaluator evaluator =
      new AverageAbsoluteDifferenceRecommenderEvaluator();
  RecommenderBuilder recommenderBuilder = new MyRecommendBuilder();
  evaluator.evaluate(
      recommenderBuilder,
      null,
      model,
      0.95,
      0.05
  );
}