首页 > 代码库 > mahout学习(三)
mahout学习(三)
public class TMahout03 { public static void main(String[] args) throws IOException, TasteException { //-准确率和召回率评估的配置与运行-//
RandomUtils.useTestSeed(); DataModel model = new FileDataModel(new File("path/ua.base")); RecommenderIRStatsEvaluator irStatsEvaluator = new GenericRecommenderIRStatsEvaluator(); RecommenderBuilder recommenderBuilder = new RecommenderBuilder() { @Override public Recommender buildRecommender(DataModel model) throws TasteException { UserSimilarity similarity = new PearsonCorrelationSimilarity(model); UserNeighborhood neighborhood = new NearestNUserNeighborhood(2, similarity, model); return new GenericUserBasedRecommender(model, neighborhood, similarity); } }; IRStatistics stats = irStatsEvaluator.evaluate(recommenderBuilder, null, model, null, 2, GenericRecommenderIRStatsEvaluator.CHOOSE_THRESHOLD,1.0); System.out.println(stats.getPrecision()); System.out.println(stats.getRecall()); }}
//SlopeOneRecommender @Deprecated。
1 February 2014 - Apache Mahout 0.9 released Apache Mahout has reached version 0.9. All developers are encouraged to begin using version 0.9. Highlights include: New and improved Mahout website based on Apache CMS - MAHOUT-1245 Early implementation of a Multi Layer Perceptron (MLP) classifier - MAHOUT-1265 Scala DSL Bindings for Mahout Math Linear Algebra. See this blogpost and MAHOUT-1297 Recommenders as Search. See [https://github.com/pferrel/solr-recommender] and MAHOUT-1288 Support for easy functional Matrix views and derivatives - MAHOUT-1300 JSON output format for ClusterDumper - MAHOUT-1343 Enabled randomised testing for all Mahout modules using Carrot RandomizedRunner - MAHOUT-1345 Online Algorithm for computing accurate Quantiles using 1-dimensional Clustering - See this pdf and MAHOUT-1361 Upgrade to Lucene 4.6.1 - MAHOUT-1364 Changes in 0.9 are detailed in the release notes. The following algorithms that were marked deprecated in 0.8 have been removed in 0.9: Switched LDA implementation from Gibbs Sampling to Collapsed Variational Bayes Meanshift - removed due to lack of actual usage and support MinHash - removed due to lack of actual usage and support Winnow - removed due to lack of actual usage and support Perceptron - removed due to lack of actual usage and support<span style="color: #ff6600;"><strong> Slope One - removed due to lack of actual usage</strong></span> Distributed Pseudo recommender - removed due to lack of actual usage TreeClusteringRecommender - removed due to lack of actual usage
mahout学习(三)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。