{"id":8495,"date":"2016-07-14T12:08:32","date_gmt":"2016-07-14T04:08:32","guid":{"rendered":"https:\/\/ihower.tw\/blog\/?p=8495"},"modified":"2016-07-14T12:08:56","modified_gmt":"2016-07-14T04:08:56","slug":"edx-introduction-to-big-data-with-spark-%e4%b8%8a%e8%aa%b2%e5%bf%83%e5%be%97","status":"publish","type":"post","link":"https:\/\/ihower.tw\/blog\/8495-edx-introduction-to-big-data-with-spark-%e4%b8%8a%e8%aa%b2%e5%bf%83%e5%be%97","title":{"rendered":"edx: Introduction to Big Data with Spark \u4e0a\u8ab2\u5fc3\u5f97"},"content":{"rendered":"<p>\u7d00\u9304 2015\/6-7 \u6708\u9593\uff0c\u5728 edx \u4e0a <a href=\"https:\/\/www.edx.org\/course\/big-data-analysis-apache-spark-uc-berkeleyx-cs110x\">Introduction to Big Data with Spark<\/a> \u7684\u4e0a\u8ab2\u5fc3\u5f97\u7d00\u9304\u3002(\u7adf\u7136\u62d6\u4e86\u4e00\u5e74\u624d\u6574\u7406\u5230 blog \u4e0a&#8230; XD)<\/p>\n<p>\u9019\u5802\u8ab2\u8457\u91cd\u5728 Data Processing \u90e8\u5206\uff0c\u7279\u5225\u662f\u719f\u6089 map reduce \u6280\u80fd\u3002\u9664\u4e86\u770b\u9304\u5f71\u4e4b\u5916\uff0c\u7cbe\u83ef\u5176\u5be6\u5728 lab \u5be6\u4f5c\uff0c\u900f\u904e\u4f5c\u696d\u8d70\u904e Big data \u7684\u91cd\u8981\u6d41\u7a0b\u3002<\/p>\n<p><!--more--><\/p>\n<h2 id=\"toc_1\">lab 0: Spark \u7528\u6cd5\u7c21\u4ecb<\/h2>\n<ul>\n<li>\u9019\u8ab2 Spark \u662f\u7528 Python API \u800c\u4e0d\u662f Scala\u3002<\/li>\n<li>Spark \u64cd\u4f5c\u8cc7\u6599 = transform + action<\/li>\n<li>\u4ecb\u7d39 map reduce \u7684\u65b9\u5f0f\uff0c\u9700\u8981\u6ce8\u610f\u4e0d\u53ef\u4ee5\u4e2d\u9014 collect\uff0c\u4e0d\u7136\u5c31\u958b\u59cb\u8dd1\u4e86<\/li>\n<\/ul>\n<h2 id=\"toc_2\">lab 1: Word counting<\/h2>\n<p>\u6700\u57fa\u672c Map reduce \u64cd\u4f5c\u3002\u9019\u61c9\u8a72\u7b97\u662f Big Data \u754c\u7684 Hello World \u7a0b\u5f0f(?)\u3002<\/p>\n<h2 id=\"toc_3\">lab 2: Apache Log \u5206\u6790<\/h2>\n<p>\u7e7c\u7e8c\u52a0\u5f37 Map reduce \u64cd\u4f5c\u3002<\/p>\n<h2 id=\"toc_4\">lab 3: Entity Resolution<\/h2>\n<p><a href=\"https:\/\/www.facebook.com\/ihower\/posts\/10153335207063971\">\u5728 facebook \u7684\u8a0e\u8ad6<\/a><\/p>\n<p>\u9019 lab \u662f\u9019\u5802\u8ab2\u4e2d\u662f\u6700\u96e3\u7684\u4f5c\u696d\uff0c\u82b1\u4e86\u4e0d\u5c11\u6642\u9593\u3002\u984c\u76ee\u662f Entity Resolution\uff0c\u7d66\u4f60\u5169\u4efd\u5927\u6587\u4ef6\u96c6\u6bd4\u5c0d\u51fa\u91cd\u8907\u7684\u8cc7\u6599 (\u5be6\u52d9\u61c9\u7528\u4f8b\u5982\u9023\u7d50\u5546\u5e97A\u548c\u5546\u5e97B\u7684\u8cc7\u6599\uff0c\u4f46\u6c92\u6709\u5171\u901a\u7684ID\uff0c\u5546\u54c1\u540d\u7a31\u548c\u63cf\u8ff0\u4e5f\u4e0d\u76e1\u76f8\u540c)<\/p>\n<p>\u9996\u5148\u5c07\u6240\u6709\u6587\u5b57\u62c6\u6210 tokens\uff0c\u7528 TF-TDF \u65b9\u6cd5\u4f86\u8a08\u7b97\u6bcf\u500b token \u5c0d\u6bcf\u4e00\u4efd\u6587\u4ef6\u4e2d\u7684\u91cd\u8981\u7a0b\u5ea6\u3002\u9019\u5b50\u984c\u5361\u6709\u9ede\u4e45\uff0c\u516c\u5f0f\u5176\u5be6\u4e5f\u6c92\u6709\u5f88\u96e3\uff0cTF \u662f\u300ctoken \u51fa\u73fe\u6b21\u6578\/\u7e3dtokens\u6578\u300d\u3001IDF \u5247\u662f\u300c\u7e3d\u6587\u4ef6\u6578\/\u5305\u542b\u8a72token\u7684\u6587\u4ef6\u6578\u300d\uff0c\u9664\u4e86\u4f5c\u696d\u672c\u8eab\u7684\u63d0\u793a\u6709\u9ede\u6545\u610f\u8aa4\u5c0e\u4e4b\u5916(?)\uff0c\u5c31\u662f\u6211\u9084\u662f\u592a\u7fd2\u6163 procedured \u7684\u5beb\u6cd5\u4e86\uff0c\u8166\u888b\u9700\u8981\u63db\u6210 map reduce \u5e73\u884c\u904b\u7b97\u6a21\u5f0f(transform-&gt;transform-&gt;transform-&gt;action) \u548c\u5584\u7528 pair RDD\uff0c\u771f\u7684\u662f\u8981\u5e38\u7df4\u7fd2\u624d\u5beb\u7684\u5feb\u3002<\/p>\n<p>\u6bcf\u4efd\u6587\u4ef6\u7684\u6bcf\u500b tokens \u90fd\u6709\u4e86 TF-TDF \u6b0a\u91cd\uff0c\u63a5\u8457\u7528 Cosine similarity \u7b97\u51fa\u4efb\u5169\u4efd\u6587\u4ef6\u7684\u76f8\u4f3c\u7a0b\u5ea6\uff0c\u7136\u5f8c\u52a0 Inverted index \u6539\u5584\u6548\u80fd\uff0c\u6700\u5f8c\u7528 Precision \u548c Recall \u7b97\u51fa F-measure \u4e26\u7528 matplotlib \u756b\u5716\u5f97\u51fa\u6700\u597d\u7684 threshold \u503c\u3002\u76f8\u4f3c\u7a0b\u5ea6\u8d85\u904e\u9019\u500b threshold \u503c\u7684\u5c31\u8868\u793a\u5224\u65b7\u6210\u91cd\u8907\u7684\u8cc7\u6599\u3002<br \/>\n\u770b\u4f86\u300c\u8cc7\u6599\u5de5\u7a0b\u5e2b\u300d\u5c31\u662f\u5728\u505a\u9019\u6a23\u7684\u4e8b\u60c5(?)<\/p>\n<ul>\n<li>Entity Resolution: <a href=\"https:\/\/en.wikipedia.org\/wiki\/Record_linkage\" class=\"autohyperlink\">en.wikipedia.org\/wiki\/Record_linkage<\/a><\/li>\n<li>TF-IDF: <a href=\"https:\/\/zh.wikipedia.org\/wiki\/TF-IDF\" class=\"autohyperlink\">zh.wikipedia.org\/wiki\/TF-IDF<\/a><\/li>\n<li>Cosine similarity: <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cosine_similarity\" class=\"autohyperlink\">en.wikipedia.org\/wiki\/Cosine_similarity<\/a><\/li>\n<li>Inverted index: <a href=\"https:\/\/en.wikipedia.org\/wiki\/Inverted_index\" class=\"autohyperlink\">en.wikipedia.org\/wiki\/Inverted_index<\/a><\/li>\n<li>Precision and recall: <a href=\"https:\/\/en.wikipedia.org\/wiki\/Precision\" class=\"autohyperlink\">en.wikipedia.org\/wiki\/Precision<\/a><em>and<\/em>recall<\/li>\n<\/ul>\n<h2>lab 4: Machine Learning<\/h2>\n<p>\u4f7f\u7528\u8005\u7684\u96fb\u5f71\u8a55\u5206\u9810\u6e2c\u3002\u9019\u6b21\u4f5c\u696d\u6bd4\u8f03\u7c21\u55ae\uff0c\u611f\u89ba\u5c31\u53ea\u662f\u8b93\u4f60\u9ad4\u9a57\u4ec0\u9ebc\u662f\u6a5f\u5668\u5b78\u7fd2\u800c\u5df2\uff0c\u76f4\u63a5\u62ff MLlib \u7684 ALS.train() \u4f86\u4f5c collaborative filtering \uff0c\u7136\u5f8c\u7528 Root Mean Square Error (RMSE) \u8a55\u4f30\u6e96\u78ba\u5ea6\u3002<\/p>\n<p>\u9019\u9580\u8ab2\u624d\u4e94\u9031\u5c31\u9019\u6a23\u7d50\u675f\u5566\uff0c\u6700\u5f8c\u62ff\u5230 <a href=\"https:\/\/verify.edx.org\/cert\/26161de334c540b7845993241d0e3f1e\">BerkeleyX CS100.1x \u8b49\u66f8<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d00\u9304 2015\/6-7 \u6708\u9593\uff0c\u5728 edx \u4e0a Introduction to Big Data with Sp &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ihower.tw\/blog\/8495-edx-introduction-to-big-data-with-spark-%e4%b8%8a%e8%aa%b2%e5%bf%83%e5%be%97\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008edx: Introduction to Big Data with Spark \u4e0a\u8ab2\u5fc3\u5f97\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[74],"tags":[],"class_list":["post-8495","post","type-post","status-publish","format-standard","hentry","category-data-science","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1q6tG-2d1","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/8495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/comments?post=8495"}],"version-history":[{"count":7,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/8495\/revisions"}],"predecessor-version":[{"id":8507,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/8495\/revisions\/8507"}],"wp:attachment":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/media?parent=8495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/categories?post=8495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/tags?post=8495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}