下载了MovieSite这个包,解压导入Eclipse遇到很多问题。记录下步骤
首先导入eclipse后,build path中引入的几个tomcat library路径不正确。需要根据你的tomcat路径,重新引入。还有需要下载mysql 驱动,我下载的是mysql-connector-java-5.1.10-bin.jar,导入build path。如果你是通过在eclipse中的tomcat plugin(com.sysdeo.eclipse.tomcat)来运行这个web程序,还需要将该驱动jar包拷贝一份到tomcat的lib目录下。
然后修改tomcat的server.xml或者在拷贝一个context xml到conf/Catalina/localhost目录下。加入类似下面的内容
<Context docBase="c:/MovieSite" path="/MovieSite" reloadable="true" >
<Resource name="jdbc/movie" //要与web.xml中的<res-ref-name>一致
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://192.168.21.152/movie"
username="root" //your mysql account name
password="root" // your mysql password
maxActive="100"
maxIdle="30"
maxWait="10000"/>
</Context>
然后要根据table.sql的脚步创建4个table,再将movies.dat数据导入。接着在user表中自己插入一笔数据,因为例子没提供,但后面导入ratings.dat必须要有user表的userID父键关联。所以ID号以ratings中的userID为参照。因为ratings.dat中数据较多,而你不可能将ratings中的userID一一插入到user表(除非你有兴趣或者其它工具帮您插入),所以导入ratings.dat时,会报异常,只会导入在你user表中存在的userID作父键的数据。不用太计较,能看到例子的效果就行。
最后启动tomcat,打开浏览器,输入http://localhost:8080/MovieSite,看到输入框,输入你的user email,密码可以不输。就可以看到内容了。
看到http://blog.csdn.net/softwarehe/article/details/7465151中将mahout-core-0.2换成mahout-core-0.5,问题更多,还会有代码编译错误,但也可以解决。
在com.ibm.taste.example.movie.recommender包中所有代码都会提示错误,但主要是两种
一是类似ItemBasedRecommender类中的错误提示:
The type ItemBasedRecommender must implement the inherited abstract method Recommender.recommend(long, int, IDRescorer),
The method recommend(long, int, IDRescorer) in the type Recommender is not applicable for the arguments (long, int, Rescorer<Long>)
遇到这种状况,就将该方法屏蔽掉,然后重新加载未实现方法,同时将调用this.recommend(long , howMany Rescorer<Long> )改成调用this.recommend(long , int ,IDRescorer).
二是MovieDataModel类中提示:
The constructor MySQLJDBCDataModel(DataSource, String, String, String, String) is undefined
先添加变量public final static String TIMESTAMP_COLUMN = "timestamp";
然后将super(lookupDataSource(dataSourceName), PERFERENCETABLE, USERID_COLUMN, ITEMID_COLUMN, PERFERENCE_COLUMN)改成super(lookupDataSource(dataSourceName), PERFERENCETABLE, USERID_COLUMN, ITEMID_COLUMN, PERFERENCE_COLUMN,TIMESTAMP_COLUMN);
就可以了。
解决了编译问题,运行tomcat时可能还会报异常,需要另外两个jar:guava-r03.jar,mahout-math-0.5.jar。其它步骤和mahout-core-0.2一样
相关推荐
具体步骤,参见博客:http://blog.csdn.net/fufengrui/article/details/17022535
基于 Apache Mahout 构建社会化推荐引擎
“基于 Apache Mahout 构建社会化推荐引擎”中的“使用 Taste 构建推荐引擎实例 – 电影推荐引擎”的工程文件,环境:MyEclipse8.5+JDK1.6+TOMCAT6。直接下载,用MyEclipse导入项目即可。
This book is a practical guide that explains the classification algorithms provided in Apache Mahout with the help of actual examples. Starting with the introduction of classification and model ...
基于Apache Mahout框架实现的具有协同过滤功能的推荐系统源码+数据+项目操作说明.zip 该项目是使用Apache Mahout框架创建的具有协同过滤功能的推荐系统。该系统使用一个音乐推荐数据集作为研究目的的输入,但可以...
Apache Mahout 简介
相关技术 推荐算法 基于用户的协同过滤 ...调用Deeplearning4j中构建paragraphvector的方法,通过doc2vec构建VSM 用Gensim会更方便点 基于热点的推荐 统计最高浏览量 过滤一定时间前的新闻保证热点的准确
Apache Mahout Cookbook
Apache Mahout: Beyond MapReduce. Distributed algorithm design This book is about designing mathematical and Machine Learning algorithms using the Apache Mahout "Samsara" platform. The material takes...
Thank you for requesting the download for Apache Mahout Cookbook. Please click the following link to download the code:
MovieRecommender基于Mahout实现协同过滤推荐算法的电影推荐系统^
教你成功运行mahout的taste webapp例子,网上的很多资料说的不清楚,或者版本冲突。正确的版本是jdk1.6 maven3.0.5 mahout0.5 。 摸索良久,亲测有效!
基于Mahout实现协同过滤推荐算法的电影推荐系统
深入解析Apache Mahout的书籍
Apache Mahout is a scalable machine learning library with algorithms for clustering, classification, and recommendations. It empowers users to analyze patterns in large, diverse, and complex datasets ...
#资源达人分享计划#
If you are a Java developer and want to use Mahout and Machine Learning to solve Big Data analytics use-cases then this book is for you. Familiarity with shell-scripts is assumed but no prior ...
推荐引擎服务API Apache Mahout建议( )作为与dropwizard( )一起提供的RESTful Web服务。 要求 Java 1.7 Postgres数据库服务器(必需) 评分表或视图,例如“ user_id,item_id,评分...” 设置 使用您的设置...
“基于 Apache Mahout 构建社会化推荐引擎”中的“Taste 的安装与简单的 Demo 实现”的工程文件,环境:MyEclipse8.5+JDK1.6+TOMCAT6。直接下载,用MyEclipse导入项目即可。
这是这篇博文的工程代码,是MyEclipse的工程文件。...由于原工程开发的时候是在MyEclipse中引用mahout的jar包,所以这个压缩文件并没有相关的jar文件,故运行此项目之前需要做的事请,是需要导入mahout的开发包。