{"id":4523,"date":"2019-07-02T15:30:52","date_gmt":"2019-07-02T07:30:52","guid":{"rendered":"https:\/\/ixyzero.com\/blog\/?p=4523"},"modified":"2019-07-02T15:30:52","modified_gmt":"2019-07-02T07:30:52","slug":"%e6%9c%ba%e5%99%a8%e5%ad%a6%e4%b9%a0-knn","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/4523.html","title":{"rendered":"\u673a\u5668\u5b66\u4e60-kNN"},"content":{"rendered":"\n<p>=Start=<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u7f18\u7531\uff1a<\/h4>\n\n\n\n<p>\u60f3\u901a\u8fc7\u5feb\u901f\u6574\u7406\u300a\u673a\u5668\u5b66\u4e60\u5b9e\u6218\u300b\u4e00\u4e66\u4e2d\u51fa\u73b0\u8fc7\u7684\u5404\u79cd\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u7684\u539f\u7406\u53ca\u5176\u4f18\u7f3a\u70b9\u548c\u9002\u7528\u8303\u56f4\u6765\u5feb\u901f\u5b66\u4e60\u3001\u4e86\u89e3\u5e38\u89c1\u7684\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u6b63\u6587\uff1a<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">\u53c2\u8003\u89e3\u7b54\uff1a<\/h5>\n\n\n\n<h6 class=\"wp-block-heading\">1\u3001kNN\u7b97\u6cd5\u7b80\u4ecb<\/h6>\n\n\n\n<p><strong>k\u8fd1\u90bb\u7b97\u6cd5(k-nearest neighbor algorithm, kNN)\u662f1967\u5e74\u7531Cover T\u548cHart P\u63d0\u51fa\u7684\u4e00\u79cd\u57fa\u672c\u5206\u7c7b\u4e0e\u56de\u5f52\u65b9\u6cd5\u3002<\/strong>\u5b83\u7684\u5de5\u4f5c\u539f\u7406\u662f\uff1a\u5b58\u5728\u4e00\u4e2a\u6837\u672c\u6570\u636e\u96c6\u5408\uff0c\u4e5f\u79f0\u4f5c\u4e3a\u8bad\u7ec3\u6837\u672c\u96c6\uff0c\u5e76\u4e14\u6837\u672c\u96c6\u4e2d\u6bcf\u4e2a\u6570\u636e\u90fd\u5b58\u5728\u6807\u7b7e\uff0c\u5373\u6211\u4eec\u77e5\u9053\u6837\u672c\u96c6\u4e2d\u6bcf\u4e00\u4e2a\u6570\u636e\u4e0e\u6240\u5c5e\u5206\u7c7b\u7684\u5bf9\u5e94\u5173\u7cfb\u3002<strong>\u8f93\u5165\u6ca1\u6709\u6807\u7b7e\u7684\u65b0\u6570\u636e\u540e\uff0c\u5c06\u65b0\u7684\u6570\u636e\u7684\u6bcf\u4e2a\u7279\u5f81\u4e0e\u6837\u672c\u96c6\u4e2d\u6570\u636e\u5bf9\u5e94\u7684\u7279\u5f81\u8fdb\u884c\u6bd4\u8f83\uff0c\u7136\u540e\u7b97\u6cd5\u63d0\u53d6\u6837\u672c\u6700\u76f8\u4f3c\u6570\u636e(\u6700\u8fd1\u90bb)\u7684\u5206\u7c7b\u6807\u7b7e\u3002<\/strong>\u4e00\u822c\u6765\u8bf4\uff0c\u6211\u4eec\u53ea\u9009\u62e9\u6837\u672c\u6570\u636e\u96c6\u4e2d\u524dk\u4e2a\u6700\u76f8\u4f3c\u7684\u6570\u636e\uff0c\u8fd9\u5c31\u662fk-\u8fd1\u90bb\u7b97\u6cd5\u4e2dk\u7684\u51fa\u5904\uff0c<strong>\u901a\u5e38k\u662f\u4e0d\u5927\u4e8e20\u7684\u6574\u6570\u3002<\/strong>\u6700\u540e\uff0c\u9009\u62e9k\u4e2a\u6700\u76f8\u4f3c\u6570\u636e\u4e2d\u51fa\u73b0\u6b21\u6570\u6700\u591a\u7684\u5206\u7c7b\uff0c\u4f5c\u4e3a\u65b0\u6570\u636e\u7684\u5206\u7c7b\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\"><strong>2\u3001kNN\u7b97\u6cd5\u7684\u6d41\u7a0b<\/strong><\/h6>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>\u8ba1\u7b97\u5df2\u77e5\u7c7b\u522b\u6570\u636e\u96c6\u4e2d\u7684\u70b9\u4e0e\u5f53\u524d\u70b9\u4e4b\u95f4\u7684\u8ddd\u79bb\uff1b<\/strong><\/li><li><strong>\u6309\u7167\u8ddd\u79bb\u9012\u589e\u6b21\u5e8f\u6392\u5e8f\uff1b<\/strong><\/li><li>\u9009\u53d6\u4e0e\u5f53\u524d\u70b9\u8ddd\u79bb\u6700\u5c0f\u7684k\u4e2a\u70b9\uff1b<\/li><li>\u786e\u5b9a\u524dk\u4e2a\u70b9\u6240\u5728\u7c7b\u522b\u7684\u51fa\u73b0\u9891\u7387\uff1b<\/li><li>\u8fd4\u56de\u524dk\u4e2a\u70b9\u6240\u51fa\u73b0\u9891\u7387\u6700\u9ad8\u7684\u7c7b\u522b\u4f5c\u4e3a\u5f53\u524d\u70b9\u7684\u9884\u6d4b\u5206\u7c7b\u3002<\/li><\/ol>\n\n\n\n<h6 class=\"wp-block-heading\"><strong>3\u3001kNN\u7b97\u6cd5\u7684\u4f18\u7f3a\u70b9\u548c\u9002\u7528\u60c5\u51b5<\/strong><\/h6>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>\u4f18\u70b9\uff1a\u7cbe\u5ea6\u9ad8\uff0c\u5bf9\u5f02\u5e38\u6570\u636e\u4e0d\u654f\u611f<\/strong>\uff08\u4f60\u7684\u7c7b\u522b\u662f\u7531\u90bb\u5c45\u4e2d\u7684\u5927\u591a\u6570\u51b3\u5b9a\u7684\uff0c\u4e00\u4e2a\u5f02\u5e38\u90bb\u5c45\u5e76\u4e0d\u80fd\u5f71\u54cd\u592a\u5927\uff09\uff0c<strong>\u65e0\u6570\u636e\u8f93\u5165\u5047\u5b9a\uff0c<\/strong>\u7b80\u5355\u597d\u7528\uff0c\u5bb9\u6613\u7406\u89e3\uff0c\u7cbe\u5ea6\u9ad8\uff0c\u7406\u8bba\u6210\u719f\uff0c\u65e2\u53ef\u4ee5\u7528\u6765\u505a\u5206\u7c7b\u4e5f\u53ef\u4ee5\u7528\u6765\u505a\u56de\u5f52\uff1b\uff1b<\/li><li><strong>\u7f3a\u70b9\uff1a\u8ba1\u7b97\u590d\u6742\u5ea6\u9ad8<\/strong>\uff08\u9700\u8981\u8ba1\u7b97\u65b0\u7684\u6570\u636e\u70b9\u4e0e\u6837\u672c\u96c6\u4e2d\u6bcf\u4e2a\u6570\u636e\u7684\u201c\u8ddd\u79bb\u201d\uff0c\u4ee5\u5224\u65ad\u662f\u5426\u662f\u524dk\u4e2a\u90bb\u5c45\uff09\uff0c<strong>\u7a7a\u95f4\u590d\u6742\u5ea6\u9ad8<\/strong>\uff08\u5de8\u5927\u7684\u77e9\u9635\uff09\uff0c\u6700\u5927\u7684\u7f3a\u70b9\u662f\u65e0\u6cd5\u7ed9\u51fa\u6570\u636e\u7684\u5185\u5728\u542b\u4e49\uff1b<\/li><li>\u9002\u7528\u6570\u636e\u8303\u56f4\uff1a\u6570\u503c\u578b\uff08\u76ee\u6807\u53d8\u91cf\u53ef\u4ee5\u4ece\u65e0\u9650\u7684\u6570\u503c\u96c6\u5408\u4e2d\u53d6\u503c\uff09\u548c\u6807\u79f0\u578b\uff08\u76ee\u6807\u53d8\u91cf\u53ea\u6709\u5728\u6709\u9650\u76ee\u6807\u96c6\u4e2d\u53d6\u503c\uff09\u3002<\/li><\/ul>\n\n\n\n<h6 class=\"wp-block-heading\"><strong>4\u3001kNN\u7b97\u6cd5\u7684\u4e00\u822c\u6d41\u7a0b<\/strong><\/h6>\n\n\n\n<ol class=\"wp-block-list\"><li>\u6536\u96c6\u6570\u636e\uff1a\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u65b9\u6cd5\u3002<\/li><li>\u51c6\u5907\u6570\u636e\uff1a\u8ddd\u79bb\u8ba1\u7b97\u6240\u9700\u8981\u7684\u6570\u503c\uff0c\u6700\u597d\u662f\u7ed3\u6784\u5316\u7684\u6570\u636e\u683c\u5f0f\u3002<\/li><li>\u5206\u6790\u6570\u636e\uff1a\u53ef\u4ee5\u4f7f\u7528\u5f88\u591a\u65b9\u6cd5\u5bf9\u6570\u636e\u8fdb\u884c\u5206\u6790\uff0c\u4f8b\u5982\u4f7f\u7528Matplotlib\u5c06\u6570\u636e\u53ef\u89c6\u5316\u3002<\/li><li>\u6d4b\u8bd5\u7b97\u6cd5\uff1a\u8ba1\u7b97\u9519\u8bef\u7387\u3002<\/li><li>\u4f7f\u7528\u7b97\u6cd5\uff1a\u9519\u8bef\u7387\u5728\u53ef\u63a5\u53d7\u8303\u56f4\u5185\uff0c\u5c31\u53ef\u4ee5\u8fd0\u884ckNN\u7b97\u6cd5\u8fdb\u884c\u5206\u7c7b\u3002<\/li><\/ol>\n\n\n\n<h5 class=\"wp-block-heading\">\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/en.wikipedia.org\/wiki\/K-nearest_neighbors_algorithm\">https:\/\/en.wikipedia.org\/wiki\/K-nearest_neighbors_algorithm<\/a><\/li><li><a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2018\/03\/introduction-k-neighbours-algorithm-clustering\/\">Introduction to k-Nearest Neighbors: A powerful Machine Learning Algorithm(with implementation in Python &amp; R)<\/a><\/li><li><a href=\"https:\/\/cuijiahua.com\/blog\/2017\/11\/ml_1_knn.html\"><strong>\u673a\u5668\u5b66\u4e60\u5b9e\u6218\u6559\u7a0b\uff08\u4e00\uff09\uff1aK-\u8fd1\u90bb\u7b97\u6cd5\uff08\u53f2\u8bd7\u7ea7\u5e72\u8d27\u957f\u6587\uff09<\/strong><\/a><br><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/28656126\">https:\/\/zhuanlan.zhihu.com\/p\/28656126<\/a><\/li><li>\u3010\u6570\u5b66\u3011\u4e00\u53ea\u5154\u5b50\u5e2e\u4f60\u7406\u89e3 kNN<br><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/22345658\">https:\/\/zhuanlan.zhihu.com\/p\/22345658<\/a><\/li><li><a href=\"https:\/\/www.cnblogs.com\/jtianwen2014\/p\/4249003.html\">\u3010\u673a\u5668\u5b66\u4e60\u3011k-\u8fd1\u90bb\u7b97\u6cd5\u4ee5\u53ca\u7b97\u6cd5\u5b9e\u4f8b<\/a><\/li><li><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.neighbors.KNeighborsClassifier.html\">https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.neighbors.KNeighborsClassifier.html<\/a><\/li><\/ul>\n\n\n\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u60f3\u901a\u8fc7\u5feb\u901f\u6574\u7406\u300a\u673a\u5668\u5b66\u4e60\u5b9e\u6218\u300b\u4e00\u4e66\u4e2d\u51fa\u73b0\u8fc7\u7684\u5404\u79cd\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u7684\u539f\u7406\u53ca\u5176\u4f18\u7f3a\u70b9\u548c\u9002\u7528\u8303\u56f4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,1275],"tags":[1455,1456,1441,1457,9],"class_list":["post-4523","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-1275","tag-knn","tag-k","tag-machinelearning","tag-1457","tag-9"],"views":3263,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/4523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=4523"}],"version-history":[{"count":1,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/4523\/revisions"}],"predecessor-version":[{"id":4526,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/4523\/revisions\/4526"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=4523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=4523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=4523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}