public static void main(String[] args) throws Exception {
DataModel model = new FileDataModel(new File("ratings.dat"));
model = new GenericBooleanPrefDataModel(GenericBooleanPrefDataModel.toDataMap(model));
RecommenderIRStatsEvaluator evaluator =
new GenericRecommenderIRStatsEvaluator();
RecommenderBuilder recommenderBuilder = new RecommenderBuilder() {
@Override
public Recommender buildRecommender(DataModel model) throws TasteException {
UserSimilarity similarity = new TanimotoCoefficientSimilarity(model);
UserNeighborhood neighborhood = new NearestNUserNeighborhood(2, similarity, model);
return new GenericBooleanPrefUserBasedRecommender(model, neighborhood, similarity);