Estou com problema neste codigo na linha 23 DataModel model = new FileDataModel(file); onde ele me pede para renomear a variavel, onde já renomeei p model1 mas o codigo continua com problemas. O codigo roda mas exibe a mensagem de que há problema com o recomendador. O que não estou vendo?
package br.com.alura.recomendador;
import java.io.File;
import org.apache.mahout.cf.taste.common.TasteException;
import org.apache.mahout.cf.taste.eval.RecommenderBuilder;
import org.apache.mahout.cf.taste.impl.model.file.FileDataModel;
import org.apache.mahout.cf.taste.impl.neighborhood.ThresholdUserNeighborhood;
import org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender;
import org.apache.mahout.cf.taste.impl.similarity.PearsonCorrelationSimilarity;
import org.apache.mahout.cf.taste.model.DataModel;
import org.apache.mahout.cf.taste.neighborhood.UserNeighborhood;
import org.apache.mahout.cf.taste.recommender.Recommender;
import org.apache.mahout.cf.taste.recommender.UserBasedRecommender;
import org.apache.mahout.cf.taste.similarity.UserSimilarity;
public class RecomendadorDeProdutosBuilder implements RecommenderBuilder {
public Recommender buildRecommender(DataModel model) throws TasteException {
return null;
File file = new File("dados.csv");
DataModel model = new FileDataModel(file);
UserSimilarity similarity = new PearsonCorrelationSimilarity(model);
UserNeighborhood neighborhood = new ThresholdUserNeighborhood(0.1, similarity, model);
UserBasedRecommender recommender = new GenericUserBasedRecommender(model, neighborhood, similarity);
return recommender;
}
}