librec
librec copied to clipboard
Normalized DCG Evaluator is always 1.0
Hi. I'm testing the library on different datasets and every time I execute a Recommender, the evaluation with normalized DCG returns 1.0. I tried with different datasets and recommenders, paying attention to the configuration, but I can't figure out where is the error. Is it possible that there is some bug in the class NormalizedDCGEvaluator? In the doc there are no examples about this evaluator and I don't know how to fix this. The snippet of the code is the following:
conf.set("rec.recommender.similarities","item");
conf.set("rec.recommender.isranking", "true");
conf.set("rec.eval.enable", "true");
conf.set("rec.eval.class", "ndcg");
conf.set("rec.recommender.ranking.topn", "10");
conf.set("rec.recommender.class", "itemknn");
conf.set("rec.similarity,shrinkage", "10");
conf.set("rec.neighbors.knn.number", "50");
Recommender recommender = new ItemKNNRecommender();
recommender.recommend(context);
RecommenderEvaluator normDCGE = new NormalizedDCGEvaluator();
//normDCGE.setTopN(10);
double dcge = recommender.evaluate(normDCGE);
System.out.println("Normalized DCGE:" + dcge);
Does this happen with the built-in filmtrust and ml-100k datasets? I can't reproduce your problem with these two datasets.
BTW in your configuration:
conf.set("rec.similarity,shrinkage", "10");
the "," should be replaced with "." .