{"id":1096734,"date":"2025-01-08T15:04:26","date_gmt":"2025-01-08T07:04:26","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1096734.html"},"modified":"2025-01-08T15:04:30","modified_gmt":"2025-01-08T07:04:30","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e7%94%bb%e6%9f%a5%e5%85%a8%e6%9f%a5%e5%87%86%e7%8e%87%e5%9b%be-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1096734.html","title":{"rendered":"\u5982\u4f55\u7528python\u753b\u67e5\u5168\u67e5\u51c6\u7387\u56fe"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24211822\/e56e12ed-0967-4c7d-8635-83cce0d52289.webp\" alt=\"\u5982\u4f55\u7528python\u753b\u67e5\u5168\u67e5\u51c6\u7387\u56fe\" \/><\/p>\n<p><p> <strong>\u5982\u4f55\u7528Python\u753b\u67e5\u5168\u67e5\u51c6\u7387\u56fe<\/strong><\/p>\n<\/p>\n<p><p>\u8981\u7528Python\u753b\u67e5\u5168\u67e5\u51c6\u7387\u56fe\uff0c\u9996\u5148\u9700\u8981\u7406\u89e3\u67e5\u51c6\u7387\uff08Precision\uff09\u548c\u67e5\u5168\u7387\uff08Recall\uff09\u7684\u6982\u5ff5\u3002\u67e5\u51c6\u7387\u662f\u6307\u5728\u6a21\u578b\u9884\u6d4b\u4e3a\u6b63\u7c7b\u7684\u6837\u672c\u4e2d\uff0c\u771f\u6b63\u6b63\u7c7b\u6837\u672c\u7684\u6bd4\u4f8b\uff1b\u67e5\u5168\u7387\u662f\u6307\u5728\u6240\u6709\u771f\u6b63\u6b63\u7c7b\u7684\u6837\u672c\u4e2d\uff0c\u88ab\u6a21\u578b\u6b63\u786e\u9884\u6d4b\u4e3a\u6b63\u7c7b\u7684\u6bd4\u4f8b\u3002<strong>\u7528Python\u753b\u67e5\u5168\u67e5\u51c6\u7387\u56fe\u7684\u6838\u5fc3\u6b65\u9aa4\u5305\u62ec\uff1a\u8ba1\u7b97\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387\u3001\u4f7f\u7528matplotlib\u7ed8\u56fe\u3001\u5bf9\u6570\u636e\u8fdb\u884c\u9002\u5f53\u7684\u5904\u7406\u548c\u53ef\u89c6\u5316<\/strong>\u3002\u5176\u4e2d\uff0c\u8ba1\u7b97\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387\u662f\u6700\u4e3a\u5173\u952e\u7684\u4e00\u6b65\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u8ba1\u7b97\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387<\/h3>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Python\u7ed8\u5236\u67e5\u51c6\u7387-\u67e5\u5168\u7387\uff08Precision-Recall\uff09\u56fe\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u8ba1\u7b97\u51fa\u4e0d\u540c\u9608\u503c\u4e0b\u7684\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u4f1a\u4f7f\u7528sklearn\u5e93\u4e2d\u7684<code>precision_recall_curve<\/code>\u51fd\u6570\u6765\u8fdb\u884c\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.metrics import precision_recall_curve<\/p>\n<h2><strong>\u5047\u8bbey_true\u662f\u771f\u5b9e\u6807\u7b7e\uff0cy_scores\u662f\u6a21\u578b\u7684\u9884\u6d4b\u5f97\u5206<\/strong><\/h2>\n<p>precision, recall, thresholds = precision_recall_curve(y_true, y_scores)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>y_true<\/code>\u8868\u793a\u771f\u5b9e\u7684\u6807\u7b7e\uff0c<code>y_scores<\/code>\u8868\u793a\u6a21\u578b\u7684\u9884\u6d4b\u5f97\u5206\u3002\u51fd\u6570\u8fd4\u56de\u7684<code>precision<\/code>\u548c<code>recall<\/code>\u5206\u522b\u662f\u4e0d\u540c\u9608\u503c\u4e0b\u7684\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387\uff0c<code>thresholds<\/code>\u662f\u5bf9\u5e94\u7684\u9608\u503c\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528Matplotlib\u7ed8\u5236\u67e5\u5168\u67e5\u51c6\u7387\u56fe<\/h3>\n<\/p>\n<p><p>\u8ba1\u7b97\u51fa\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528matplotlib\u5e93\u8fdb\u884c\u7ed8\u56fe\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>plt.figure()<\/p>\n<p>plt.plot(recall, precision, marker=&#39;.&#39;, label=&#39;Precision-Recall curve&#39;)<\/p>\n<p>plt.xlabel(&#39;Recall&#39;)<\/p>\n<p>plt.ylabel(&#39;Precision&#39;)<\/p>\n<p>plt.title(&#39;Precision-Recall Curve&#39;)<\/p>\n<p>plt.legend()<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e0a\u8ff0\u4ee3\u7801\u7ed8\u5236\u4e86\u67e5\u51c6\u7387-\u67e5\u5168\u7387\u66f2\u7ebf\uff0c\u6a2a\u8f74\u4e3a\u67e5\u5168\u7387\uff0c\u7eb5\u8f74\u4e3a\u67e5\u51c6\u7387\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u6570\u636e\u5904\u7406\u4e0e\u53ef\u89c6\u5316<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u8ba9\u67e5\u51c6\u7387-\u67e5\u5168\u7387\u56fe\u66f4\u52a0\u6e05\u6670\u3001\u6613\u8bfb\uff0c\u53ef\u4ee5\u5bf9\u6570\u636e\u8fdb\u884c\u9002\u5f53\u7684\u5904\u7406\u548c\u53ef\u89c6\u5316\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7\u8ba1\u7b97\u5e73\u5747\u67e5\u51c6\u7387\uff08Average Precision\uff0cAP\uff09\u6765\u5bf9\u6a21\u578b\u8fdb\u884c\u8bc4\u4ef7\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.metrics import average_precision_score<\/p>\n<p>average_precision = average_precision_score(y_true, y_scores)<\/p>\n<p>print(&#39;Average precision-recall score: {0:0.2f}&#39;.format(average_precision))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u793a\u4f8b\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u7ed3\u5408\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u5c55\u793a\u5982\u4f55\u7528Python\u753b\u67e5\u5168\u67e5\u51c6\u7387\u56fe\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<p>from sklearn.metrics import precision_recall_curve<\/p>\n<p>from sklearn.metrics import average_precision_score<\/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.datasets import make_classification<\/p>\n<p>from sklearn.linear_model import LogisticRegression<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u4e8c\u5206\u7c7b\u6570\u636e\u96c6<\/strong><\/h2>\n<p>X, y = make_classification(n_samples=1000, n_features=20, n_classes=2, random_state=42)<\/p>\n<h2><strong>\u5212\u5206\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6<\/strong><\/h2>\n<p>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)<\/p>\n<h2><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>model = LogisticRegression()<\/p>\n<p>model.fit(X_train, y_train)<\/p>\n<h2><strong>\u83b7\u53d6\u9884\u6d4b\u5f97\u5206<\/strong><\/h2>\n<p>y_scores = model.predict_proba(X_test)[:, 1]<\/p>\n<h2><strong>\u8ba1\u7b97\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387<\/strong><\/h2>\n<p>precision, recall, thresholds = precision_recall_curve(y_test, y_scores)<\/p>\n<h2><strong>\u8ba1\u7b97\u5e73\u5747\u67e5\u51c6\u7387<\/strong><\/h2>\n<p>average_precision = average_precision_score(y_test, y_scores)<\/p>\n<h2><strong>\u7ed8\u5236\u67e5\u51c6\u7387-\u67e5\u5168\u7387\u66f2\u7ebf<\/strong><\/h2>\n<p>plt.figure()<\/p>\n<p>plt.plot(recall, precision, marker=&#39;.&#39;, label=&#39;Precision-Recall curve (AP = {0:0.2f})&#39;.format(average_precision))<\/p>\n<p>plt.xlabel(&#39;Recall&#39;)<\/p>\n<p>plt.ylabel(&#39;Precision&#39;)<\/p>\n<p>plt.title(&#39;Precision-Recall Curve&#39;)<\/p>\n<p>plt.legend()<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u5b8c\u6574\u7684\u793a\u4f8b\u4ee3\u7801\u5c55\u793a\u4e86\u4ece\u6570\u636e\u96c6\u521b\u5efa\u3001\u6a21\u578b\u8bad\u7ec3\u5230\u67e5\u51c6\u7387-\u67e5\u5168\u7387\u66f2\u7ebf\u7ed8\u5236\u7684\u6574\u4e2a\u6d41\u7a0b\u3002\u901a\u8fc7\u8fd9\u4e2a\u6d41\u7a0b\uff0c\u53ef\u4ee5\u76f4\u89c2\u5730\u770b\u5230\u6a21\u578b\u5728\u4e0d\u540c\u9608\u503c\u4e0b\u7684\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387\u8868\u73b0\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u6df1\u5165\u5206\u6790<\/h3>\n<\/p>\n<p><h4>1\u3001\u6570\u636e\u96c6\u9009\u62e9\u548c\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6570\u636e\u96c6\u7684\u9009\u62e9\u548c\u5904\u7406\u5bf9\u6a21\u578b\u7684\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387\u6709\u5f88\u5927\u7684\u5f71\u54cd\u3002\u5bf9\u4e8e\u4e0d\u5e73\u8861\u6570\u636e\u96c6\uff0c\u53ef\u80fd\u9700\u8981\u8fdb\u884c\u6b20\u91c7\u6837\u3001\u8fc7\u91c7\u6837\u6216\u4f7f\u7528\u5176\u4ed6\u6280\u672f\u6765\u5e73\u8861\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from imblearn.over_sampling import SMOTE<\/p>\n<h2><strong>\u4f7f\u7528SMOTE\u8fdb\u884c\u8fc7\u91c7\u6837<\/strong><\/h2>\n<p>smote = SMOTE(random_state=42)<\/p>\n<p>X_resampled, y_resampled = smote.fit_resample(X_train, y_train)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6a21\u578b\u9009\u62e9\u548c\u8c03\u4f18<\/h4>\n<\/p>\n<p><p>\u4e0d\u540c\u7684\u6a21\u578b\u548c\u8d85\u53c2\u6570\u53ef\u80fd\u5bf9\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387\u6709\u4e0d\u540c\u7684\u5f71\u54cd\u3002\u901a\u8fc7\u4ea4\u53c9\u9a8c\u8bc1\u548c\u7f51\u683c\u641c\u7d22\u53ef\u4ee5\u627e\u5230\u6700\u4f18\u7684\u6a21\u578b\u548c\u53c2\u6570\u7ec4\u5408\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.model_selection import GridSearchCV<\/p>\n<h2><strong>\u5b9a\u4e49\u53c2\u6570\u7f51\u683c<\/strong><\/h2>\n<p>param_grid = {&#39;C&#39;: [0.1, 1, 10, 100]}<\/p>\n<h2><strong>\u4f7f\u7528LogisticRegression\u548cGridSearchCV\u8fdb\u884c\u53c2\u6570\u8c03\u4f18<\/strong><\/h2>\n<p>grid_search = GridSearchCV(LogisticRegression(), param_grid, cv=5)<\/p>\n<p>grid_search.fit(X_resampled, y_resampled)<\/p>\n<h2><strong>\u83b7\u53d6\u6700\u4f18\u6a21\u578b<\/strong><\/h2>\n<p>best_model = grid_search.best_estimator_<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u56fe\u5f62\u4f18\u5316<\/h4>\n<\/p>\n<p><p>\u4e3a\u4e86\u8ba9\u67e5\u51c6\u7387-\u67e5\u5168\u7387\u56fe\u66f4\u52a0\u7f8e\u89c2\uff0c\u53ef\u4ee5\u8fdb\u884c\u4e00\u4e9b\u56fe\u5f62\u4f18\u5316\uff0c\u4f8b\u5982\u6dfb\u52a0\u7f51\u683c\u7ebf\u3001\u8bbe\u7f6e\u56fe\u5f62\u5927\u5c0f\u3001\u8c03\u6574\u5b57\u4f53\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">plt.figure(figsize=(10, 6))<\/p>\n<p>plt.plot(recall, precision, marker=&#39;.&#39;, label=&#39;Precision-Recall curve (AP = {0:0.2f})&#39;.format(average_precision))<\/p>\n<p>plt.xlabel(&#39;Recall&#39;, fontsize=14)<\/p>\n<p>plt.ylabel(&#39;Precision&#39;, fontsize=14)<\/p>\n<p>plt.title(&#39;Precision-Recall Curve&#39;, fontsize=16)<\/p>\n<p>plt.legend(fontsize=12)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u4f18\u5316\uff0c\u53ef\u4ee5\u8ba9\u56fe\u5f62\u66f4\u52a0\u4e13\u4e1a\u548c\u6613\u8bfb\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u4e86\u89e3\u4e86\u5982\u4f55\u7528Python\u753b\u67e5\u5168\u67e5\u51c6\u7387\u56fe\u7684\u6574\u4e2a\u6d41\u7a0b\u3002\u6838\u5fc3\u6b65\u9aa4\u5305\u62ec\u8ba1\u7b97\u67e5\u51c6\u7387\u548c\u67e5\u5168\u7387\u3001\u4f7f\u7528matplotlib\u7ed8\u56fe\u3001\u5bf9\u6570\u636e\u8fdb\u884c\u9002\u5f53\u7684\u5904\u7406\u548c\u53ef\u89c6\u5316\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u8fd8\u9700\u8981\u6839\u636e\u5177\u4f53\u60c5\u51b5\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u96c6\u548c\u6a21\u578b\uff0c\u5e76\u8fdb\u884c\u4f18\u5316\u548c\u8c03\u6574\u3002\u5e0c\u671b\u672c\u6587\u80fd\u4e3a\u60a8\u63d0\u4f9b\u6709\u4ef7\u503c\u7684\u53c2\u8003\uff0c\u5e2e\u52a9\u60a8\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u7ed8\u5236\u51fa\u66f4\u52a0\u4e13\u4e1a\u548c\u7cbe\u786e\u7684\u67e5\u51c6\u7387-\u67e5\u5168\u7387\u56fe\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u7528Python\u7ed8\u5236\u67e5\u5168\u7387\u548c\u67e5\u51c6\u7387\u7684\u56fe\u8868\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528Matplotlib\u548cSeaborn\u7b49\u5e93\u6765\u7ed8\u5236\u67e5\u5168\u7387\uff08Recall\uff09\u548c\u67e5\u51c6\u7387\uff08Precision\uff09\u7684\u56fe\u8868\u3002\u60a8\u9700\u8981\u9996\u5148\u8ba1\u7b97\u8fd9\u4e24\u4e2a\u6307\u6807\u7684\u503c\uff0c\u7136\u540e\u4f7f\u7528\u8fd9\u4e9b\u503c\u6765\u751f\u6210\u56fe\u5f62\u3002\u901a\u5e38\uff0c\u67e5\u5168\u7387\u548c\u67e5\u51c6\u7387\u7684\u503c\u4f1a\u968f\u7740\u9608\u503c\u7684\u53d8\u5316\u800c\u53d8\u5316\uff0c\u56e0\u6b64\u53ef\u4ee5\u901a\u8fc7\u7ed8\u5236\u9608\u503c\u4e0e\u8fd9\u4e24\u4e2a\u6307\u6807\u7684\u5173\u7cfb\u56fe\u6765\u66f4\u76f4\u89c2\u5730\u5c55\u793a\u7ed3\u679c\u3002<\/p>\n<p><strong>\u67e5\u5168\u7387\u548c\u67e5\u51c6\u7387\u7684\u8ba1\u7b97\u65b9\u6cd5\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u67e5\u5168\u7387\uff08Recall\uff09\u662f\u6307\u5728\u6240\u6709\u5b9e\u9645\u4e3a\u6b63\u6837\u672c\u4e2d\uff0c\u88ab\u6b63\u786e\u9884\u6d4b\u4e3a\u6b63\u6837\u672c\u7684\u6bd4\u4f8b\u3002\u67e5\u51c6\u7387\uff08Precision\uff09\u5219\u662f\u6307\u5728\u6240\u6709\u88ab\u9884\u6d4b\u4e3a\u6b63\u6837\u672c\u4e2d\uff0c\u5b9e\u9645\u4e3a\u6b63\u6837\u672c\u7684\u6bd4\u4f8b\u3002\u8fd9\u4e24\u4e2a\u6307\u6807\u53ef\u4ee5\u901a\u8fc7\u6df7\u6dc6\u77e9\u9635\u8ba1\u7b97\u5f97\u5230\uff0c\u5177\u4f53\u516c\u5f0f\u5982\u4e0b\uff1a  <\/p>\n<ul>\n<li>\u67e5\u5168\u7387 = TP \/ (TP + FN)  <\/li>\n<li>\u67e5\u51c6\u7387 = TP \/ (TP + FP)<br \/>\u5176\u4e2d\uff0cTP\u4e3a\u771f\u6b63\u4f8b\uff0cFP\u4e3a\u5047\u6b63\u4f8b\uff0cFN\u4e3a\u5047\u8d1f\u4f8b\u3002<\/li>\n<\/ul>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5904\u7406\u591a\u5206\u7c7b\u95ee\u9898\u7684\u67e5\u5168\u7387\u548c\u67e5\u51c6\u7387\uff1f<\/strong><br \/>\u5904\u7406\u591a\u5206\u7c7b\u95ee\u9898\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b8f\u5e73\u5747\uff08macro average\uff09\u548c\u5fae\u5e73\u5747\uff08micro average\uff09\u6765\u8ba1\u7b97\u6574\u4f53\u7684\u67e5\u5168\u7387\u548c\u67e5\u51c6\u7387\u3002\u5b8f\u5e73\u5747\u662f\u8ba1\u7b97\u6bcf\u4e2a\u7c7b\u522b\u7684\u67e5\u5168\u7387\u548c\u67e5\u51c6\u7387\u7684\u7b80\u5355\u5e73\u5747\uff0c\u800c\u5fae\u5e73\u5747\u5219\u662f\u901a\u8fc7\u5168\u5c40\u7684TP\u3001FP\u548cFN\u6765\u8ba1\u7b97\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7sklearn.metrics\u5e93\u4e2d\u7684precision_score\u548crecall_score\u51fd\u6570\u6765\u5b9e\u73b0\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u5c06\u67e5\u5168\u7387\u548c\u67e5\u51c6\u7387\u7684\u56fe\u8868\u4e0e\u5176\u4ed6\u8bc4\u4f30\u6307\u6807\u4e00\u8d77\u5c55\u793a\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u53ef\u4ee5\u5c06\u67e5\u5168\u7387\u548c\u67e5\u51c6\u7387\u56fe\u8868\u4e0eF1-score\u3001ROC\u66f2\u7ebf\u3001AUC\u7b49\u5176\u4ed6\u8bc4\u4f30\u6307\u6807\u4e00\u8d77\u5c55\u793a\uff0c\u4ee5\u4fbf\u5168\u9762\u8bc4\u4f30\u6a21\u578b\u7684\u6027\u80fd\u3002\u5229\u7528Matplotlib\u6216Seaborn\u53ef\u4ee5\u8f7b\u677e\u5c06\u591a\u4e2a\u6307\u6807\u7684\u66f2\u7ebf\u7ed8\u5236\u5728\u540c\u4e00\u5f20\u56fe\u4e0a\uff0c\u8fd9\u6837\u53ef\u4ee5\u66f4\u597d\u5730\u8fdb\u884c\u6bd4\u8f83\u4e0e\u5206\u6790\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u4f55\u7528Python\u753b\u67e5\u5168\u67e5\u51c6\u7387\u56fe \u8981\u7528Python\u753b\u67e5\u5168\u67e5\u51c6\u7387\u56fe\uff0c\u9996\u5148\u9700\u8981\u7406\u89e3\u67e5\u51c6\u7387\uff08Precision\uff09\u548c\u67e5 [&hellip;]","protected":false},"author":3,"featured_media":1096746,"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\/1096734"}],"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=1096734"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096734\/revisions"}],"predecessor-version":[{"id":1096748,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096734\/revisions\/1096748"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1096746"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1096734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1096734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1096734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}