{"id":956302,"date":"2024-12-27T02:32:24","date_gmt":"2024-12-26T18:32:24","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/956302.html"},"modified":"2024-12-27T02:32:26","modified_gmt":"2024-12-26T18:32:26","slug":"%e5%a6%82%e4%bd%95%e5%88%a9%e7%94%a8python%e8%bf%9b%e8%a1%8c%e5%88%86%e7%b1%bb","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/956302.html","title":{"rendered":"\u5982\u4f55\u5229\u7528python\u8fdb\u884c\u5206\u7c7b"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25095951\/f5d551e9-2135-4f73-9e97-b03a569e49c2.webp\" alt=\"\u5982\u4f55\u5229\u7528python\u8fdb\u884c\u5206\u7c7b\" \/><\/p>\n<p><p> <strong>\u5229\u7528Python\u8fdb\u884c\u5206\u7c7b\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u4f7f\u7528<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u5e93\u5982Scikit-learn\u3001TensorFlow\u6216Keras\u7b49\u3001\u5e94\u7528\u76d1\u7763\u5b66\u4e60\u7b97\u6cd5\uff08\u5982\u51b3\u7b56\u6811\u3001\u652f\u6301\u5411\u91cf\u673a\u3001\u968f\u673a\u68ee\u6797\u7b49\uff09\u3001\u8fdb\u884c\u6570\u636e\u9884\u5904\u7406\u4e0e\u7279\u5f81\u63d0\u53d6\u3002<\/strong>\u5176\u4e2d\uff0c\u4f7f\u7528Scikit-learn\u5e93\u662f\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u4e4b\u4e00\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684\u673a\u5668\u5b66\u4e60\u5de5\u5177\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u6570\u636e\u9884\u5904\u7406\u3001\u6a21\u578b\u8bad\u7ec3\u548c\u8bc4\u4f30\u3002\u901a\u8fc7\u9009\u62e9\u5408\u9002\u7684\u7b97\u6cd5\u548c\u5bf9\u6570\u636e\u8fdb\u884c\u7279\u5f81\u5de5\u7a0b\uff0c\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u5206\u7c7b\u6a21\u578b\u7684\u51c6\u786e\u6027\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5229\u7528Python\u8fdb\u884c\u5206\u7c7b\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u6570\u636e\u9884\u5904\u7406\u4e0e\u7279\u5f81\u5de5\u7a0b<\/p>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u5206\u7c7b\u4e4b\u524d\uff0c\u6570\u636e\u9884\u5904\u7406\u662f\u4e00\u4e2a\u5173\u952e\u6b65\u9aa4\u3002\u6570\u636e\u9884\u5904\u7406\u5305\u62ec\u6570\u636e\u6e05\u6d17\u3001\u7279\u5f81\u63d0\u53d6\u3001\u7279\u5f81\u9009\u62e9\u548c\u6570\u636e\u6807\u51c6\u5316\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u6570\u636e\u6e05\u6d17<\/strong><\/li>\n<\/ol>\n<p><p>\u6570\u636e\u6e05\u6d17\u662f\u6307\u5904\u7406\u7f3a\u5931\u503c\u3001\u5f02\u5e38\u503c\u548c\u91cd\u590d\u6570\u636e\u7b49\u95ee\u9898\u3002\u5bf9\u4e8e\u7f3a\u5931\u503c\uff0c\u53ef\u4ee5\u91c7\u7528\u5220\u9664\u3001\u5747\u503c\u586b\u8865\u6216\u63d2\u503c\u7b49\u65b9\u6cd5\u8fdb\u884c\u5904\u7406\u3002\u5bf9\u4e8e\u5f02\u5e38\u503c\uff0c\u53ef\u4ee5\u91c7\u7528\u7bb1\u7ebf\u56fe\u3001z-score\u7b49\u65b9\u6cd5\u8fdb\u884c\u68c0\u6d4b\u548c\u5904\u7406\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u7279\u5f81\u63d0\u53d6\u4e0e\u9009\u62e9<\/strong><\/li>\n<\/ol>\n<p><p>\u7279\u5f81\u63d0\u53d6\u662f\u4ece\u539f\u59cb\u6570\u636e\u4e2d\u63d0\u53d6\u51fa\u66f4\u6709\u610f\u4e49\u7684\u7279\u5f81\u3002\u7279\u5f81\u9009\u62e9\u662f\u6307\u4ece\u5df2\u6709\u7279\u5f81\u4e2d\u9009\u62e9\u51fa\u5bf9\u6a21\u578b\u8bad\u7ec3\u6700\u6709\u5e2e\u52a9\u7684\u4e00\u90e8\u5206\u7279\u5f81\u3002Scikit-learn\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u8fdb\u884c\u7279\u5f81\u9009\u62e9\uff0c\u5982\u9012\u5f52\u7279\u5f81\u6d88\u9664\uff08RFE\uff09\u548c\u57fa\u4e8e\u6811\u6a21\u578b\u7684\u91cd\u8981\u6027\u6392\u5e8f\u7b49\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u6570\u636e\u6807\u51c6\u5316<\/strong><\/li>\n<\/ol>\n<p><p>\u6570\u636e\u6807\u51c6\u5316\u662f\u6307\u5c06\u7279\u5f81\u503c\u7f29\u653e\u5230\u4e00\u4e2a\u76f8\u540c\u7684\u5c3a\u5ea6\uff0c\u4f7f\u5f97\u6bcf\u4e2a\u7279\u5f81\u5bf9\u6a21\u578b\u8bad\u7ec3\u7684\u8d21\u732e\u76f8\u7b49\u3002\u5e38\u7528\u7684\u65b9\u6cd5\u6709\u6807\u51c6\u5316\u548c\u5f52\u4e00\u5316\u3002\u6807\u51c6\u5316\u662f\u6307\u5c06\u7279\u5f81\u503c\u8f6c\u6362\u4e3a\u5747\u503c\u4e3a0\uff0c\u65b9\u5dee\u4e3a1\u7684\u6b63\u6001\u5206\u5e03\uff1b\u5f52\u4e00\u5316\u662f\u5c06\u7279\u5f81\u503c\u7f29\u653e\u5230[0,1]\u533a\u95f4\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u9009\u62e9\u5408\u9002\u7684\u5206\u7c7b\u7b97\u6cd5<\/p>\n<\/p>\n<p><p>\u5728\u6570\u636e\u9884\u5904\u7406\u5b8c\u6210\u540e\uff0c\u9009\u62e9\u5408\u9002\u7684\u5206\u7c7b\u7b97\u6cd5\u662f\u81f3\u5173\u91cd\u8981\u7684\u3002\u4e0d\u540c\u7684\u7b97\u6cd5\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u6570\u636e\u96c6\u548c\u95ee\u9898\u7c7b\u578b\u3002\u5e38\u7528\u7684\u5206\u7c7b\u7b97\u6cd5\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u51b3\u7b56\u6811<\/strong><\/li>\n<\/ol>\n<p><p>\u51b3\u7b56\u6811\u662f\u4e00\u79cd\u6811\u5f62\u7ed3\u6784\u7684\u6a21\u578b\uff0c\u5b83\u901a\u8fc7\u5bf9\u7279\u5f81\u8fdb\u884c\u5206\u88c2\u6765\u8fdb\u884c\u5206\u7c7b\u3002\u51b3\u7b56\u6811\u6a21\u578b\u7b80\u5355\u6613\u61c2\uff0c\u80fd\u591f\u5904\u7406\u975e\u7ebf\u6027\u6570\u636e\uff0c\u4f46\u5bb9\u6613\u8fc7\u62df\u5408\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u652f\u6301\u5411\u91cf\u673a\uff08SVM\uff09<\/strong><\/li>\n<\/ol>\n<p><p>\u652f\u6301\u5411\u91cf\u673a\u901a\u8fc7\u5bfb\u627e\u6700\u4f18\u7684\u8d85\u5e73\u9762\u6765\u5c06\u4e0d\u540c\u7c7b\u522b\u7684\u6570\u636e\u5206\u5f00\u3002SVM\u9002\u7528\u4e8e\u7ebf\u6027\u548c\u975e\u7ebf\u6027\u6570\u636e\uff0c\u4e14\u5bf9\u9ad8\u7ef4\u6570\u636e\u6709\u5f88\u597d\u7684\u8868\u73b0\uff0c\u4f46\u8bad\u7ec3\u65f6\u95f4\u8f83\u957f\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u968f\u673a\u68ee\u6797<\/strong><\/li>\n<\/ol>\n<p><p>\u968f\u673a\u68ee\u6797\u662f\u7531\u591a\u68f5\u51b3\u7b56\u6811\u7ec4\u6210\u7684\u96c6\u6210\u5b66\u4e60\u65b9\u6cd5\uff0c\u80fd\u591f\u6709\u6548\u5730\u51cf\u5c11\u8fc7\u62df\u5408\u95ee\u9898\u3002\u968f\u673a\u68ee\u6797\u5728\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u548c\u9ad8\u7ef4\u6570\u636e\u65f6\u8868\u73b0\u826f\u597d\u3002<\/p>\n<\/p>\n<ol start=\"4\">\n<li><strong>K\u6700\u8fd1\u90bb\uff08KNN\uff09<\/strong><\/li>\n<\/ol>\n<p><p>KNN\u662f\u4e00\u79cd\u57fa\u4e8e\u5b9e\u4f8b\u7684\u5b66\u4e60\u65b9\u6cd5\uff0c\u901a\u8fc7\u6d4b\u91cf\u6837\u672c\u4e4b\u95f4\u7684\u8ddd\u79bb\u6765\u8fdb\u884c\u5206\u7c7b\u3002KNN\u7b97\u6cd5\u7b80\u5355\uff0c\u4f46\u5728\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u65f6\u8ba1\u7b97\u91cf\u8f83\u5927\u3002<\/p>\n<\/p>\n<ol start=\"5\">\n<li><strong>\u795e\u7ecf\u7f51\u7edc<\/strong><\/li>\n<\/ol>\n<p><p>\u795e\u7ecf\u7f51\u7edc\u662f\u4e00\u79cd\u6a21\u62df\u4eba\u8111\u795e\u7ecf\u5143\u8fde\u63a5\u7684\u6a21\u578b\uff0c\u9002\u7528\u4e8e\u590d\u6742\u7684\u975e\u7ebf\u6027\u6570\u636e\u3002\u4f7f\u7528TensorFlow\u6216Keras\u53ef\u4ee5\u65b9\u4fbf\u5730\u6784\u5efa\u548c\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u6a21\u578b\u8bad\u7ec3\u4e0e\u8bc4\u4f30<\/p>\n<\/p>\n<p><p>\u5728\u9009\u62e9\u597d\u5206\u7c7b\u7b97\u6cd5\u540e\uff0c\u4e0b\u4e00\u6b65\u662f\u8bad\u7ec3\u6a21\u578b\u5e76\u5bf9\u6a21\u578b\u8fdb\u884c\u8bc4\u4f30\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528Scikit-learn\u53ef\u4ee5\u65b9\u4fbf\u5730\u8bad\u7ec3\u6a21\u578b\u3002\u9996\u5148\uff0c\u5206\u5272\u6570\u636e\u96c6\u4e3a\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u3002\u7136\u540e\uff0c\u5229\u7528\u8bad\u7ec3\u96c6\u8bad\u7ec3\u6a21\u578b\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u968f\u673a\u68ee\u6797\u7b97\u6cd5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">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.ensemble import RandomForestClassifier<\/p>\n<p>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<\/p>\n<p>clf = RandomForestClassifier(n_estimators=100, random_state=42)<\/p>\n<p>clf.fit(X_train, y_train)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u8bc4\u4f30\u6a21\u578b<\/strong><\/li>\n<\/ol>\n<p><p>\u8bc4\u4f30\u6a21\u578b\u7684\u597d\u574f\u9700\u8981\u4f7f\u7528\u6d4b\u8bd5\u96c6\u3002\u5e38\u7528\u7684\u8bc4\u4f30\u6307\u6807\u5305\u62ec\u51c6\u786e\u7387\u3001\u7cbe\u786e\u7387\u3001\u53ec\u56de\u7387\u548cF1-score\u7b49\u3002\u4f7f\u7528Scikit-learn\u53ef\u4ee5\u65b9\u4fbf\u5730\u8ba1\u7b97\u8fd9\u4e9b\u6307\u6807\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score<\/p>\n<p>y_pred = clf.predict(X_test)<\/p>\n<p>accuracy = accuracy_score(y_test, y_pred)<\/p>\n<p>precision = precision_score(y_test, y_pred, average=&#39;weighted&#39;)<\/p>\n<p>recall = recall_score(y_test, y_pred, average=&#39;weighted&#39;)<\/p>\n<p>f1 = f1_score(y_test, y_pred, average=&#39;weighted&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u4ea4\u53c9\u9a8c\u8bc1<\/strong><\/li>\n<\/ol>\n<p><p>\u4ea4\u53c9\u9a8c\u8bc1\u662f\u4e00\u79cd\u8bc4\u4f30\u6a21\u578b\u6cdb\u5316\u80fd\u529b\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u901a\u8fc7K\u6298\u4ea4\u53c9\u9a8c\u8bc1\u83b7\u53d6\u66f4\u7a33\u5b9a\u7684\u8bc4\u4f30\u7ed3\u679c\u3002\u4f7f\u7528Scikit-learn\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u4ea4\u53c9\u9a8c\u8bc1\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.model_selection import cross_val_score<\/p>\n<p>scores = cross_val_score(clf, X, y, cv=5, scoring=&#39;accuracy&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u6a21\u578b\u4f18\u5316\u4e0e\u8c03\u53c2<\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u63d0\u9ad8\u6a21\u578b\u7684\u6027\u80fd\uff0c\u9700\u8981\u5bf9\u6a21\u578b\u8fdb\u884c\u4f18\u5316\u548c\u8c03\u53c2\u3002\u8c03\u53c2\u662f\u6307\u8c03\u6574\u7b97\u6cd5\u7684\u8d85\u53c2\u6570\uff0c\u4ee5\u83b7\u53d6\u66f4\u597d\u7684\u6a21\u578b\u6027\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u7f51\u683c\u641c\u7d22<\/strong><\/li>\n<\/ol>\n<p><p>\u7f51\u683c\u641c\u7d22\u662f\u4e00\u79cd\u5e38\u7528\u7684\u8c03\u53c2\u65b9\u6cd5\uff0c\u901a\u8fc7\u904d\u5386\u7ed9\u5b9a\u7684\u53c2\u6570\u7ec4\u5408\u6765\u5bfb\u627e\u6700\u4f18\u53c2\u6570\u3002\u4f7f\u7528Scikit-learn\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u7f51\u683c\u641c\u7d22\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.model_selection import GridSearchCV<\/p>\n<p>param_grid = {<\/p>\n<p>    &#39;n_estimators&#39;: [50, 100, 200],<\/p>\n<p>    &#39;max_depth&#39;: [None, 10, 20, 30]<\/p>\n<p>}<\/p>\n<p>grid_search = GridSearchCV(clf, param_grid, cv=5, scoring=&#39;accuracy&#39;)<\/p>\n<p>grid_search.fit(X_train, y_train)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u968f\u673a\u641c\u7d22<\/strong><\/li>\n<\/ol>\n<p><p>\u968f\u673a\u641c\u7d22\u662f\u4e00\u79cd\u8c03\u53c2\u65b9\u6cd5\uff0c\u5b83\u5728\u53c2\u6570\u7a7a\u95f4\u4e2d\u968f\u673a\u9009\u62e9\u53c2\u6570\u7ec4\u5408\u8fdb\u884c\u8bc4\u4f30\u3002\u76f8\u6bd4\u7f51\u683c\u641c\u7d22\uff0c\u968f\u673a\u641c\u7d22\u5728\u8ba1\u7b97\u65f6\u95f4\u4e0a\u66f4\u4e3a\u9ad8\u6548\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u6b63\u5219\u5316<\/strong><\/li>\n<\/ol>\n<p><p>\u6b63\u5219\u5316\u662f\u9632\u6b62\u6a21\u578b\u8fc7\u62df\u5408\u7684\u6709\u6548\u65b9\u6cd5\u3002\u901a\u8fc7\u5728\u635f\u5931\u51fd\u6570\u4e2d\u52a0\u5165\u6b63\u5219\u5316\u9879\uff0c\u53ef\u4ee5\u9650\u5236\u6a21\u578b\u7684\u590d\u6742\u5ea6\uff0c\u4ece\u800c\u63d0\u9ad8\u6a21\u578b\u7684\u6cdb\u5316\u80fd\u529b\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u6a21\u578b\u90e8\u7f72\u4e0e\u5e94\u7528<\/p>\n<\/p>\n<p><p>\u5728\u5b8c\u6210\u6a21\u578b\u7684\u8bad\u7ec3\u548c\u4f18\u5316\u540e\uff0c\u6700\u540e\u4e00\u6b65\u662f\u5c06\u6a21\u578b\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\u4e2d\u8fdb\u884c\u5e94\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u6a21\u578b\u4fdd\u5b58\u4e0e\u52a0\u8f7d<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528Python\u7684Pickle\u5e93\u53ef\u4ee5\u65b9\u4fbf\u5730\u4fdd\u5b58\u548c\u52a0\u8f7d\u6a21\u578b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pickle<\/p>\n<h2><strong>\u4fdd\u5b58\u6a21\u578b<\/strong><\/h2>\n<p>with open(&#39;model.pkl&#39;, &#39;wb&#39;) as f:<\/p>\n<p>    pickle.dump(clf, f)<\/p>\n<h2><strong>\u52a0\u8f7d\u6a21\u578b<\/strong><\/h2>\n<p>with open(&#39;model.pkl&#39;, &#39;rb&#39;) as f:<\/p>\n<p>    loaded_model = pickle.load(f)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>API\u90e8\u7f72<\/strong><\/li>\n<\/ol>\n<p><p>\u53ef\u4ee5\u4f7f\u7528Flask\u6216FastAPI\u7b49\u6846\u67b6\u5c06\u6a21\u578b\u90e8\u7f72\u4e3aAPI\uff0c\u4ee5\u4f9b\u5916\u90e8\u5e94\u7528\u8c03\u7528\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u6301\u7eed\u76d1\u63a7\u4e0e\u66f4\u65b0<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u6a21\u578b\u90e8\u7f72\u540e\uff0c\u9700\u8981\u5bf9\u6a21\u578b\u7684\u6027\u80fd\u8fdb\u884c\u6301\u7eed\u76d1\u63a7\uff0c\u4ee5\u786e\u4fdd\u5176\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u7684\u8868\u73b0\u7a33\u5b9a\u3002\u4e00\u65e6\u53d1\u73b0\u6a21\u578b\u6027\u80fd\u4e0b\u964d\uff0c\u53ef\u4ee5\u901a\u8fc7\u91cd\u65b0\u8bad\u7ec3\u6a21\u578b\u6216\u66f4\u65b0\u6570\u636e\u96c6\u6765\u8fdb\u884c\u66f4\u65b0\u3002<\/p>\n<\/p>\n<p><p>\u7efc\u4e0a\u6240\u8ff0\uff0c\u5229\u7528Python\u8fdb\u884c\u5206\u7c7b\u6d89\u53ca\u591a\u4e2a\u6b65\u9aa4\uff0c\u5305\u62ec\u6570\u636e\u9884\u5904\u7406\u3001\u9009\u62e9\u5408\u9002\u7684\u5206\u7c7b\u7b97\u6cd5\u3001\u6a21\u578b\u8bad\u7ec3\u4e0e\u8bc4\u4f30\u3001\u6a21\u578b\u4f18\u5316\u4e0e\u8c03\u53c2\u4ee5\u53ca\u6a21\u578b\u90e8\u7f72\u4e0e\u5e94\u7528\u3002\u638c\u63e1\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u6784\u5efa\u51fa\u6027\u80fd\u4f18\u5f02\u7684\u5206\u7c7b\u6a21\u578b\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684Python\u5e93\u8fdb\u884c\u5206\u7c7b\u4efb\u52a1\uff1f<\/strong><br \/>\u5728\u8fdb\u884c\u5206\u7c7b\u4efb\u52a1\u65f6\uff0c\u9009\u62e9\u5408\u9002\u7684Python\u5e93\u81f3\u5173\u91cd\u8981\u3002\u5e38\u7528\u7684\u5e93\u5305\u62ecScikit-learn\u3001TensorFlow\u548cKeras\u7b49\u3002Scikit-learn\u9002\u5408\u5904\u7406\u4f20\u7edf\u673a\u5668\u5b66\u4e60\u95ee\u9898\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5206\u7c7b\u7b97\u6cd5\uff0c\u5982\u51b3\u7b56\u6811\u3001\u968f\u673a\u68ee\u6797\u548c\u652f\u6301\u5411\u91cf\u673a\u7b49\u3002TensorFlow\u548cKeras\u66f4\u9002\u5408\u6df1\u5ea6\u5b66\u4e60\u4efb\u52a1\uff0c\u80fd\u591f\u5904\u7406\u590d\u6742\u7684\u975e\u7ebf\u6027\u5173\u7cfb\u3002\u6839\u636e\u4efb\u52a1\u590d\u6742\u6027\u548c\u6570\u636e\u89c4\u6a21\uff0c\u9009\u62e9\u5408\u9002\u7684\u5e93\u5c06\u6709\u52a9\u4e8e\u63d0\u9ad8\u6a21\u578b\u7684\u6027\u80fd\u3002<\/p>\n<p><strong>\u5982\u4f55\u51c6\u5907\u6570\u636e\u4ee5\u4fbf\u8fdb\u884c\u5206\u7c7b\uff1f<\/strong><br \/>\u6570\u636e\u51c6\u5907\u662f\u5206\u7c7b\u4efb\u52a1\u7684\u5173\u952e\u4e00\u6b65\u3002\u9996\u5148\uff0c\u786e\u4fdd\u6570\u636e\u96c6\u7684\u8d28\u91cf\uff0c\u5305\u62ec\u5904\u7406\u7f3a\u5931\u503c\u548c\u5f02\u5e38\u503c\u3002\u63a5\u7740\uff0c\u8fdb\u884c\u7279\u5f81\u5de5\u7a0b\uff0c\u901a\u8fc7\u9009\u62e9\u3001\u521b\u9020\u6216\u8f6c\u6362\u7279\u5f81\u6765\u63d0\u9ad8\u6a21\u578b\u7684\u9884\u6d4b\u80fd\u529b\u3002\u6570\u636e\u6807\u51c6\u5316\u548c\u5f52\u4e00\u5316\u4e5f\u662f\u5e38\u89c1\u7684\u6b65\u9aa4\uff0c\u5c24\u5176\u662f\u5728\u4f7f\u7528\u57fa\u4e8e\u8ddd\u79bb\u7684\u7b97\u6cd5\u65f6\u3002\u6b64\u5916\uff0c\u5c06\u6570\u636e\u96c6\u5212\u5206\u4e3a\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\uff0c\u4ee5\u4fbf\u540e\u7eed\u8bc4\u4f30\u6a21\u578b\u7684\u8868\u73b0\u3002<\/p>\n<p><strong>\u5982\u4f55\u8bc4\u4f30\u5206\u7c7b\u6a21\u578b\u7684\u6027\u80fd\uff1f<\/strong><br \/>\u8bc4\u4f30\u5206\u7c7b\u6a21\u578b\u7684\u6027\u80fd\u901a\u5e38\u4f7f\u7528\u6df7\u6dc6\u77e9\u9635\u3001\u51c6\u786e\u7387\u3001\u7cbe\u786e\u7387\u3001\u53ec\u56de\u7387\u548cF1\u5206\u6570\u7b49\u6307\u6807\u3002\u6df7\u6dc6\u77e9\u9635\u80fd\u591f\u76f4\u89c2\u5730\u663e\u793a\u6a21\u578b\u7684\u5206\u7c7b\u7ed3\u679c\uff0c\u5305\u62ec\u771f\u9633\u6027\u3001\u5047\u9633\u6027\u3001\u771f\u9634\u6027\u548c\u5047\u9634\u6027\u3002\u51c6\u786e\u7387\u662f\u6b63\u786e\u5206\u7c7b\u7684\u6837\u672c\u5360\u603b\u6837\u672c\u7684\u6bd4\u4f8b\uff0c\u800c\u7cbe\u786e\u7387\u548c\u53ec\u56de\u7387\u5219\u5206\u522b\u5173\u6ce8\u6a21\u578b\u7684\u51c6\u786e\u6027\u548c\u5bf9\u6b63\u7c7b\u7684\u8bc6\u522b\u80fd\u529b\u3002\u7efc\u5408\u4f7f\u7528\u8fd9\u4e9b\u6307\u6807\u53ef\u4ee5\u5168\u9762\u4e86\u89e3\u6a21\u578b\u7684\u6027\u80fd\uff0c\u4ece\u800c\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u4f18\u5316\u548c\u8c03\u6574\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5229\u7528Python\u8fdb\u884c\u5206\u7c7b\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u4f7f\u7528\u673a\u5668\u5b66\u4e60\u5e93\u5982Scikit-learn\u3001TensorFlow\u6216Ke [&hellip;]","protected":false},"author":3,"featured_media":956307,"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\/956302"}],"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=956302"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/956302\/revisions"}],"predecessor-version":[{"id":956312,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/956302\/revisions\/956312"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/956307"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=956302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=956302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=956302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}