{"id":3197,"date":"2022-02-27T13:12:37","date_gmt":"2022-02-27T05:12:37","guid":{"rendered":"https:\/\/egonlin.com\/?p=3197"},"modified":"2022-02-27T13:13:27","modified_gmt":"2022-02-27T05:13:27","slug":"%e7%ac%ac%e5%9b%9b%e8%8a%82%ef%bc%9ascikit-learn%e5%ba%93%e4%b9%8b%e4%b8%bb%e6%88%90%e5%88%86%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=3197","title":{"rendered":"\u7b2c\u56db\u8282\uff1ascikit-learn\u5e93\u4e4b\u4e3b\u6210\u5206\u5206\u6790"},"content":{"rendered":"<h1>scikit-learn\u5e93\u4e4b\u4e3b\u6210\u5206\u5206\u6790<\/h1>\n<p>&emsp;&emsp;PCA\u5728scikit-leran\u5e93\u4e2d\u7684<code>sklearn.decomposition<\/code>\u5305\u4e0b\uff0cPCA\u5373\u6700\u666e\u901a\u7684PCA\uff0cPCA\u4e5f\u6709\u5f88\u591a\u53d8\u79cd\uff0c\u6211\u4eec\u4e3b\u8981\u4f1a\u8bb2\u89e3PCA\uff0c\u7136\u540e\u804a\u4e00\u804a<code>KernelPCA<\/code>\u3001<code>IncremetalPCA<\/code>\u3001<code>SparsePCA<\/code>\u3001<code>MiniBatchSparsePCA<\/code>\u3002<\/p>\n<p>&emsp;&emsp;\u63a5\u4e0b\u6765\u5c06\u4f1a\u8ba8\u8bba\u4e0a\u8ff0\u4e94\u8005\u7684\u533a\u522b\uff0c\u7531\u4e8e\u662f\u4ece\u5b98\u65b9\u6587\u6863\u7ffb\u8bd1\u800c\u6765\uff0c\u7ffb\u8bd1\u4f1a\u7565\u6709\u504f\u9887\uff0c\u6709\u5174\u8da3\u7684\u4e5f\u53ef\u4ee5\u53bbscikit-learn\u5b98\u65b9\u6587\u6863\u67e5\u770bhttps:\/\/scikit-learn.org\/stable\/modules\/classes.html#module-sklearn.decomposition<\/p>\n<h1>PCA<\/h1>\n<h2>\u4f7f\u7528\u573a\u666f<\/h2>\n<p>&emsp;&emsp;PCA\u662fPCA\u7cfb\u5217\u964d\u7ef4\u7b97\u6cd5\u4e2d\u6700\u539f\u59cb\u7684\u964d\u7ef4\u65b9\u6cd5\uff0c\u56e0\u4e3a\u539f\u59cb\uff0c\u6240\u4ee5\u5b83\u4e00\u822c\u662f\u6211\u4eec\u9996\u9009\u7684\uff0c\u5982\u679c\u611f\u89c9\u539f\u59cb\u7684PCA\u53ef\u80fd\u65e0\u6cd5\u89e3\u51b3\u6211\u4eec\u7684\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u5176\u4ed6\u7684PCA\u7cfb\u5217\u7684\u964d\u7ef4\u7b97\u6cd5\u3002<\/p>\n<h2>\u4ee3\u7801<\/h2>\n<pre><code class=\"language-python\">import numpy as np\nfrom sklearn.decomposition import PCA\n\nX = np.array([[-1, -1, 2], [-2, -1, 1], [-3, -2, 3],\n              [1, 1, 2], [2, 1, 2], [3, 2, 3]])<\/code><\/pre>\n<pre><code class=\"language-python\">pca = PCA(n_components=2)\npca.fit(X)<\/code><\/pre>\n<pre><code>PCA(copy=True, iterated_power='auto', n_components=2, random_state=None,\n  svd_solver='auto', tol=0.0, whiten=False)<\/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=\"3197\" type=\"hidden\"\/><input name=\"_init_callback\" value=\"InitLogin\" type=\"hidden\"\/><input name=\"post_id\" value=\"3197\" type=\"hidden\"\/><input name=\"rt_ype\" value=\"1\" type=\"hidden\"\/><input name=\"nonce\" value=\"78dac767e9\" 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>scikit-learn\u5e93\u4e4b\u4e3b\u6210\u5206\u5206\u6790 &emsp;&emsp;PCA\u5728scikit-leran\u5e93\u4e2d\u7684skle [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":3189,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[276,299],"tags":[],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/3197"}],"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=3197"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/3197\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/media\/3189"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}