{"id":2981,"date":"2022-02-20T21:02:29","date_gmt":"2022-02-20T13:02:29","guid":{"rendered":"https:\/\/egonlin.com\/?p=2981"},"modified":"2022-02-20T21:39:40","modified_gmt":"2022-02-20T13:39:40","slug":"%e7%ac%ac%e4%b8%89%e8%8a%82%ef%bc%9a%e6%99%ae%e9%80%9a%e7%ba%bf%e6%80%a7%e5%9b%9e%e5%bd%92%e6%b3%a2%e5%a3%ab%e9%a1%bf%e6%88%bf%e4%bb%b7%e9%a2%84%e6%b5%8b","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=2981","title":{"rendered":"\u7b2c\u4e09\u8282\uff1a\u666e\u901a\u7ebf\u6027\u56de\u5f52"},"content":{"rendered":"<h1>\u666e\u901a\u7ebf\u6027\u56de\u5f52(\u6ce2\u58eb\u987f\u623f\u4ef7\u9884\u6d4b)<\/h1>\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\nimport seaborn as sns\nfrom matplotlib.font_manager import FontProperties\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<p>&emsp;&emsp;<code>housing-data.txt<\/code>\u6570\u636e\u4e0b\u8f7d\u5730\u5740https:\/\/pan.baidu.com\/s\/1SvG0hFxupYA3KQO4fLsP5A<\/p>\n<h2>\u6253\u5370\u6570\u636e<\/h2>\n<pre><code class=\"language-python\">df = pd.read_csv(&#039;housing-data.txt&#039;, sep=&#039;\\s+&#039;, header=0)\ndf.head()<\/code><\/pre>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }<\/p>\n<p>    .dataframe tbody tr th {\n        vertical-align: top;\n    }<\/p>\n<p>    .dataframe thead th {\n        text-align: right;\n    }\n<\/style>\n<table border=\"1\" class=\"dataframe\">\n<thead>\n<tr style=\"text-align: right;\">\n<th><\/th>\n<th>CRIM<\/th>\n<th>ZN<\/th>\n<th>INDUS<\/th>\n<th>CHAS<\/th>\n<th>NOX<\/th>\n<th>RM<\/th>\n<th>AGE<\/th>\n<th>DIS<\/th>\n<th>RAD<\/th>\n<th>TAX<\/th>\n<th>PTRATIO<\/th>\n<th>B<\/th>\n<th>LSTAT<\/th>\n<th>MEDV<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>0<\/th>\n<td>0.00632<\/td>\n<td>18.0<\/td>\n<td>2.31<\/td>\n<td>0<\/td>\n<td>0.538<\/td>\n<td>6.575<\/td>\n<td>65.2<\/td>\n<td>4.0900<\/td>\n<td>1<\/td>\n<td>296.0<\/td>\n<td>15.3<\/td>\n<td>396.90<\/td>\n<td>4.98<\/td>\n<td>24.0<\/td>\n<\/tr>\n<tr>\n<th>1<\/th>\n<td>0.02731<\/td>\n<td>0.0<\/td>\n<td>7.07<\/td>\n<td>0<\/td>\n<td>0.469<\/td>\n<td>6.421<\/td>\n<td>78.9<\/td>\n<td>4.9671<\/td>\n<td>2<\/td>\n<td>242.0<\/td>\n<td>17.8<\/td>\n<td>396.90<\/td>\n<td>9.14<\/td>\n<td>21.6<\/td>\n<\/tr>\n<tr>\n<th>2<\/th>\n<td>0.02729<\/td>\n<td>0.0<\/td>\n<td>7.07<\/td>\n<td>0<\/td>\n<td>0.469<\/td>\n<td>7.185<\/td>\n<td>61.1<\/td>\n<td>4.9671<\/td>\n<td>2<\/td>\n<td>242.0<\/td>\n<td>17.8<\/td>\n<td>392.83<\/td>\n<td>4.03<\/td>\n<td>34.7<\/td>\n<\/tr>\n<tr>\n<th>3<\/th>\n<td>0.03237<\/td>\n<td>0.0<\/td>\n<td>2.18<\/td>\n<td>0<\/td>\n<td>0.458<\/td>\n<td>6.998<\/td>\n<td>45.8<\/td>\n<td>6.0622<\/td>\n<td>3<\/td>\n<td>222.0<\/td>\n<td>18.7<\/td>\n<td>394.63<\/td>\n<td>2.94<\/td>\n<td>33.4<\/td>\n<\/tr>\n<tr>\n<th>4<\/th>\n<td>0.06905<\/td>\n<td>0.0<\/td>\n<td>2.18<\/td>\n<td>0<\/td>\n<td>0.458<\/td>\n<td>7.147<\/td>\n<td>54.2<\/td>\n<td>6.0622<\/td>\n<td>3<\/td>\n<td>222.0<\/td>\n<td>18.7<\/td>\n<td>396.90<\/td>\n<td>5.33<\/td>\n<td>36.2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/blog.sholdboyedu.com\/wp-content\/uploads\/2021\/08\/post-2469-610b8f815fa89.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/blog.sholdboyedu.com\/wp-content\/uploads\/2021\/08\/post-2469-610b8f815fa89.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/div><\/p>\n<h1>\u7279\u5f81\u9009\u62e9<\/h1>\n<h2>\u6563\u70b9\u56fe\u77e9\u9635<\/h2>\n<p>&emsp;&emsp;\u4f7f\u7528sns\u5e93\u7684pairplot()\u65b9\u6cd5\u7ed8\u5236\u7684\u6563\u70b9\u56fe\u77e9\u9635\u53ef\u4ee5\u67e5\u770b\u6570\u636e\u96c6\u5185\u90e8\u7279\u5f81\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u4f8b\u5982\u53ef\u4ee5\u89c2\u5bdf\u5230\u7279\u5f81\u95f4\u5206\u5e03\u5173\u7cfb\u4ee5\u53ca\u79bb\u7fa4\u6837\u672c\u3002<\/p>\n<p>&emsp;&emsp;\u672c\u6587\u53ea\u7ed8\u5236\u4e86\u4e09\u5217\uff08RM\u3001MEDV(\u6807\u8bb0)\u3001LSTAT\uff09\u7279\u5f81\u548c\u6807\u8bb0\u4e4b\u95f4\u7684\u8054\u7cfb\uff0c\u6709\u5174\u8da3\u7684\u53ef\u4ee5\u8c03\u7528\u8be5\u65b9\u6cd5\u67e5\u770b\u5176\u5b83\u7279\u5f81\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/p>\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=\"2981\" type=\"hidden\"\/><input name=\"_init_callback\" value=\"InitLogin\" type=\"hidden\"\/><input name=\"post_id\" value=\"2981\" type=\"hidden\"\/><input name=\"rt_ype\" value=\"1\" type=\"hidden\"\/><input name=\"nonce\" value=\"11c058b8c8\" type=\"hidden\"\/><input name=\"_wpnonce\" value=\"b0e6d8f8bf\" 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>\u666e\u901a\u7ebf\u6027\u56de\u5f52(\u6ce2\u58eb\u987f\u623f\u4ef7\u9884\u6d4b) \u5bfc\u5165\u6a21\u5757 import pandas as pd import numpy a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":2982,"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\/2981"}],"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=2981"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/2981\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/media\/2982"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}