{"id":482,"date":"2014-09-13T20:38:00","date_gmt":"2014-09-13T12:38:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=482"},"modified":"2023-11-02T20:39:50","modified_gmt":"2023-11-02T12:39:50","slug":"mahout-recommend","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/482","title":{"rendered":"Mahout Recommend"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">mahout Itembased Collaborative Filtering<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>#mahout recommenditembased<\/strong><br>Usage:<br>-i &lt; input&gt;<br>-o &lt; output&gt;<br>-n &lt; number of Recommendations&gt; \u63a8\u6578\u91cf<br>-b \u4e0d\u9700\u8a55\u5206\u6b04\u4f4d,\u53ea\u8981user,item\u9019\u5169\u500b\u6b04\u4f4d\u5373\u53ef<br>-s &lt; similarityClassname &gt;\u5e38\u7528\u7684\u6709\u4ee5\u4e0b<br>\u3000SIMILARITY_COOCCURRENCE,<br>\u3000SIMILARITY_LOGLIKELIHOOD,<br>\u3000SIMILARITY_TANIMOTO_COEFFICIENT,<br>\u3000SIMILARITY_CITY_BLOCK,<br>\u3000SIMILARITY_COSINE,<br>\u3000SIMILARITY_PEARSON_CORRELATION,<br>\u3000SIMILARITY_EUCLIDEAN_DISTANCE<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DEMO<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">user x book \u8a55\u50f9\u8868(5\u70ba\u6700\u9ad8\u8a55\u50f9\uff0c1\u70ba\u6700\u4f4e\u8a55\u50f9)&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>&nbsp;<\/td><td>book 1&nbsp;<\/td><td>book 2&nbsp;<\/td><td>book 3&nbsp;<\/td><\/tr><tr><td>user 1&nbsp;<\/td><td>&nbsp;5<\/td><td>4&nbsp;<\/td><td>5&nbsp;<\/td><\/tr><tr><td>user 2&nbsp;<\/td><td>&nbsp;4&nbsp;<\/td><td>5&nbsp;<\/td><td>4&nbsp;<\/td><\/tr><tr><td>user 3&nbsp;<\/td><td>&nbsp;5<\/td><td>4&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>user 4&nbsp;<\/td><td>&nbsp;1<\/td><td>2&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>user 5&nbsp;<\/td><td>&nbsp;2&nbsp;<\/td><td>1&nbsp;<\/td><td>1&nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><br><strong>#vi recom.data<\/strong><br>1,1,5<br>1,2,4<br>1,3,5<br>2,1,4<br>2,2,5<br>2,3,4<br>3,1,5<br>3,2,4<br>4,1,1<br>4,2,2<br>5,1,2<br>5,2,1<br>5,3,1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong># hadoop fs -mkdir testdata<br># hadoop fs -put recom.data testdata<br># hadoop fs -ls -R testdata<\/strong><br>-rw-r&#8211;r&#8211; 3 root hdfs 288374 2014-02-05 21:53 testdata\/recom.data<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>#mahout recommenditembased -i testdata -o output -s SIMILARITY_EUCLIDEAN_DISTANCE<\/strong><br>&#8230;omit&#8230;<br>{&#8211;booleanData=[false], &#8211;endPhase=[2147483647], &#8211;input=[tasteinput], &#8211;maxPrefsPerUser=[10], &#8211;maxPrefsPerUserInItemSimilarity=[1000], &#8211;maxSimilaritiesPerItem=[100], &#8211;minPrefsPerUser=[1], &#8211;numRecommendations=[10], &#8211;output=[tasteoutput], &#8211;similarityClassname=[SIMILARITY_EUCLIDEAN_DISTANCE], &#8211;startPhase=[0], &#8211;tempDir=[temp]}<br>14\/03\/02 09:52:37 INFO common.AbstractJob: Command line arguments: {&#8211;booleanData=[false], &#8211;endPhase=[2147483647], &#8211;input=[tasteinput], &#8211;maxPrefsPerUser=[1000], &#8211;minPrefsPerUser=[1], &#8211;output=[temp\/preparePreferenceMatrix], &#8211;ratingShift=[0.0], &#8211;startPhase=[0], &#8211;tempDir=[temp]}<br>&#8230;omit&#8230;<br>File Input Format Counters<br>Bytes Read=287<br>File Output Format Counters<br>Bytes Written=32<br>14\/09\/04 05:46:56 INFO driver.MahoutDriver: Program took 434965 ms (Minutes: 7.249416666666667)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><br>#hadoop fs -cat output\/part-r-00000<br><\/strong>3 [3:4.4787264]<br>4 [3:1.5212735]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mahout Itembased Collaborative &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[13],"tags":[],"class_list":["post-482","post","type-post","status-publish","format-standard","hentry","category-dataanalysis"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":486,"url":"https:\/\/systw.net\/note\/archives\/486","url_meta":{"origin":482,"position":0},"title":"Mahout Logistic","author":"raymond","date":"2014 \u5e74 9 \u6708 11 \u65e5","format":false,"excerpt":"mahout logistic regressionmahout\u7684logistic regressi\u2026","rel":"","context":"\u5728\u300c\u6578\u64da\u5206\u6790\u300d\u4e2d","block_context":{"text":"\u6578\u64da\u5206\u6790","link":"https:\/\/systw.net\/note\/archives\/category\/dataanalysis"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":488,"url":"https:\/\/systw.net\/note\/archives\/488","url_meta":{"origin":482,"position":1},"title":"Mahout FPgrowth","author":"raymond","date":"2014 \u5e74 9 \u6708 18 \u65e5","format":false,"excerpt":"fpgrowth\u904b\u4f5c\u539f\u7406\u53ef\u53c3\u8003frequent pattern analysis( http:\/\/s\u2026","rel":"","context":"\u5728\u300c\u6578\u64da\u5206\u6790\u300d\u4e2d","block_context":{"text":"\u6578\u64da\u5206\u6790","link":"https:\/\/systw.net\/note\/archives\/category\/dataanalysis"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":480,"url":"https:\/\/systw.net\/note\/archives\/480","url_meta":{"origin":482,"position":2},"title":"Mahout Clustering","author":"raymond","date":"2014 \u5e74 9 \u6708 13 \u65e5","format":false,"excerpt":"Canopy\u5206\u7fa4\u6f14\u7b97\u6cd5#mahout org.apache.mahout.clustering.sy\u2026","rel":"","context":"\u5728\u300c\u6578\u64da\u5206\u6790\u300d\u4e2d","block_context":{"text":"\u6578\u64da\u5206\u6790","link":"https:\/\/systw.net\/note\/archives\/category\/dataanalysis"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":583,"url":"https:\/\/systw.net\/note\/archives\/583","url_meta":{"origin":482,"position":3},"title":"SQL DDL","author":"raymond","date":"2010 \u5e74 8 \u6708 24 \u65e5","format":false,"excerpt":"DDL \u5efa\u7acb\u8cc7\u6599\u8868create table < tablename>(< colu\u2026","rel":"","context":"\u5728\u300c\u8cc7\u6599\u5eab\u300d\u4e2d","block_context":{"text":"\u8cc7\u6599\u5eab","link":"https:\/\/systw.net\/note\/archives\/category\/develop\/database"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":740,"url":"https:\/\/systw.net\/note\/archives\/740","url_meta":{"origin":482,"position":4},"title":"\u7b97\u8853\u904b\u7b97\u7684\u65b9\u6cd5\u8207\u96fb\u8def","author":"raymond","date":"2009 \u5e74 10 \u6708 26 \u65e5","format":false,"excerpt":"\u6574\u6578\u7684\u8868\u793a\u6cd5\u6574\u6578\u7684\u8868\u793a\u6cd5\u6c7a\u5b9a\u904b\u7b97\u65b9\u6cd5\u6574\u6578\u7684\u9577\u5ea6\u6c7a\u5b9a\u53ef\u8868\u793a\u7bc4\u570d\u6574\u6578\u9577\u5ea6=\u7b97\u8853\u908f\u8f2f\u904b\u7b97\u55ae\u5143\u7684\u8cc7\u6599\u9577\u5ea6=w\u2026","rel":"","context":"\u5728\u300c\u8a08\u7b97\u6a5f\u7d44\u7e54\u8207\u7d50\u69cb\u300d\u4e2d","block_context":{"text":"\u8a08\u7b97\u6a5f\u7d44\u7e54\u8207\u7d50\u69cb","link":"https:\/\/systw.net\/note\/archives\/category\/system\/computerarchitecture"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1232,"url":"https:\/\/systw.net\/note\/archives\/1232","url_meta":{"origin":482,"position":5},"title":"SQLi for Examining the DB","author":"raymond","date":"2023 \u5e74 2 \u6708 16 \u65e5","format":false,"excerpt":"\u70ba\u4e86\u5229\u7528 SQL \u6ce8\u5165\u6f0f\u6d1e\uff0c\u901a\u5e38\u9700\u8981\u5c0b\u627e\u6709\u95dc\u8cc7\u6599\u5eab\u7684\u8cc7\u8a0a\uff0c\u50cf\u662f\u6578\u64da\u5eab\u985e\u578b\u8207\u7248\u672c\uff0c\u4ee5\u53ca\u8cc7\u6599\u8868\u4fe1\u606f \u53d6\u5f97\u2026","rel":"","context":"\u5728\u300cServerSide\u300d\u4e2d","block_context":{"text":"ServerSide","link":"https:\/\/systw.net\/note\/archives\/category\/hackerthreat\/serverside"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=482"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/482\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}