{"id":982188,"date":"2024-12-27T07:08:50","date_gmt":"2024-12-26T23:08:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/982188.html"},"modified":"2024-12-27T07:08:51","modified_gmt":"2024-12-26T23:08:51","slug":"python%e5%a6%82%e4%bd%95%e9%a2%84%e6%b5%8b%e9%b2%8d%e9%b1%bc%e5%b9%b4%e9%be%84","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/982188.html","title":{"rendered":"python\u5982\u4f55\u9884\u6d4b\u9c8d\u9c7c\u5e74\u9f84"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24210802\/9af5e165-3215-4cdc-9723-5eb96eedaa66.webp\" alt=\"python\u5982\u4f55\u9884\u6d4b\u9c8d\u9c7c\u5e74\u9f84\" \/><\/p>\n<p><p> <strong>Python\u9884\u6d4b\u9c8d\u9c7c\u5e74\u9f84\u53ef\u4ee5\u901a\u8fc7\u6570\u636e\u9884\u5904\u7406\u3001\u7279\u5f81\u9009\u62e9\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u6a21\u578b\u8bad\u7ec3\u4e0e\u8bc4\u4f30\u7b49\u6b65\u9aa4\u5b9e\u73b0<\/strong>\u3002\u901a\u8fc7\u5206\u6790\u9c8d\u9c7c\u6570\u636e\u96c6\u4e2d\u7684\u7279\u5f81\uff0c\u5982\u58f3\u957f\u3001\u58f3\u5bbd\u3001\u58f3\u9ad8\u7b49\uff0c\u4e0e\u9c8d\u9c7c\u7684\u5e74\u9f84\uff08\u5373\u58f3\u73af\u6570+4\uff09\u8fdb\u884c\u5173\u8054\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u56de\u5f52\u7b97\u6cd5\u8fdb\u884c\u9884\u6d4b\u3002\u5e38\u7528\u7684\u7b97\u6cd5\u5305\u62ec\u7ebf\u6027\u56de\u5f52\u3001\u652f\u6301\u5411\u91cf\u56de\u5f52\u3001\u968f\u673a\u68ee\u6797\u3001XGBoost\u7b49\u3002\u5176\u4e2d\uff0c\u968f\u673a\u68ee\u6797\u7531\u4e8e\u5176\u5728\u5904\u7406\u975e\u7ebf\u6027\u5173\u7cfb\u53ca\u7279\u5f81\u91cd\u8981\u6027\u8bc4\u4f30\u65b9\u9762\u7684\u4f18\u52bf\uff0c\u5e38\u88ab\u7528\u4f5c\u9996\u9009\u6a21\u578b\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5229\u7528Python\u53ca\u76f8\u5173\u5e93\u6765\u5b9e\u73b0\u9c8d\u9c7c\u5e74\u9f84\u7684\u9884\u6d4b\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u6570\u636e\u9884\u5904\u7406<\/h2>\n<\/p>\n<p><p>\u5728\u9884\u6d4b\u9c8d\u9c7c\u5e74\u9f84\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u5bf9\u6570\u636e\u8fdb\u884c\u6e05\u6d17\u548c\u9884\u5904\u7406\uff0c\u4ee5\u786e\u4fdd\u6a21\u578b\u7684\u51c6\u786e\u6027\u548c\u7a33\u5b9a\u6027\u3002<\/p>\n<\/p>\n<p><h3>\u6570\u636e\u6e05\u6d17<\/h3>\n<\/p>\n<p><p>\u6570\u636e\u6e05\u6d17\u662f\u6570\u636e\u9884\u5904\u7406\u7684\u91cd\u8981\u6b65\u9aa4\uff0c\u901a\u5e38\u5305\u62ec\u5904\u7406\u7f3a\u5931\u503c\u3001\u5f02\u5e38\u503c\u548c\u91cd\u590d\u503c\u3002\u5728\u9c8d\u9c7c\u6570\u636e\u96c6\u4e2d\uff0c\u901a\u5e38\u6ca1\u6709\u7f3a\u5931\u503c\uff0c\u4f46\u6211\u4eec\u4ecd\u9700\u68c0\u67e5\u5e76\u5904\u7406\u53ef\u80fd\u7684\u5f02\u5e38\u503c\u3002\u4f8b\u5982\uff0c\u68c0\u67e5\u7279\u5f81\u503c\u7684\u8303\u56f4\uff0c\u6392\u9664\u4e0d\u5408\u5e38\u7406\u7684\u6781\u7aef\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u8bfb\u53d6\u6570\u636e<\/strong><\/h2>\n<p>data = pd.read_csv(&#39;abalone.csv&#39;)<\/p>\n<h2><strong>\u68c0\u67e5\u6570\u636e\u57fa\u672c\u4fe1\u606f<\/strong><\/h2>\n<p>print(data.info())<\/p>\n<h2><strong>\u68c0\u67e5\u5f02\u5e38\u503c<\/strong><\/h2>\n<p>print(data.describe())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u7279\u5f81\u7f16\u7801<\/h3>\n<\/p>\n<p><p>\u5728\u9c8d\u9c7c\u6570\u636e\u96c6\u4e2d\uff0c\u6027\u522b\u662f\u4e00\u4e2a\u5206\u7c7b\u7279\u5f81\uff0c\u9700\u8981\u5c06\u5176\u7f16\u7801\u4e3a\u6570\u503c\u5f62\u5f0f\u4ee5\u4fbf\u4e8e\u6a21\u578b\u5904\u7406\u3002\u53ef\u4ee5\u4f7f\u7528pandas\u5e93\u7684<code>get_dummies<\/code>\u65b9\u6cd5\u8fdb\u884c\u72ec\u70ed\u7f16\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u72ec\u70ed\u7f16\u7801<\/p>\n<p>data_encoded = pd.get_dummies(data, columns=[&#39;Sex&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e8c\u3001\u7279\u5f81\u9009\u62e9<\/h2>\n<\/p>\n<p><p>\u7279\u5f81\u9009\u62e9\u662f\u63d0\u9ad8\u6a21\u578b\u6027\u80fd\u7684\u91cd\u8981\u6b65\u9aa4\u3002\u901a\u5e38\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u76f8\u5173\u6027\u5206\u6790\u6216\u7279\u5f81\u91cd\u8981\u6027\u8bc4\u4f30\u6765\u9009\u62e9\u6700\u6709\u7528\u7684\u7279\u5f81\u3002<\/p>\n<\/p>\n<p><h3>\u76f8\u5173\u6027\u5206\u6790<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u76ae\u5c14\u900a\u76f8\u5173\u7cfb\u6570\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u8bc6\u522b\u4e0e\u76ee\u6807\u53d8\u91cf\uff08\u5e74\u9f84\uff09\u6700\u76f8\u5173\u7684\u7279\u5f81\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import seaborn as sns<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u8ba1\u7b97\u76f8\u5173\u6027\u77e9\u9635<\/strong><\/h2>\n<p>corr_matrix = data_encoded.corr()<\/p>\n<h2><strong>\u7ed8\u5236\u70ed\u529b\u56fe<\/strong><\/h2>\n<p>plt.figure(figsize=(10, 8))<\/p>\n<p>sns.heatmap(corr_matrix, annot=True, cmap=&#39;coolwarm&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u7279\u5f81\u91cd\u8981\u6027<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u6811\u6a21\u578b\uff08\u5982\u968f\u673a\u68ee\u6797\uff09\uff0c\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u6a21\u578b\u7684\u7279\u5f81\u91cd\u8981\u6027\u5c5e\u6027\u6765\u8bc4\u4f30\u5404\u7279\u5f81\u7684\u91cd\u8981\u6027\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.ensemble import RandomForestRegressor<\/p>\n<h2><strong>\u521d\u59cb\u5316\u6a21\u578b<\/strong><\/h2>\n<p>rf = RandomForestRegressor()<\/p>\n<h2><strong>\u62df\u5408\u6a21\u578b<\/strong><\/h2>\n<p>rf.fit(data_encoded.drop(&#39;Rings&#39;, axis=1), data_encoded[&#39;Rings&#39;])<\/p>\n<h2><strong>\u83b7\u53d6\u7279\u5f81\u91cd\u8981\u6027<\/strong><\/h2>\n<p>importance = rf.feature_importances_<\/p>\n<h2><strong>\u8f93\u51fa\u7279\u5f81\u91cd\u8981\u6027<\/strong><\/h2>\n<p>print(importance)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e09\u3001\u6a21\u578b\u9009\u62e9\u4e0e\u8bad\u7ec3<\/h2>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684\u673a\u5668\u5b66\u4e60\u6a21\u578b\u662f\u9884\u6d4b\u51c6\u786e\u6027\u7684\u91cd\u8981\u4fdd\u8bc1\u3002\u5e38\u7528\u7684\u6a21\u578b\u5305\u62ec\u7ebf\u6027\u56de\u5f52\u3001\u968f\u673a\u68ee\u6797\u3001\u652f\u6301\u5411\u91cf\u673a\u7b49\u3002<\/p>\n<\/p>\n<p><h3>\u7ebf\u6027\u56de\u5f52<\/h3>\n<\/p>\n<p><p>\u7ebf\u6027\u56de\u5f52\u662f\u4e00\u79cd\u7b80\u5355\u4e14\u9ad8\u6548\u7684\u56de\u5f52\u6a21\u578b\uff0c\u9002\u7528\u4e8e\u6570\u636e\u7279\u5f81\u4e0e\u76ee\u6807\u53d8\u91cf\u5448\u7ebf\u6027\u5173\u7cfb\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.linear_model import LinearRegression<\/p>\n<p>from sklearn.model_selection import tr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n_test_split<\/p>\n<p>from sklearn.metrics import mean_squared_error<\/p>\n<h2><strong>\u5206\u5272\u6570\u636e\u96c6<\/strong><\/h2>\n<p>X_train, X_test, y_train, y_test = train_test_split(data_encoded.drop(&#39;Rings&#39;, axis=1), data_encoded[&#39;Rings&#39;], test_size=0.2, random_state=42)<\/p>\n<h2><strong>\u521d\u59cb\u5316\u5e76\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>lr = LinearRegression()<\/p>\n<p>lr.fit(X_train, y_train)<\/p>\n<h2><strong>\u9884\u6d4b\u4e0e\u8bc4\u4f30<\/strong><\/h2>\n<p>y_pred = lr.predict(X_test)<\/p>\n<p>print(&#39;MSE:&#39;, mean_squared_error(y_test, y_pred))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u968f\u673a\u68ee\u6797<\/h3>\n<\/p>\n<p><p>\u968f\u673a\u68ee\u6797\u662f\u4e00\u79cd\u96c6\u6210\u5b66\u4e60\u65b9\u6cd5\uff0c\u9002\u5408\u5904\u7406\u6570\u636e\u7684\u975e\u7ebf\u6027\u5173\u7cfb\uff0c\u5e76\u4e14\u5177\u6709\u8f83\u5f3a\u7684\u6297\u8fc7\u62df\u5408\u80fd\u529b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521d\u59cb\u5316\u5e76\u8bad\u7ec3\u6a21\u578b<\/p>\n<p>rf = RandomForestRegressor(n_estimators=100, random_state=42)<\/p>\n<p>rf.fit(X_train, y_train)<\/p>\n<h2><strong>\u9884\u6d4b\u4e0e\u8bc4\u4f30<\/strong><\/h2>\n<p>y_pred_rf = rf.predict(X_test)<\/p>\n<p>print(&#39;Random Forest MSE:&#39;, mean_squared_error(y_test, y_pred_rf))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u56db\u3001\u6a21\u578b\u4f18\u5316\u4e0e\u8bc4\u4f30<\/h2>\n<\/p>\n<p><p>\u4e3a\u4e86\u63d0\u9ad8\u6a21\u578b\u7684\u9884\u6d4b\u7cbe\u5ea6\uff0c\u6211\u4eec\u901a\u5e38\u9700\u8981\u5bf9\u6a21\u578b\u8fdb\u884c\u4f18\u5316\uff0c\u8fd9\u5305\u62ec\u53c2\u6570\u8c03\u4f18\u548c\u4ea4\u53c9\u9a8c\u8bc1\u3002<\/p>\n<\/p>\n<p><h3>\u53c2\u6570\u8c03\u4f18<\/h3>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528\u7f51\u683c\u641c\u7d22\u6216\u968f\u673a\u641c\u7d22\u6765\u5bfb\u627e\u6700\u4f18\u7684\u6a21\u578b\u53c2\u6570\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528\u7f51\u683c\u641c\u7d22\u4f18\u5316\u968f\u673a\u68ee\u6797\u6a21\u578b\u53c2\u6570\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.model_selection import GridSearchCV<\/p>\n<h2><strong>\u5b9a\u4e49\u53c2\u6570\u8303\u56f4<\/strong><\/h2>\n<p>param_grid = {<\/p>\n<p>    &#39;n_estimators&#39;: [50, 100, 200],<\/p>\n<p>    &#39;max_features&#39;: [&#39;auto&#39;, &#39;sqrt&#39;, &#39;log2&#39;],<\/p>\n<p>    &#39;max_depth&#39;: [None, 10, 20, 30]<\/p>\n<p>}<\/p>\n<h2><strong>\u521d\u59cb\u5316\u7f51\u683c\u641c\u7d22<\/strong><\/h2>\n<p>grid_search = GridSearchCV(estimator=rf, param_grid=param_grid, cv=5, scoring=&#39;neg_mean_squared_error&#39;, n_jobs=-1)<\/p>\n<h2><strong>\u6267\u884c\u7f51\u683c\u641c\u7d22<\/strong><\/h2>\n<p>grid_search.fit(X_train, y_train)<\/p>\n<h2><strong>\u8f93\u51fa\u6700\u4f73\u53c2\u6570<\/strong><\/h2>\n<p>print(&#39;Best Parameters:&#39;, grid_search.best_params_)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4ea4\u53c9\u9a8c\u8bc1<\/h3>\n<\/p>\n<p><p>\u4ea4\u53c9\u9a8c\u8bc1\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u51c6\u786e\u5730\u8bc4\u4f30\u6a21\u578b\u7684\u6027\u80fd\u3002k\u6298\u4ea4\u53c9\u9a8c\u8bc1\u662f\u4e00\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u51cf\u5c0f\u6a21\u578b\u8bc4\u4f30\u7684\u65b9\u5dee\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.model_selection import cross_val_score<\/p>\n<h2><strong>\u6267\u884c\u4ea4\u53c9\u9a8c\u8bc1<\/strong><\/h2>\n<p>cv_scores = cross_val_score(rf, data_encoded.drop(&#39;Rings&#39;, axis=1), data_encoded[&#39;Rings&#39;], cv=10, scoring=&#39;neg_mean_squared_error&#39;)<\/p>\n<h2><strong>\u8f93\u51fa\u5e73\u5747\u5f97\u5206<\/strong><\/h2>\n<p>print(&#39;Cross-Validation MSE:&#39;, -cv_scores.mean())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e94\u3001\u7ed3\u679c\u5206\u6790\u4e0e\u5e94\u7528<\/h2>\n<\/p>\n<p><p>\u5728\u5b8c\u6210\u6a21\u578b\u7684\u8bad\u7ec3\u4e0e\u4f18\u5316\u540e\uff0c\u6211\u4eec\u9700\u8981\u5bf9\u9884\u6d4b\u7ed3\u679c\u8fdb\u884c\u5206\u6790\uff0c\u4ee5\u4fbf\u5728\u5b9e\u9645\u4e2d\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u7ed3\u679c\u53ef\u89c6\u5316<\/h3>\n<\/p>\n<p><p>\u53ef\u4ee5\u901a\u8fc7\u7ed8\u5236\u9884\u6d4b\u503c\u4e0e\u5b9e\u9645\u503c\u7684\u5bf9\u6bd4\u56fe\uff0c\u6765\u76f4\u89c2\u5730\u5206\u6790\u6a21\u578b\u7684\u9884\u6d4b\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">plt.scatter(y_test, y_pred_rf)<\/p>\n<p>plt.xlabel(&#39;Actual Age&#39;)<\/p>\n<p>plt.ylabel(&#39;Predicted Age&#39;)<\/p>\n<p>plt.title(&#39;Actual vs Predicted Age&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u5b9e\u9645\u5e94\u7528<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u7ecf\u8fc7\u4f18\u5316\u7684\u6a21\u578b\u96c6\u6210\u5230\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u7528\u4e8e\u5b9e\u65f6\u9884\u6d4b\u9c8d\u9c7c\u7684\u5e74\u9f84\u3002\u8fd9\u53ef\u4ee5\u4e3a\u76f8\u5173\u884c\u4e1a\u63d0\u4f9b\u6709\u4ef7\u503c\u7684\u51b3\u7b56\u652f\u6301\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528Python\u5b9e\u73b0\u5bf9\u9c8d\u9c7c\u5e74\u9f84\u7684\u6709\u6548\u9884\u6d4b\u3002\u8fd9\u4e00\u8fc7\u7a0b\u4e0d\u4ec5\u5c55\u793a\u4e86\u6570\u636e\u79d1\u5b66\u548c\u673a\u5668\u5b66\u4e60\u5728\u5b9e\u9645\u95ee\u9898\u4e2d\u7684\u5e94\u7528\uff0c\u540c\u65f6\u4e5f\u4e3a\u6c34\u4ea7\u517b\u6b96\u3001\u6d77\u6d0b\u7814\u7a76\u7b49\u9886\u57df\u63d0\u4f9b\u4e86\u91cd\u8981\u53c2\u8003\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u9c8d\u9c7c\u5e74\u9f84\u9884\u6d4b\uff1f<\/strong><br \/>\u5229\u7528Python\u8fdb\u884c\u9c8d\u9c7c\u5e74\u9f84\u9884\u6d4b\u901a\u5e38\u6d89\u53ca\u6570\u636e\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60\u6280\u672f\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u6536\u96c6\u76f8\u5173\u7684\u9c8d\u9c7c\u751f\u957f\u6570\u636e\uff0c\u5982\u4f53\u91cd\u3001\u957f\u5ea6\u3001\u73af\u5883\u56e0\u7d20\u7b49\u3002\u63a5\u4e0b\u6765\uff0c\u4f7f\u7528Pandas\u5e93\u8fdb\u884c\u6570\u636e\u5904\u7406\uff0c\u6e05\u6d17\u548c\u6574\u7406\u6570\u636e\u3002\u7136\u540e\uff0c\u4f7f\u7528Scikit-learn\u7b49\u5e93\u9009\u62e9\u5408\u9002\u7684\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\uff0c\u4f8b\u5982\u7ebf\u6027\u56de\u5f52\u6216\u51b3\u7b56\u6811\uff0c\u8fdb\u884c\u6a21\u578b\u8bad\u7ec3\u3002\u6700\u540e\uff0c\u4f7f\u7528\u6d4b\u8bd5\u6570\u636e\u8bc4\u4f30\u6a21\u578b\u7684\u9884\u6d4b\u51c6\u786e\u6027\u3002<\/p>\n<p><strong>\u6709\u54ea\u4e9b\u9002\u5408\u9c8d\u9c7c\u5e74\u9f84\u9884\u6d4b\u7684\u673a\u5668\u5b66\u4e60\u6a21\u578b\uff1f<\/strong><br \/>\u5728\u9c8d\u9c7c\u5e74\u9f84\u9884\u6d4b\u4e2d\uff0c\u5e38\u7528\u7684\u673a\u5668\u5b66\u4e60\u6a21\u578b\u5305\u62ec\u7ebf\u6027\u56de\u5f52\u3001\u968f\u673a\u68ee\u6797\u3001\u652f\u6301\u5411\u91cf\u673a\uff08SVM\uff09\u548c\u795e\u7ecf\u7f51\u7edc\u7b49\u3002\u6bcf\u79cd\u6a21\u578b\u90fd\u6709\u5176\u7279\u70b9\uff0c\u7ebf\u6027\u56de\u5f52\u9002\u5408\u5904\u7406\u7ebf\u6027\u5173\u7cfb\uff0c\u800c\u968f\u673a\u68ee\u6797\u5728\u5904\u7406\u590d\u6742\u6570\u636e\u96c6\u65f6\u8868\u73b0\u826f\u597d\u3002\u9009\u62e9\u5408\u9002\u7684\u6a21\u578b\u9700\u8981\u8003\u8651\u6570\u636e\u7684\u7279\u6027\u548c\u76ee\u6807\u7684\u51c6\u786e\u6027\u3002<\/p>\n<p><strong>\u5982\u4f55\u8bc4\u4f30\u9c8d\u9c7c\u5e74\u9f84\u9884\u6d4b\u6a21\u578b\u7684\u51c6\u786e\u6027\uff1f<\/strong><br \/>\u8bc4\u4f30\u9c8d\u9c7c\u5e74\u9f84\u9884\u6d4b\u6a21\u578b\u7684\u51c6\u786e\u6027\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u6307\u6807\uff0c\u5305\u62ec\u5747\u65b9\u8bef\u5dee\uff08MSE\uff09\u3001\u51b3\u5b9a\u7cfb\u6570\uff08R\u00b2\uff09\u548c\u4ea4\u53c9\u9a8c\u8bc1\u7b49\u3002\u5747\u65b9\u8bef\u5dee\u8861\u91cf\u9884\u6d4b\u503c\u4e0e\u5b9e\u9645\u503c\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c\u800c\u51b3\u5b9a\u7cfb\u6570\u5219\u8868\u793a\u6a21\u578b\u5bf9\u6570\u636e\u53d8\u5f02\u7684\u89e3\u91ca\u7a0b\u5ea6\u3002\u901a\u8fc7\u4ea4\u53c9\u9a8c\u8bc1\uff0c\u53ef\u4ee5\u66f4\u5168\u9762\u5730\u8bc4\u4f30\u6a21\u578b\u5728\u4e0d\u540c\u6570\u636e\u96c6\u4e0a\u7684\u8868\u73b0\uff0c\u4ece\u800c\u63d0\u9ad8\u9884\u6d4b\u7684\u53ef\u9760\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u9884\u6d4b\u9c8d\u9c7c\u5e74\u9f84\u53ef\u4ee5\u901a\u8fc7\u6570\u636e\u9884\u5904\u7406\u3001\u7279\u5f81\u9009\u62e9\u3001\u673a\u5668\u5b66\u4e60\u6a21\u578b\u8bad\u7ec3\u4e0e\u8bc4\u4f30\u7b49\u6b65\u9aa4\u5b9e\u73b0\u3002\u901a\u8fc7\u5206\u6790\u9c8d\u9c7c\u6570\u636e\u96c6\u4e2d\u7684 [&hellip;]","protected":false},"author":3,"featured_media":982194,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/982188"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=982188"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/982188\/revisions"}],"predecessor-version":[{"id":982197,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/982188\/revisions\/982197"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/982194"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=982188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=982188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=982188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}