{"id":1179,"date":"2023-07-27T09:36:52","date_gmt":"2023-07-27T09:36:52","guid":{"rendered":"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/"},"modified":"2023-07-27T09:36:52","modified_gmt":"2023-07-27T09:36:52","slug":"python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81","status":"publish","type":"post","link":"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/","title":{"rendered":"Python \u4e2d\u7684 k \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff08\u9010\u6b65\uff09"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u4e3a\u4e86\u8bc4\u4f30\u6a21\u578b\u5728\u6570\u636e\u96c6\u4e0a\u7684\u6027\u80fd\uff0c\u6211\u4eec\u9700\u8981\u8861\u91cf\u6a21\u578b\u505a\u51fa\u7684\u9884\u6d4b\u4e0e\u89c2\u5bdf\u5230\u7684\u6570\u636e\u7684\u5339\u914d\u7a0b\u5ea6\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6267\u884c\u6b64\u64cd\u4f5c\u7684\u5e38\u7528\u65b9\u6cd5\u79f0\u4e3a<a href=\"https:\/\/statorials.org\/cn\/k\u6298\u4ea4\u53c9\u9a8c\u8bc1\/\" target=\"_blank\" rel=\"noopener noreferrer\">k \u6298\u4ea4\u53c9\u9a8c\u8bc1<\/a>\uff0c\u5b83\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>1.<\/strong>\u5c06\u6570\u636e\u96c6\u968f\u673a\u5206\u4e3a<em>k<\/em>\u7ec4\uff0c\u6216\u201c\u6298\u53e0\u201d\uff0c\u5927\u5c0f\u5927\u81f4\u76f8\u7b49\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>2.<\/strong>\u9009\u62e9\u5176\u4e2d\u4e00\u4e2a\u6298\u53e0\u4f5c\u4e3a\u7ea6\u675f\u88c5\u7f6e\u3002\u5c06\u6a21\u677f\u8c03\u6574\u5230\u5269\u4f59\u7684 k-1 \u6298\u53e0\u3002\u6839\u636e\u5f20\u7d27\u5c42\u4e2d\u7684\u89c2\u6d4b\u503c\u8ba1\u7b97 MSE \u68c0\u9a8c\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>3.<\/strong>\u91cd\u590d\u6b64\u8fc7\u7a0b<em>k<\/em>\u6b21\uff0c\u6bcf\u6b21\u4f7f\u7528\u4e0d\u540c\u7684\u96c6\u5408\u4f5c\u4e3a\u6392\u9664\u96c6\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>4.<\/strong>\u5c06\u603b\u4f53\u6d4b\u8bd5 MSE \u8ba1\u7b97\u4e3a<em>k \u4e2a<\/em>\u6d4b\u8bd5 MSE \u7684\u5e73\u5747\u503c\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u672c\u6559\u7a0b\u63d0\u4f9b\u4e86\u5982\u4f55\u5728 Python \u4e2d\u5bf9\u7ed9\u5b9a\u6a21\u578b\u6267\u884c k \u6298\u4ea4\u53c9\u9a8c\u8bc1\u7684\u5206\u6b65\u793a\u4f8b\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u7b2c 1 \u6b65\uff1a\u52a0\u8f7d\u5fc5\u8981\u7684\u5e93<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u9996\u5148\uff0c\u6211\u4eec\u5c06\u52a0\u8f7d\u6b64\u793a\u4f8b\u6240\u9700\u7684\u51fd\u6570\u548c\u5e93\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008000;\">from<\/span> sklearn. <span style=\"color: #3366ff;\">model_selection<\/span> <span style=\"color: #008000;\">import<\/span> train_test_split\n<span style=\"color: #008000;\">from<\/span> sklearn. <span style=\"color: #3366ff;\">model_selection<\/span> <span style=\"color: #008000;\">import<\/span> KFold\n<span style=\"color: #008000;\">from<\/span> sklearn. <span style=\"color: #3366ff;\">model_selection<\/span> <span style=\"color: #008000;\">import<\/span> cross_val_score\n<span style=\"color: #008000;\">from<\/span> sklearn. <span style=\"color: #3366ff;\">linear_model<\/span> <span style=\"color: #008000;\">import<\/span> LinearRegression\n<span style=\"color: #008000;\">from<\/span> numpy <span style=\"color: #008000;\">import<\/span> means\n<span style=\"color: #008000;\">from<\/span> numpy <span style=\"color: #008000;\">import<\/span> absolute\n<span style=\"color: #008000;\">from<\/span> numpy <span style=\"color: #008000;\">import<\/span> sqrt\n<span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n<\/strong><\/span><\/pre>\n<h3><span style=\"color: #000000;\"><strong>\u7b2c 2 \u6b65\uff1a\u521b\u5efa\u6570\u636e<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u521b\u5efa\u4e00\u4e2a pandas DataFrame\uff0c\u5176\u4e2d\u5305\u542b\u4e24\u4e2a\u9884\u6d4b\u53d8\u91cf<sub>x1<\/sub>\u548c<sub>x2<\/sub>\u4ee5\u53ca\u4e00\u4e2a\u54cd\u5e94\u53d8\u91cf y\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong>df = pd.DataFrame({' <span style=\"color: #008000;\">y<\/span> ': [6, 8, 12, 14, 14, 15, 17, 22, 24, 23],\n                   ' <span style=\"color: #008000;\">x1<\/span> ': [2, 5, 4, 3, 4, 6, 7, 5, 8, 9],\n                   ' <span style=\"color: #008000;\">x2<\/span> ': [14, 12, 12, 13, 7, 8, 7, 4, 6, 5]})\n<\/strong><\/span><\/pre>\n<h3><span style=\"color: #000000;\"><strong>\u6b65\u9aa4 3\uff1a\u6267\u884c K \u6298\u4ea4\u53c9\u9a8c\u8bc1<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u5bf9\u6570\u636e\u96c6\u62df\u5408 <a href=\"https:\/\/statorials.org\/cn\/\u7ebf\u6027\u56de\u5f52-python\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u591a\u5143\u7ebf\u6027\u56de\u5f52\u6a21\u578b<\/a>\uff0c\u5e76\u6267\u884c LOOCV \u6765\u8bc4\u4f30\u6a21\u578b\u7684\u6027\u80fd\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#define predictor and response variables\n<\/span>X = df[[' <span style=\"color: #008000;\">x1<\/span> ', ' <span style=\"color: #008000;\">x2<\/span> ']]\ny = df[' <span style=\"color: #008000;\">y<\/span> ']\n\n<span style=\"color: #008080;\">#define cross-validation method to use\n<\/span><span class=\"crayon-v\">cv<\/span> <span class=\"crayon-o\">=<\/span> <span class=\"crayon-e\">KFold<\/span> <span class=\"crayon-sy\">(<\/span> <span class=\"crayon-v\">n_splits<\/span> <span class=\"crayon-o\">=<\/span> <span class=\"crayon-cn\" style=\"color: #008000;\">10<\/span> <span class=\"crayon-sy\">,<\/span> <span class=\"crayon-v\">random_state<\/span> <span class=\"crayon-o\">=<\/span> <span class=\"crayon-cn\" style=\"color: #008000;\">1<\/span> <span class=\"crayon-sy\">,<\/span> <span class=\"crayon-v\">shuffle<\/span> <span class=\"crayon-o\">=<\/span> <span class=\"crayon-t\" style=\"color: #008000;\">True<\/span> <span class=\"crayon-sy\">)<\/span>\n\n<span style=\"color: #008080;\">#build multiple linear regression model\n<\/span>model = LinearRegression()\n\n<span style=\"color: #008080;\">#use k-fold CV to evaluate model\n<\/span>scores = cross_val_score(model, X, y, scoring=' <span style=\"color: #008000;\">neg_mean_absolute_error<\/span> ',\n                         cv=cv, n_jobs=-1)\n\n<span style=\"color: #008080;\">#view mean absolute error\n<\/span>mean(absolute(scores))\n\n3.6141267491803646\n<\/strong><\/span><\/pre>\n<p><span style=\"color: #000000;\">\u4ece\u7ed3\u679c\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u5e73\u5747\u7edd\u5bf9\u8bef\u5dee\uff08MAE\uff09\u4e3a<strong>3.614<\/strong> \u3002\u5373\u6a21\u578b\u9884\u6d4b\u4e0e\u5b9e\u9645\u89c2\u6d4b\u6570\u636e\u4e4b\u95f4\u7684\u5e73\u5747\u7edd\u5bf9\u8bef\u5dee\u4e3a3.614\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u4e00\u822c\u6765\u8bf4\uff0cMAE \u8d8a\u4f4e\uff0c\u6a21\u578b\u9884\u6d4b\u5b9e\u9645\u89c2\u6d4b\u503c\u7684\u80fd\u529b\u5c31\u8d8a\u597d\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u8bc4\u4f30\u6a21\u578b\u6027\u80fd\u7684\u53e6\u4e00\u4e2a\u5e38\u7528\u6307\u6807\u662f\u5747\u65b9\u6839\u8bef\u5dee (RMSE)\u3002\u4ee5\u4e0b\u4ee3\u7801\u663e\u793a\u4e86\u5982\u4f55\u4f7f\u7528 LOOCV \u8ba1\u7b97\u6b64\u6307\u6807\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#define predictor and response variables\n<\/span>X = df[[' <span style=\"color: #008000;\">x1<\/span> ', ' <span style=\"color: #008000;\">x2<\/span> ']]\ny = df[' <span style=\"color: #008000;\">y<\/span> ']\n\n<span style=\"color: #008080;\">#define cross-validation method to use\n<\/span><span class=\"crayon-v\">cv<\/span> <span class=\"crayon-o\">=<\/span> <span class=\"crayon-e\">KFold<\/span> <span class=\"crayon-sy\">(<\/span> <span class=\"crayon-v\">n_splits<\/span> <span class=\"crayon-o\">=<\/span> <span class=\"crayon-cn\" style=\"color: #008000;\">5<\/span> <span class=\"crayon-sy\">,<\/span> <span class=\"crayon-v\">random_state<\/span> <span class=\"crayon-o\">=<\/span> <span class=\"crayon-cn\" style=\"color: #008000;\">1<\/span> <span class=\"crayon-sy\">,<\/span> <span class=\"crayon-v\">shuffle<\/span> <span class=\"crayon-o\">=<\/span> <span class=\"crayon-t\" style=\"color: #008000;\">True<\/span> <span class=\"crayon-sy\">)<\/span> \n\n<span style=\"color: #008080;\">#build multiple linear regression model\n<\/span>model = LinearRegression()\n\n<span style=\"color: #008080;\">#use LOOCV to evaluate model\n<\/span>scores = cross_val_score(model, X, y, scoring=' <span style=\"color: #008000;\">neg_mean_squared_error<\/span> ',\n                         cv=cv, n_jobs=-1)\n\n<span style=\"color: #008080;\">#view RMSE\n<\/span>sqrt(mean(absolute(scores)))\n\n4.284373111711816<\/strong><\/span><\/pre>\n<p><span style=\"color: #000000;\">\u4ece\u7ed3\u679c\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u5747\u65b9\u6839\u8bef\u5dee\uff08RMSE\uff09\u4e3a<strong>4.284<\/strong> \u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\">RMSE \u8d8a\u4f4e\uff0c\u6a21\u578b\u9884\u6d4b\u5b9e\u9645\u89c2\u6d4b\u503c\u7684\u80fd\u529b\u5c31\u8d8a\u597d\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u5728\u5b9e\u8df5\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u4f1a\u62df\u5408\u51e0\u4e2a\u4e0d\u540c\u7684\u6a21\u578b\uff0c\u5e76\u6bd4\u8f83\u6bcf\u4e2a\u6a21\u578b\u7684 RMSE \u6216 MAE\uff0c\u4ee5\u786e\u5b9a\u54ea\u4e2a\u6a21\u578b\u4ea7\u751f\u6700\u4f4e\u7684\u6d4b\u8bd5\u9519\u8bef\u7387\uff0c\u56e0\u6b64\u662f\u6700\u597d\u4f7f\u7528\u7684\u6a21\u578b\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u53e6\u8bf7\u6ce8\u610f\uff0c\u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9009\u62e9\u4f7f\u7528 k=5 \u6298\u53e0\uff0c\u4f46\u60a8\u53ef\u4ee5\u9009\u62e9\u6240\u9700\u7684\u4efb\u610f\u6298\u53e0\u6b21\u6570\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u5728\u5b9e\u8df5\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u9009\u62e9 5 \u5230 10 \u5c42\u4e4b\u95f4\uff0c\u56e0\u4e3a\u4e8b\u5b9e\u8bc1\u660e\u8fd9\u662f\u4ea7\u751f\u53ef\u9760\u6d4b\u8bd5\u9519\u8bef\u7387\u7684\u6700\u4f73\u5c42\u6570\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\"><em>\u60a8\u53ef\u4ee5<a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.model_selection.KFold.html\" target=\"_blank\" rel=\"noopener noreferrer\">\u5728\u6b64\u5904<\/a>\u627e\u5230 sklearn \u7684 KFold() \u51fd\u6570\u7684\u5b8c\u6574\u6587\u6863\u3002<\/em><\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u5176\u4ed6\u8d44\u6e90<\/strong><\/span><\/h3>\n<p><a href=\"https:\/\/statorials.org\/cn\/k\u6298\u4ea4\u53c9\u9a8c\u8bc1\/\" target=\"_blank\" rel=\"noopener noreferrer\">K \u6298\u4ea4\u53c9\u9a8c\u8bc1\u7b80\u4ecb<\/a><br \/><a href=\"https:\/\/statorials.org\/cn\/\u7ebf\u6027\u56de\u5f52-python\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python \u7ebf\u6027\u56de\u5f52\u5b8c\u6574\u6307\u5357<\/a><br \/><a href=\"https:\/\/statorials.org\/cn\/\u8ba9\u4e00\u4e2a\u4eba\u5728python\u4e2d\u8fdb\u884c\u4ea4\u53c9\u9a8c\u8bc1\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python \u4e2d\u7684\u7559\u4e00\u4ea4\u53c9\u9a8c\u8bc1<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4e86\u8bc4\u4f30\u6a21\u578b\u5728\u6570\u636e\u96c6\u4e0a\u7684\u6027\u80fd\uff0c\u6211\u4eec\u9700\u8981\u8861\u91cf\u6a21\u578b\u505a\u51fa\u7684\u9884\u6d4b\u4e0e\u89c2\u5bdf\u5230\u7684\u6570\u636e\u7684\u5339\u914d\u7a0b\u5ea6\u3002 \u6267\u884c\u6b64\u64cd\u4f5c\u7684\u5e38\u7528\u65b9\u6cd5\u79f0\u4e3ak [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1179","post","type-post","status-publish","format-standard","hentry","category-11"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python \u4e2d\u7684 K \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff08\u4e00\u6b65\u4e00\u6b65\uff09- Statory<\/title>\n<meta name=\"description\" content=\"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u5728 Python \u4e2d\u6267\u884c k \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff0c\u5305\u62ec\u5206\u6b65\u793a\u4f8b\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/cn\/python\u4e2d\u7684k\u6298\u4ea4\u53c9\u9a8c\u8bc1\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python \u4e2d\u7684 K \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff08\u4e00\u6b65\u4e00\u6b65\uff09- Statory\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u5728 Python \u4e2d\u6267\u884c k \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff0c\u5305\u62ec\u5206\u6b65\u793a\u4f8b\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/cn\/python\u4e2d\u7684k\u6298\u4ea4\u53c9\u9a8c\u8bc1\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T09:36:52+00:00\" \/>\n<meta name=\"author\" content=\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/\",\"url\":\"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/\",\"name\":\"Python \u4e2d\u7684 K \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff08\u4e00\u6b65\u4e00\u6b65\uff09- Statory\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/cn\/#website\"},\"datePublished\":\"2023-07-27T09:36:52+00:00\",\"dateModified\":\"2023-07-27T09:36:52+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261\"},\"description\":\"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u5728 Python \u4e2d\u6267\u884c k \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff0c\u5305\u62ec\u5206\u6b65\u793a\u4f8b\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/statorials.org\/cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python \u4e2d\u7684 k \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff08\u9010\u6b65\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/cn\/#website\",\"url\":\"https:\/\/statorials.org\/cn\/\",\"name\":\"Statorials\",\"description\":\"\u60a8\u7684\u7edf\u8ba1\u7d20\u517b\u6307\u5357\uff01\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261\",\"name\":\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\"},\"description\":\"\u5927\u5bb6\u597d\uff0c\u6211\u662f\u672c\u6770\u660e\uff0c\u4e00\u4f4d\u9000\u4f11\u7684\u7edf\u8ba1\u5b66\u6559\u6388\uff0c\u540e\u6765\u6210\u4e3a Statorials \u7684\u70ed\u5fc3\u6559\u5e08\u3002 \u51ed\u501f\u5728\u7edf\u8ba1\u9886\u57df\u7684\u4e30\u5bcc\u7ecf\u9a8c\u548c\u4e13\u4e1a\u77e5\u8bc6\uff0c\u6211\u6e34\u671b\u5206\u4eab\u6211\u7684\u77e5\u8bc6\uff0c\u901a\u8fc7 Statorials \u589e\u5f3a\u5b66\u751f\u7684\u80fd\u529b\u3002\u4e86\u89e3\u66f4\u591a\",\"sameAs\":[\"https:\/\/statorials.org\/cn\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python \u4e2d\u7684 K \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff08\u4e00\u6b65\u4e00\u6b65\uff09- Statory","description":"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u5728 Python \u4e2d\u6267\u884c k \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff0c\u5305\u62ec\u5206\u6b65\u793a\u4f8b\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/cn\/python\u4e2d\u7684k\u6298\u4ea4\u53c9\u9a8c\u8bc1\/","og_locale":"zh_CN","og_type":"article","og_title":"Python \u4e2d\u7684 K \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff08\u4e00\u6b65\u4e00\u6b65\uff09- Statory","og_description":"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u5728 Python \u4e2d\u6267\u884c k \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff0c\u5305\u62ec\u5206\u6b65\u793a\u4f8b\u3002","og_url":"https:\/\/statorials.org\/cn\/python\u4e2d\u7684k\u6298\u4ea4\u53c9\u9a8c\u8bc1\/","og_site_name":"Statorials","article_published_time":"2023-07-27T09:36:52+00:00","author":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/","url":"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/","name":"Python \u4e2d\u7684 K \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff08\u4e00\u6b65\u4e00\u6b65\uff09- Statory","isPartOf":{"@id":"https:\/\/statorials.org\/cn\/#website"},"datePublished":"2023-07-27T09:36:52+00:00","dateModified":"2023-07-27T09:36:52+00:00","author":{"@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261"},"description":"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u5728 Python \u4e2d\u6267\u884c k \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff0c\u5305\u62ec\u5206\u6b65\u793a\u4f8b\u3002","breadcrumb":{"@id":"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/cn\/python%e4%b8%ad%e7%9a%84k%e6%8a%98%e4%ba%a4%e5%8f%89%e9%aa%8c%e8%af%81\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/statorials.org\/cn\/"},{"@type":"ListItem","position":2,"name":"Python \u4e2d\u7684 k \u6298\u4ea4\u53c9\u9a8c\u8bc1\uff08\u9010\u6b65\uff09"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/cn\/#website","url":"https:\/\/statorials.org\/cn\/","name":"Statorials","description":"\u60a8\u7684\u7edf\u8ba1\u7d20\u517b\u6307\u5357\uff01","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261","name":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a"},"description":"\u5927\u5bb6\u597d\uff0c\u6211\u662f\u672c\u6770\u660e\uff0c\u4e00\u4f4d\u9000\u4f11\u7684\u7edf\u8ba1\u5b66\u6559\u6388\uff0c\u540e\u6765\u6210\u4e3a Statorials \u7684\u70ed\u5fc3\u6559\u5e08\u3002 \u51ed\u501f\u5728\u7edf\u8ba1\u9886\u57df\u7684\u4e30\u5bcc\u7ecf\u9a8c\u548c\u4e13\u4e1a\u77e5\u8bc6\uff0c\u6211\u6e34\u671b\u5206\u4eab\u6211\u7684\u77e5\u8bc6\uff0c\u901a\u8fc7 Statorials \u589e\u5f3a\u5b66\u751f\u7684\u80fd\u529b\u3002\u4e86\u89e3\u66f4\u591a","sameAs":["https:\/\/statorials.org\/cn"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts\/1179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/comments?post=1179"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts\/1179\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/media?parent=1179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/categories?post=1179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/tags?post=1179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}