{"id":2996,"date":"2022-02-20T21:16:42","date_gmt":"2022-02-20T13:16:42","guid":{"rendered":"https:\/\/egonlin.com\/?p=2996"},"modified":"2022-02-20T21:23:05","modified_gmt":"2022-02-20T13:23:05","slug":"%e7%ac%ac%e5%85%ab%e8%8a%82%ef%bc%9aransac%e7%ae%97%e6%b3%95%e7%ba%bf%e6%80%a7%e5%9b%9e%e5%bd%92%e6%b3%a2%e6%96%af%e9%a1%bf%e6%88%bf%e4%bb%b7%e9%a2%84%e6%b5%8b","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=2996","title":{"rendered":"\u7b2c\u516b\u8282\uff1aRANSAC\u7b97\u6cd5\u7ebf\u6027\u56de\u5f52"},"content":{"rendered":"<h1>RANSAC\u7b97\u6cd5\u7ebf\u6027\u56de\u5f52(\u6ce2\u65af\u987f\u623f\u4ef7\u9884\u6d4b)<\/h1>\n<p>&emsp;&emsp;\u867d\u7136\u666e\u901a\u7ebf\u6027\u56de\u5f52\u9884\u6d4b\u7ed3\u679c\u603b\u4f53\u800c\u8a00\u8fd8\u662f\u633a\u4e0d\u9519\u7684\uff0c\u4f46\u662f\u4ece\u6570\u636e\u4e0a\u53ef\u4ee5\u770b\u51fa\u6570\u636e\u96c6\u4e2d\u6709\u8f83\u591a\u7684\u79bb\u7fa4\u503c\uff0c\u56e0\u6b64\u672c\u8282\u5c06\u4f7f\u7528RANSAC\u7b97\u6cd5\u9488\u5bf9\u79bb\u7fa4\u503c\u505a\u5904\u7406\uff0c\u5373\u6839\u636e\u6570\u636e\u5b50\u96c6\uff08\u6240\u8c13\u7684\u5185\u70b9\uff09\u62df\u5408\u56de\u5f52\u6a21\u578b\u3002<\/p>\n<h1>RANSAC\u7b97\u6cd5\u6d41\u7a0b<\/h1>\n<ol>\n<li>\u968f\u673a\u9009\u62e9\u4e00\u5b9a\u6570\u91cf\u7684\u6837\u672c\u4f5c\u4e3a\u5185\u70b9\u62df\u5408\u6a21\u578b<\/li>\n<li>\u7528\u6a21\u578b\u6d4b\u8bd5\u5176\u4ed6\u6240\u6709\u7684\u70b9\uff0c\u628a\u843d\u5728\u7ed9\u5b9a\u8303\u56f4\u5185\u7684\u70b9\u653e\u5165\u5185\u70b9\u96c6<\/li>\n<li>\u8c03\u6574\u6a21\u578b\u4e2d\u4f7f\u7528\u7684\u6240\u6709\u5185\u70b9<\/li>\n<li>\u7528\u5185\u70b9\u91cd\u65b0\u62df\u5408\u6a21\u578b<\/li>\n<li>\u8bc4\u4f30\u6a21\u578b\u9884\u6d4b\u7ed3\u679c\u4e0e\u5185\u70b9\u96c6\u76f8\u6bd4\u8f83\u7684\u8bef\u5dee<\/li>\n<li>\u5982\u679c\u6027\u80fd\u8fbe\u5230\u81ea\u5b9a\u4e49\u7684\u9608\u503c\u6216\u6307\u5b9a\u7684\u8fed\u4ee3\u6b21\u6570\uff0c\u5219\u7ec8\u6b62\uff0c\u5426\u5219\u8fd4\u56de\u6b65\u9aa41<\/li>\n<\/ol>\n<h1>\u5bfc\u5165\u6a21\u5757<\/h1>\n<pre><code class=\"language-python\">import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.font_manager import FontProperties\nfrom sklearn.linear_model import RANSACRegressor\nfrom sklearn.linear_model import LinearRegression\n%matplotlib inline\nfont = FontProperties(fname=&#039;\/Library\/Fonts\/Heiti.ttc&#039;)<\/code><\/pre>\n<h1>\u83b7\u53d6\u6570\u636e<\/h1>\n<pre><code class=\"language-python\">df = pd.read_csv(&#039;housing-data.txt&#039;, sep=&#039;\\s+&#039;, header=0)\nX = df[[&#039;RM&#039;]].values\ny = df[&#039;MEDV&#039;].values<\/code><\/pre>\n<h1>\u8bad\u7ec3\u6a21\u578b<\/h1>\n<p><\/p><div id=\"rml_readmorelogin_placeholder\" style=\"position:relative;\"><div id=\"rml_fade_content\" style=\"position: absolute;\r\ntop:-10em;\r\nwidth:100%;\r\nheight:10em;\r\nbackground: -webkit-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -moz-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -o-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -ms-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\"><\/div><div class=\"wpf-controller aru_rml_from_in_post\" style=\"background-color:#eeeeee;border:5px solid #cce6ff;\" id=\"ARU_ReadMoreLogin_ReadMoreLoginController\"><h2 id=\"Header\">\u67e5\u770b\u66f4\u591a<\/h2><div id=\"Message\"><p>\u8054\u7cfb\u7ba1\u7406\u5458\u5fae\u4fe1tutu19192010\uff0c\u6ce8\u518c\u8d26\u53f7<\/p>\n<\/div><div id=\"StatusBarHeader\"><\/div><form id=\"ARU_ReadMoreLogin_ReadMoreLoginController\"><input name=\"post_id\" value=\"2996\" type=\"hidden\"\/><input name=\"_init_callback\" value=\"InitLogin\" type=\"hidden\"\/><input name=\"post_id\" value=\"2996\" type=\"hidden\"\/><input name=\"rt_ype\" value=\"1\" type=\"hidden\"\/><input name=\"nonce\" value=\"847d1c48c1\" type=\"hidden\"\/><input name=\"_wpnonce\" value=\"f48666364f\" type=\"hidden\"\/><input name=\"_controller\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginController\" type=\"hidden\"\/><input name=\"_proxy_controller\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginController\" type=\"hidden\"\/><input name=\"_view\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginView\" type=\"hidden\"\/><table class=\"wpf-table-placeholder\"><tbody class=\"wpf-table-placeholder\"><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\" width=\"400px\"><table class=\"wpf-table-placeholder\"><tbody class=\"wpf-table-placeholder\"><tr class=\"wpf-table-placeholder\"><th class=\"wpf-table-placeholder-input\"><label class=\"wpf-label\">Username:<\/label><\/th><\/tr><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\"><input class=\"regular-text text_input\" name=\"username\" value=\"\" type=\"text\"\/><\/td><\/tr><tr class=\"wpf-table-placeholder\"><th class=\"wpf-table-placeholder-input\"><label class=\"wpf-label\">Password:<\/label><\/th><\/tr><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\"><input class=\"regular-text text_input\" name=\"password\" value=\"\" type=\"password\"\/><\/td><\/tr><\/tbody><\/table><p class=\"wpf-table-placeholder submit\"><button class=\"wp_plugin_framework_ajax_button\" type=\"button\" style=\"background-color:#4D90FE;;color:#ffffff;;border:1px solid #3079ed;\" name=\"_event\" value=\"ButtonLogin\">Log in<\/button><\/p><\/td><td class=\"wpf-table-placeholder-input\"><\/td><\/tr><\/tbody><\/table><\/form><div id=\"ButtonStartRegister\"><a href=\"https:\/\/egonlin.com\/wp-login.php?action=register\">Register<\/a><\/div><div id=\"Link1\"><a href=\"https:\/\/egonlin.com\/wp-login.php?action=lostpassword\">Forgotten username or password?<\/a><\/div><div id=\"StatusBarFooter\"><\/div><\/div><\/div><div id=aru_remaining_content><\/div>","protected":false},"excerpt":{"rendered":"<p>RANSAC\u7b97\u6cd5\u7ebf\u6027\u56de\u5f52(\u6ce2\u65af\u987f\u623f\u4ef7\u9884\u6d4b) &emsp;&emsp;\u867d\u7136\u666e\u901a\u7ebf\u6027\u56de\u5f52\u9884\u6d4b\u7ed3\u679c\u603b\u4f53\u800c\u8a00\u8fd8\u662f\u633a\u4e0d\u9519 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":2997,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[276,286],"tags":[],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/2996"}],"collection":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2996"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/2996\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/media\/2997"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}