package edu.ntnu.idi.goldfish;

import org.apache.mahout.cf.taste.common.TasteException;
import org.apache.mahout.cf.taste.eval.RecommenderBuilder;
import org.apache.mahout.cf.taste.model.DataModel;
import org.apache.mahout.cf.taste.recommender.Recommender;

import edu.ntnu.idi.goldfish.mahout.KiwiRecommender;

public class KiwiEvaluation extends Evaluation{

	
	public KiwiEvaluation(int topN, int numFeatures) {
		super(topN, numFeatures);
	}

	public RecommenderBuilder getBuilder() {
		return new RecommenderBuilder() {
			public Recommender buildRecommender(DataModel dataModel) throws TasteException {	
				return new KiwiRecommender();			
			}
		};
	}
		
	public String toString() {
		return "Kiwi";
	}
}

@@ -125,77 +125,250 @@
 val.
-RecommenderBuilder;%0Aimport org.apache.mahout.cf.taste.model.DataModel
+DataModelBuilder;%0Aimport org.apache.mahout.cf.taste.eval.RecommenderBuilder;%0Aimport org.apache.mahout.cf.taste.impl.common.FastByIDMap;%0Aimport org.apache.mahout.cf.taste.model.DataModel;%0Aimport org.apache.mahout.cf.taste.model.PreferenceArray
 ;%0Aim
@@ -477,16 +477,65 @@
 mmender;
+%0Aimport edu.ntnu.idi.goldfish.mahout.SMDataModel;
 %0A%0Apublic
@@ -693,16 +693,27 @@
 lder get
+Recommender
 Builder(
@@ -872,13 +872,238 @@
 der(
-);%09%09%09
+dataModel);%09%09%09%0A%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%09%0A%09public DataModelBuilder getModelBuilder() %7B%0A%09%09return new DataModelBuilder() %7B%0A%09%09%09public DataModel buildDataModel(FastByIDMap%3CPreferenceArray%3E trainingData) %7B%0A%09%09%09%09return new SMDataModel(trainingData);
 %0A%09%09%09

Update KiwiEvaluation. Implement DataModelBuilder() which is used by the IRevaluator.