简体   繁体   English

推荐系统使用apache mahout错误

[英]recommender system using apache mahout error

i want to buil a recommender system using apache mahout I created java class but i have a error can some one help me please 我想使用apache mahout建立一个推荐系统,我创建了Java类,但是我出错了,有人可以帮我吗
the error 错误

run: [INFO ] 2017-03-24 22:11:15,995 -- Creating FileDataModel for file C:\\ml-latest-small\\dat.csv Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable;)V at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.(FileDataModel.java:178) at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.(FileDataModel.java:148) at javaapplication15.JavaApplication15.main(JavaApplication15.java:45) Java Result: 1 运行:[INFO] 2017-03-24 22:11:15,995-为文件C:\\ ml-latest-small \\ dat.csv创建FileDataModel线程“主”中的异常java.lang.NoSuchMethodError:com.google.common org.apache.mahout.cf.taste.impl.model.file.FileDataModel。(FileDataModel.java:178)上的.io.Closeables.closeQuietly(Ljava / io / Closeable;)V。位于JavaApplication15.JavaApplication15.main(JavaApplication15.java:45)的avour.impl.model.file.FileDataModel。(FileDataModel.java:148)Java结果:1

  public static void main(String[] args) throws IOException, TasteException  {
  DataModel model = new FileDataModel(new File("C:/ml-latest-small/dat.csv"));
  UserSimilarity similarity = new TanimotoCoefficientSimilarity(model);
  UserNeighborhood neighborhood = new ThresholdUserNeighborhood(0.1, similarity, model);
  UserBasedRecommender recommender = new GenericUserBasedRecommender(model, neighborhood, similarity);

  List<RecommendedItem> recommendations = recommender.recommend(2, 3);

for (RecommendedItem recommendation : recommendations) { System.out.println(recommendation); 对于(RecommendedItem推荐:推荐){System.out.println(recommendation);

I should mention that the old Mahout recommenders are being deprecated. 我应该提到旧的Mahout推荐器已被弃用。 The new batch are based on the Spark compute engine rather than the somewhat outdated Hadoop Mapreduce. 新批次基于Spark计算引擎,而不是有些过时的Hadoop Mapreduce。

The Mahout Model building is here: http://mahout.apache.org/users/algorithms/intro-cooccurrence-spark.html Mahout模型大厦在这里: http : //mahout.apache.org/users/algorithms/intro-cooccurrence-spark.html

And a fully functional system called the Universal Recommender is built on Apache PredictionIO is here: http://actionml.com/docs/ur 在Apache PredictionIO上构建了一个名为Universal Recommender的功能齐全的系统,网址为: http : //actionml.com/docs/ur

There are also ALS, matrix factorization based algos in Mahout and Spark MLlib. Mahout和Spark MLlib中还有ALS,基于矩阵分解的算法。 These and in raw form and need a systems built around them to manage data and serve recs. 这些以原始形式存在,需要围绕它们构建的系统来管理数据和为记录服务。 The Universal Recommender mentioned above is the only one to come relatively turnkey. 上面提到的Universal Recommender是唯一一个相对可用的工具。

Any of these would be a better starting point than code being deprecated. 与不推荐使用的代码相比,这些方法中的任何一个都是更好的起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM