{"id":1111541,"date":"2025-01-08T17:30:15","date_gmt":"2025-01-08T09:30:15","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1111541.html"},"modified":"2025-01-08T17:30:18","modified_gmt":"2025-01-08T09:30:18","slug":"python%e5%a6%82%e4%bd%95%e7%9f%a5%e9%81%93%e5%88%86%e7%b1%bb%e6%b7%b7%e6%b7%86%e7%9f%a9%e9%98%b5%e5%8f%af%e8%a7%86%e5%8c%96","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1111541.html","title":{"rendered":"python\u5982\u4f55\u77e5\u9053\u5206\u7c7b\u6df7\u6dc6\u77e9\u9635\u53ef\u89c6\u5316"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25073941\/d30bd8f2-0cf3-4d08-9171-5c46de0dac9d.webp\" alt=\"python\u5982\u4f55\u77e5\u9053\u5206\u7c7b\u6df7\u6dc6\u77e9\u9635\u53ef\u89c6\u5316\" \/><\/p>\n<p><p> \u5728Python\u4e2d\uff0c\u5206\u7c7b\u6df7\u6dc6\u77e9\u9635\u7684\u53ef\u89c6\u5316\u662f\u4e00\u79cd\u7528\u4e8e\u8bc4\u4f30\u5206\u7c7b\u6a21\u578b\u6027\u80fd\u7684\u5e38\u7528\u65b9\u6cd5\u3002<strong>\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528<code>scikit-learn<\/code>\u5e93\u751f\u6210\u6df7\u6dc6\u77e9\u9635\u3001\u4f7f\u7528<code>matplotlib<\/code>\u6216<code>seaborn<\/code>\u5e93\u8fdb\u884c\u53ef\u89c6\u5316\u3001\u7ed3\u5408\u70ed\u56fe\u5c55\u793a\u77e9\u9635\u6570\u636e<\/strong>\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u79cd\u5b9e\u73b0\u6df7\u6dc6\u77e9\u9635\u53ef\u89c6\u5316\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u751f\u6210\u6df7\u6dc6\u77e9\u9635<\/h3>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u53ef\u89c6\u5316\u4e4b\u524d\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u751f\u6210\u6df7\u6dc6\u77e9\u9635\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>scikit-learn<\/code>\u5e93\u4e2d\u7684<code>confusion_matrix<\/code>\u51fd\u6570\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u4ee5\u4e0b\u662f\u751f\u6210\u6df7\u6dc6\u77e9\u9635\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.metrics import confusion_matrix<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u793a\u4f8b\u771f\u5b9e\u6807\u7b7e\u548c\u9884\u6d4b\u6807\u7b7e<\/strong><\/h2>\n<p>y_true = np.array([0, 1, 0, 1, 0, 1, 0, 1])<\/p>\n<p>y_pred = np.array([0, 0, 0, 1, 0, 1, 1, 1])<\/p>\n<h2><strong>\u751f\u6210\u6df7\u6dc6\u77e9\u9635<\/strong><\/h2>\n<p>cm = confusion_matrix(y_true, y_pred)<\/p>\n<p>print(cm)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528Matplotlib\u53ef\u89c6\u5316\u6df7\u6dc6\u77e9\u9635<\/h3>\n<\/p>\n<p><p><code>Matplotlib<\/code>\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7ed8\u56fe\u5e93\uff0c\u53ef\u4ee5\u7528\u4e8e\u751f\u6210\u6df7\u6dc6\u77e9\u9635\u7684\u53ef\u89c6\u5316\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528<code>Matplotlib<\/code>\u8fdb\u884c\u6df7\u6dc6\u77e9\u9635\u53ef\u89c6\u5316\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>def plot_confusion_matrix(cm, classes,<\/p>\n<p>                          normalize=False,<\/p>\n<p>                          title=&#39;Confusion matrix&#39;,<\/p>\n<p>                          cmap=plt.cm.Blues):<\/p>\n<p>    &quot;&quot;&quot;<\/p>\n<p>    \u751f\u6210\u6df7\u6dc6\u77e9\u9635\u7684\u53ef\u89c6\u5316\u56fe<\/p>\n<p>    &quot;&quot;&quot;<\/p>\n<p>    if normalize:<\/p>\n<p>        cm = cm.astype(&#39;float&#39;) \/ cm.sum(axis=1)[:, np.newaxis]<\/p>\n<p>        print(&quot;Normalized confusion matrix&quot;)<\/p>\n<p>    else:<\/p>\n<p>        print(&#39;Confusion matrix, without normalization&#39;)<\/p>\n<p>    print(cm)<\/p>\n<p>    plt.imshow(cm, interpolation=&#39;nearest&#39;, cmap=cmap)<\/p>\n<p>    plt.title(title)<\/p>\n<p>    plt.colorbar()<\/p>\n<p>    tick_marks = np.arange(len(classes))<\/p>\n<p>    plt.xticks(tick_marks, classes, rotation=45)<\/p>\n<p>    plt.yticks(tick_marks, classes)<\/p>\n<p>    fmt = &#39;.2f&#39; if normalize else &#39;d&#39;<\/p>\n<p>    thresh = cm.max() \/ 2.<\/p>\n<p>    for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):<\/p>\n<p>        plt.text(j, i, format(cm[i, j], fmt),<\/p>\n<p>                 horizontalalignment=&quot;center&quot;,<\/p>\n<p>                 color=&quot;white&quot; if cm[i, j] &gt; thresh else &quot;black&quot;)<\/p>\n<p>    plt.ylabel(&#39;True label&#39;)<\/p>\n<p>    plt.xlabel(&#39;Predicted label&#39;)<\/p>\n<p>    plt.tight_layout()<\/p>\n<h2><strong>\u793a\u4f8b\u7c7b\u522b\u6807\u7b7e<\/strong><\/h2>\n<p>class_names = [&#39;Class 0&#39;, &#39;Class 1&#39;]<\/p>\n<h2><strong>\u751f\u6210\u5e76\u5c55\u793a\u6df7\u6dc6\u77e9\u9635\u56fe<\/strong><\/h2>\n<p>plt.figure()<\/p>\n<p>plot_confusion_matrix(cm, classes=class_names, title=&#39;Confusion matrix, without normalization&#39;)<\/p>\n<h2><strong>\u751f\u6210\u5e76\u5c55\u793a\u5f52\u4e00\u5316\u540e\u7684\u6df7\u6dc6\u77e9\u9635\u56fe<\/strong><\/h2>\n<p>plt.figure()<\/p>\n<p>plot_confusion_matrix(cm, classes=class_names, normalize=True, title=&#39;Normalized confusion matrix&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528Seaborn\u53ef\u89c6\u5316\u6df7\u6dc6\u77e9\u9635<\/h3>\n<\/p>\n<p><p><code>Seaborn<\/code>\u5e93\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7b80\u6d01\u7684\u65b9\u6cd5\u6765\u751f\u6210\u6df7\u6dc6\u77e9\u9635\u7684\u70ed\u56fe\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528<code>Seaborn<\/code>\u8fdb\u884c\u6df7\u6dc6\u77e9\u9635\u53ef\u89c6\u5316\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import seaborn as sns<\/p>\n<p>def plot_confusion_matrix_seaborn(cm, classes):<\/p>\n<p>    &quot;&quot;&quot;<\/p>\n<p>    \u4f7f\u7528Seaborn\u751f\u6210\u6df7\u6dc6\u77e9\u9635\u7684\u53ef\u89c6\u5316\u56fe<\/p>\n<p>    &quot;&quot;&quot;<\/p>\n<p>    plt.figure(figsize=(10,7))<\/p>\n<p>    sns.heatmap(cm, annot=True, fmt=&quot;d&quot;, cmap=&quot;Blues&quot;, xticklabels=classes, yticklabels=classes)<\/p>\n<p>    plt.ylabel(&#39;True label&#39;)<\/p>\n<p>    plt.xlabel(&#39;Predicted label&#39;)<\/p>\n<p>    plt.title(&#39;Confusion Matrix&#39;)<\/p>\n<p>    plt.show()<\/p>\n<h2><strong>\u751f\u6210\u5e76\u5c55\u793a\u6df7\u6dc6\u77e9\u9635\u7684\u70ed\u56fe<\/strong><\/h2>\n<p>plot_confusion_matrix_seaborn(cm, class_names)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u6df7\u6dc6\u77e9\u9635\u7684\u89e3\u8bfb<\/h3>\n<\/p>\n<p><p>\u6df7\u6dc6\u77e9\u9635\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u7406\u89e3\u6a21\u578b\u7684\u6027\u80fd\u3002<strong>\u56db\u4e2a\u4e3b\u8981\u6307\u6807\u5206\u522b\u662f\uff1a\u771f\u6b63\u7c7b\uff08TP\uff09\u3001\u5047\u6b63\u7c7b\uff08FP\uff09\u3001\u5047\u8d1f\u7c7b\uff08FN\uff09\u3001\u771f\u6b63\u8d1f\u7c7b\uff08TN\uff09<\/strong>\u3002\u901a\u8fc7\u8fd9\u56db\u4e2a\u6307\u6807\uff0c\u6211\u4eec\u53ef\u4ee5\u8ba1\u7b97\u51fa\u8bb8\u591a\u5173\u952e\u7684\u6027\u80fd\u6307\u6807\uff0c\u5982\u51c6\u786e\u7387\u3001\u7cbe\u786e\u7387\u3001\u53ec\u56de\u7387\u548cF1\u5206\u6570\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u51c6\u786e\u7387\uff08Accuracy\uff09<\/strong>\uff1a\u8868\u793a\u6240\u6709\u9884\u6d4b\u6b63\u786e\u7684\u6837\u672c\u5360\u603b\u6837\u672c\u7684\u6bd4\u4f8b\u3002\u8ba1\u7b97\u516c\u5f0f\u4e3a\uff1a<\/p>\n<p>[<\/p>\n<p>\\text{Accuracy} = \\frac{TP + TN}{TP + TN + FP + FN}<\/p>\n<p>]<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7cbe\u786e\u7387\uff08Precision\uff09<\/strong>\uff1a\u8868\u793a\u6a21\u578b\u9884\u6d4b\u4e3a\u6b63\u7c7b\u7684\u6837\u672c\u4e2d\u5b9e\u9645\u4e3a\u6b63\u7c7b\u7684\u6bd4\u4f8b\u3002\u8ba1\u7b97\u516c\u5f0f\u4e3a\uff1a<\/p>\n<p>[<\/p>\n<p>\\text{Precision} = \\frac{TP}{TP + FP}<\/p>\n<p>]<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u53ec\u56de\u7387\uff08Recall\uff09<\/strong>\uff1a\u8868\u793a\u5b9e\u9645\u4e3a\u6b63\u7c7b\u7684\u6837\u672c\u4e2d\u88ab\u6b63\u786e\u9884\u6d4b\u4e3a\u6b63\u7c7b\u7684\u6bd4\u4f8b\u3002\u8ba1\u7b97\u516c\u5f0f\u4e3a\uff1a<\/p>\n<p>[<\/p>\n<p>\\text{Recall} = \\frac{TP}{TP + FN}<\/p>\n<p>]<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>F1\u5206\u6570\uff08F1 Score\uff09<\/strong>\uff1a\u7cbe\u786e\u7387\u548c\u53ec\u56de\u7387\u7684\u8c03\u548c\u5e73\u5747\u6570\uff0c\u7528\u4e8e\u5e73\u8861\u4e24\u8005\u7684\u5f71\u54cd\u3002\u8ba1\u7b97\u516c\u5f0f\u4e3a\uff1a<\/p>\n<p>[<\/p>\n<p>\\text{F1 Score} = 2 \\cdot \\frac{\\text{Precision} \\cdot \\text{Recall}}{\\text{Precision} + \\text{Recall}}<\/p>\n<p>]<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u6307\u6807\uff0c\u6211\u4eec\u53ef\u4ee5\u5168\u9762\u8bc4\u4f30\u5206\u7c7b\u6a21\u578b\u7684\u6027\u80fd\uff0c\u4ece\u800c\u8fdb\u884c\u6a21\u578b\u4f18\u5316\u548c\u6539\u8fdb\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u5b9e\u8df5\u4e2d\u7684\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6570\u636e\u4e0d\u5e73\u8861\u95ee\u9898<\/strong>\uff1a\u5f53\u6570\u636e\u96c6\u4e2d\u7684\u7c7b\u522b\u5206\u5e03\u4e0d\u5e73\u8861\u65f6\uff0c\u51c6\u786e\u7387\u53ef\u80fd\u4f1a\u5bfc\u81f4\u8bef\u5bfc\u3002\u56e0\u6b64\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u66f4\u5e94\u8be5\u5173\u6ce8\u7cbe\u786e\u7387\u3001\u53ec\u56de\u7387\u548cF1\u5206\u6570\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5f52\u4e00\u5316\u7684\u5fc5\u8981\u6027<\/strong>\uff1a\u5bf9\u4e8e\u7c7b\u522b\u6570\u8f83\u591a\u7684\u60c5\u51b5\uff0c\u5f52\u4e00\u5316\u6df7\u6dc6\u77e9\u9635\u6709\u52a9\u4e8e\u66f4\u6e05\u6670\u5730\u5c55\u793a\u5404\u7c7b\u522b\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ea4\u53c9\u9a8c\u8bc1<\/strong>\uff1a\u4e3a\u4e86\u83b7\u5f97\u66f4\u52a0\u7a33\u5b9a\u548c\u53ef\u9760\u7684\u8bc4\u4f30\u7ed3\u679c\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ea4\u53c9\u9a8c\u8bc1\u6765\u751f\u6210\u6df7\u6dc6\u77e9\u9635\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u53ef\u89c6\u5316\u7ec6\u8282<\/strong>\uff1a\u5728\u6df7\u6dc6\u77e9\u9635\u53ef\u89c6\u5316\u8fc7\u7a0b\u4e2d\uff0c\u5c3d\u91cf\u4f7f\u7528\u989c\u8272\u533a\u5206\u4e0d\u540c\u7684\u6570\u503c\u8303\u56f4\uff0c\u5e76\u6dfb\u52a0\u6570\u503c\u6807\u6ce8\u4ee5\u4fbf\u4e8e\u8bfb\u53d6\u548c\u7406\u89e3\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\u548c\u6ce8\u610f\u4e8b\u9879\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u4e2d\u751f\u6210\u5e76\u53ef\u89c6\u5316\u5206\u7c7b\u6df7\u6dc6\u77e9\u9635\uff0c\u4ece\u800c\u66f4\u597d\u5730\u8bc4\u4f30\u548c\u6539\u8fdb\u5206\u7c7b\u6a21\u578b\u7684\u6027\u80fd\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u751f\u6210\u5206\u7c7b\u6df7\u6dc6\u77e9\u9635\u7684\u53ef\u89c6\u5316\u6548\u679c\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u751f\u6210\u5206\u7c7b\u6df7\u6dc6\u77e9\u9635\u7684\u53ef\u89c6\u5316\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Scikit-learn\u5e93\u6765\u8ba1\u7b97\u6df7\u6dc6\u77e9\u9635\uff0c\u5e76\u7ed3\u5408Matplotlib\u6216Seaborn\u5e93\u8fdb\u884c\u7ed8\u56fe\u3002\u9996\u5148\uff0c\u786e\u4fdd\u5b89\u88c5\u4e86\u8fd9\u4e9b\u5e93\u3002\u63a5\u7740\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>confusion_matrix<\/code>\u51fd\u6570\u8ba1\u7b97\u6df7\u6dc6\u77e9\u9635\uff0c\u4f7f\u7528<code>heatmap<\/code>\u51fd\u6570\u6765\u8fdb\u884c\u53ef\u89c6\u5316\u3002\u4ee3\u7801\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">from sklearn.metrics import confusion_matrix\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n# \u5047\u8bbey_true\u662f\u5b9e\u9645\u6807\u7b7e\uff0cy_pred\u662f\u9884\u6d4b\u6807\u7b7e\ncm = confusion_matrix(y_true, y_pred)\n\nplt.figure(figsize=(10,7))\nsns.heatmap(cm, annot=True, fmt=&#39;d&#39;, cmap=&#39;Blues&#39;, xticklabels=class_names, yticklabels=class_names)\nplt.ylabel(&#39;\u771f\u5b9e\u6807\u7b7e&#39;)\nplt.xlabel(&#39;\u9884\u6d4b\u6807\u7b7e&#39;)\nplt.title(&#39;\u5206\u7c7b\u6df7\u6dc6\u77e9\u9635&#39;)\nplt.show()\n<\/code><\/pre>\n<p><strong>\u6df7\u6dc6\u77e9\u9635\u4e2d\u7684\u5404\u4e2a\u5143\u7d20\u4ee3\u8868\u4ec0\u4e48\uff1f<\/strong><br \/>\u6df7\u6dc6\u77e9\u9635\u7684\u56db\u4e2a\u4e3b\u8981\u5143\u7d20\u5206\u522b\u662f\uff1a\u771f\u6b63\u4f8b\uff08TP\uff09\u3001\u5047\u6b63\u4f8b\uff08FP\uff09\u3001\u771f\u53cd\u4f8b\uff08TN\uff09\u548c\u5047\u53cd\u4f8b\uff08FN\uff09\u3002\u771f\u6b63\u4f8b\u662f\u88ab\u6b63\u786e\u5206\u7c7b\u4e3a\u6b63\u7c7b\u7684\u6837\u672c\u6570\uff0c\u5047\u6b63\u4f8b\u662f\u88ab\u9519\u8bef\u5206\u7c7b\u4e3a\u6b63\u7c7b\u7684\u8d1f\u6837\u672c\u6570\uff0c\u771f\u53cd\u4f8b\u662f\u88ab\u6b63\u786e\u5206\u7c7b\u4e3a\u8d1f\u7c7b\u7684\u6837\u672c\u6570\uff0c\u5047\u53cd\u4f8b\u662f\u88ab\u9519\u8bef\u5206\u7c7b\u4e3a\u8d1f\u7c7b\u7684\u6b63\u6837\u672c\u6570\u3002\u901a\u8fc7\u8fd9\u4e9b\u5143\u7d20\uff0c\u60a8\u53ef\u4ee5\u8ba1\u7b97\u51fa\u51c6\u786e\u7387\u3001\u53ec\u56de\u7387\u548cF1\u5206\u6570\u7b49\u6027\u80fd\u6307\u6807\u3002<\/p>\n<p><strong>\u5728\u6df7\u6dc6\u77e9\u9635\u53ef\u89c6\u5316\u4e2d\uff0c\u5982\u4f55\u63d0\u9ad8\u53ef\u8bfb\u6027\uff1f<\/strong><br \/>\u4e3a\u4e86\u63d0\u9ad8\u6df7\u6dc6\u77e9\u9635\u7684\u53ef\u8bfb\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u989c\u8272\u6620\u5c04\uff08\u5982<code>cmap=&#39;Blues&#39;<\/code>\u6216<code>cmap=&#39;viridis&#39;<\/code>\uff09\uff0c\u5e76\u5728\u70ed\u56fe\u4e2d\u6dfb\u52a0\u6807\u7b7e\uff0c\u4ee5\u4fbf\u80fd\u6e05\u6670\u5730\u770b\u5230\u6bcf\u4e2a\u7c7b\u7684\u6570\u91cf\u3002\u6b64\u5916\uff0c\u8c03\u6574\u56fe\u5f62\u7684\u5927\u5c0f\u548c\u5b57\u4f53\u5927\u5c0f\u4e5f\u80fd\u63d0\u5347\u53ef\u89c6\u5316\u6548\u679c\u3002\u60a8\u8fd8\u53ef\u4ee5\u5728\u56fe\u4e2d\u6807\u6ce8\u51c6\u786e\u7387\u6216\u5176\u4ed6\u76f8\u5173\u4fe1\u606f\uff0c\u4ee5\u4fbf\u5feb\u901f\u8bc4\u4f30\u6a21\u578b\u7684\u6027\u80fd\u3002<\/p>\n<p><strong>\u5982\u4f55\u4ece\u6df7\u6dc6\u77e9\u9635\u4e2d\u5206\u6790\u6a21\u578b\u7684\u6027\u80fd\uff1f<\/strong><br \/>\u901a\u8fc7\u5206\u6790\u6df7\u6dc6\u77e9\u9635\uff0c\u60a8\u53ef\u4ee5\u76f4\u89c2\u4e86\u89e3\u6a21\u578b\u5728\u54ea\u4e9b\u7c7b\u522b\u4e0a\u8868\u73b0\u826f\u597d\uff0c\u54ea\u4e9b\u7c7b\u522b\u4e0a\u5b58\u5728\u95ee\u9898\u3002\u4f8b\u5982\uff0c\u5047\u6b63\u4f8b\u548c\u5047\u53cd\u4f8b\u7684\u6570\u91cf\u53ef\u4ee5\u5e2e\u52a9\u8bc6\u522b\u6a21\u578b\u7684\u504f\u5dee\uff0c\u8fdb\u800c\u5e2e\u52a9\u60a8\u4f18\u5316\u6a21\u578b\u7684\u8bad\u7ec3\u6570\u636e\u548c\u7b97\u6cd5\u9009\u62e9\u3002\u6b64\u5916\uff0c\u8ba1\u7b97\u6bcf\u4e2a\u7c7b\u522b\u7684\u51c6\u786e\u7387\u548c\u53ec\u56de\u7387\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u8bc4\u4f30\u6a21\u578b\u5728\u7279\u5b9a\u4efb\u52a1\u4e2d\u7684\u5b9e\u9645\u5e94\u7528\u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u5206\u7c7b\u6df7\u6dc6\u77e9\u9635\u7684\u53ef\u89c6\u5316\u662f\u4e00\u79cd\u7528\u4e8e\u8bc4\u4f30\u5206\u7c7b\u6a21\u578b\u6027\u80fd\u7684\u5e38\u7528\u65b9\u6cd5\u3002\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528scikit-l [&hellip;]","protected":false},"author":3,"featured_media":1111549,"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\/1111541"}],"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=1111541"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1111541\/revisions"}],"predecessor-version":[{"id":1111551,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1111541\/revisions\/1111551"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1111549"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1111541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1111541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1111541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}