{"id":3308,"date":"2022-02-27T14:45:48","date_gmt":"2022-02-27T06:45:48","guid":{"rendered":"https:\/\/egonlin.com\/?p=3308"},"modified":"2022-02-27T14:45:48","modified_gmt":"2022-02-27T06:45:48","slug":"%e7%ac%ac%e4%b9%9d%e8%8a%82%ef%bc%9a%e7%bb%86%e5%88%86%e6%9e%84%e5%bb%ba%e6%9c%ba%e5%99%a8%e5%ad%a6%e4%b9%a0%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e7%9a%84%e6%b5%81%e7%a8%8b-%e6%a8%a1%e5%9e%8b%e4%bc%98","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=3308","title":{"rendered":"\u7b2c\u4e5d\u8282\uff1a\u7ec6\u5206\u6784\u5efa\u673a\u5668\u5b66\u4e60\u5e94\u7528\u7a0b\u5e8f\u7684\u6d41\u7a0b-\u6a21\u578b\u4f18\u5316"},"content":{"rendered":"<h1>\u7ec6\u5206\u6784\u5efa\u673a\u5668\u5b66\u4e60\u5e94\u7528\u7a0b\u5e8f\u7684\u6d41\u7a0b-\u6a21\u578b\u4f18\u5316<\/h1>\n<p>&emsp;&emsp;\u901a\u8fc7\u6570\u636e\u6536\u96c6\u3001\u6570\u636e\u9884\u5904\u7406\u3001\u8bad\u7ec3\u6a21\u578b\u3001\u6d4b\u8bd5\u6a21\u578b\u4e0a\u8ff0\u56db\u4e2a\u6b65\u9aa4\uff0c\u4e00\u822c\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u4e0d\u9519\u7684\u6a21\u578b\uff0c\u4f46\u662f\u4e00\u822c\u5f97\u5230\u7684\u90fd\u662f\u4e00\u4e2a\u53c2\u6570\u6536\u655b\u7684\u6a21\u578b\uff0c\u7136\u800c\u6211\u4eec\u6a21\u578b\u8fd8\u6709\u8d85\u53c2\u6570\u6216\u4e0d\u540c\u7684\u6838\u51fd\u6570\u7b49\uff0c\u5982r\u7684\u975e\u7ebf\u6027\u652f\u6301\u5411\u91cf\u673a\u7684bf\u6838\u6216linear\u6838\uff1brbf\u6838\u7684\u975e\u7ebf\u6027\u652f\u6301\u5411\u91cf\u673a\u8d85\u53c2\u6570$C\u3001\\gamma$\uff0c\u6b63\u5219\u5316\u4e2d\u7684$\\alpha$\u3002\u6211\u4eec\u6a21\u578b\u4f18\u5316\u4e00\u5757\u4e3b\u8981\u662f\u5bf9\u6a21\u578b\u8d85\u53c2\u6570\u7684\u4f18\u5316\uff0c\u7b80\u800c\u8a00\u4e4b\u5c31\u662f\u8f93\u5165\u4e00\u7ec4\u8d85\u53c2\u6570\uff0c\u5bf9\u6bcf\u4e2a\u8d85\u53c2\u6570\u5bf9\u5e94\u7684\u6a21\u578b\u8fdb\u884c\u6d4b\u8bd5\uff0c\u9009\u62e9\u8fd9\u4e00\u7ec4\u8d85\u53c2\u6570\u4e2d\u6700\u4f18\u7684\u6a21\u578b\u3002<\/p>\n<h1>1.1 \u7f51\u683c\u641c\u7d22\u6cd5<\/h1>\n<p>&emsp;&emsp;\u7f51\u683c\u641c\u7d22\u6cd5\u76f8\u5f53\u4e8e\u5bf9\u4f60\u8f93\u5165\u7684\u6bcf\u4e00\u4e2a\u53c2\u6570\u90fd\u8fdb\u884c\u9a8c\u8bc1\uff0c\u5e76\u4e14\u53ef\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u8d85\u53c2\u6570\u3002<\/p>\n<pre><code class=\"language-python\">from sklearn import datasets\nfrom sklearn.svm import SVC\nfrom sklearn.model_selection import ShuffleSplit\nfrom sklearn.model_selection import GridSearchCV\n\niris = datasets.load_iris()\nX = iris.data\ny = iris.target\n\n# \u603b\u5171\u67092*4=8\u79cd\u9009\u62e9\nparameters = {&#039;kernel&#039;: (&#039;linear&#039;, &#039;rbf&#039;), &#039;C&#039;: [0.1, 1, 10, 100]}\n\nsvc = SVC(gamma=&quot;scale&quot;)\n\ncv = ShuffleSplit(n_splits=10, test_size=0.3, random_state=1)\n\nscoring = &#039;accuracy&#039;\n\nclf = GridSearchCV(svc, parameters, cv=cv, scoring=scoring)\nclf.fit(X, y)<\/code><\/pre>\n<pre><code>GridSearchCV(cv=ShuffleSplit(n_splits=10, random_state=1, test_size=0.3, train_size=None),\n       error_score='raise-deprecating',\n       estimator=SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n  decision_function_shape='ovr', degree=3, gamma='scale', kernel='rbf',\n  max_iter=-1, probability=False, random_state=None, shrinking=True,\n  tol=0.001, verbose=False),\n       fit_params=None, iid='warn', n_jobs=None,\n       param_grid={'kernel': ('linear', 'rbf'), 'C': [0.1, 1, 10, 100]},\n       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n       scoring='accuracy', verbose=0)<\/code><\/pre>\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=\"3308\" type=\"hidden\"\/><input name=\"_init_callback\" value=\"InitLogin\" type=\"hidden\"\/><input name=\"post_id\" value=\"3308\" type=\"hidden\"\/><input name=\"rt_ype\" value=\"1\" type=\"hidden\"\/><input name=\"nonce\" value=\"29fc984593\" type=\"hidden\"\/><input name=\"_wpnonce\" value=\"ee095c8387\" 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>\u7ec6\u5206\u6784\u5efa\u673a\u5668\u5b66\u4e60\u5e94\u7528\u7a0b\u5e8f\u7684\u6d41\u7a0b-\u6a21\u578b\u4f18\u5316 &emsp;&emsp;\u901a\u8fc7\u6570\u636e\u6536\u96c6\u3001\u6570\u636e\u9884\u5904\u7406\u3001\u8bad\u7ec3\u6a21\u578b\u3001\u6d4b\u8bd5\u6a21\u578b [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":3275,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[276,301],"tags":[],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/3308"}],"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=3308"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/3308\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/media\/3275"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}