{"id":978789,"date":"2024-12-27T06:40:42","date_gmt":"2024-12-26T22:40:42","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/978789.html"},"modified":"2024-12-27T06:40:44","modified_gmt":"2024-12-26T22:40:44","slug":"python%e5%a6%82%e4%bd%95%e5%af%b9%e6%95%b0%e6%8d%ae%e5%88%86%e7%b1%bb","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/978789.html","title":{"rendered":"python\u5982\u4f55\u5bf9\u6570\u636e\u5206\u7c7b"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24203615\/e115e66b-2582-4f7f-9a99-417570569359.webp\" alt=\"python\u5982\u4f55\u5bf9\u6570\u636e\u5206\u7c7b\" \/><\/p>\n<p><p> <strong>Python\u5bf9\u6570\u636e\u5206\u7c7b\u7684\u65b9\u6cd5\u6709\u591a\u79cd\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\u8fdb\u884c\u5206\u7c7b\u6a21\u578b\u7684\u6784\u5efa\uff0c\u4f7f\u7528Pandas\u8fdb\u884c\u6570\u636e\u9884\u5904\u7406\u3001\u7279\u5f81\u9009\u62e9\uff0c\u4ee5\u53ca\u4f7f\u7528Keras\u8fdb\u884c\u6df1\u5ea6\u5b66\u4e60\u5206\u7c7b\u3002\u9009\u62e9\u5408\u9002\u7684\u5206\u7c7b\u7b97\u6cd5\u3001\u6570\u636e\u9884\u5904\u7406\u548c\u7279\u5f81\u5de5\u7a0b\u662f\u5b9e\u73b0\u7cbe\u786e\u5206\u7c7b\u7684\u5173\u952e\u6b65\u9aa4\u3002<\/strong>\u5728\u8fd9\u4e9b\u65b9\u6cd5\u4e2d\uff0cScikit-Learn\u662f\u6700\u5e38\u7528\u7684\u5e93\u4e4b\u4e00\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u591a\u79cd\u5206\u7c7b\u7b97\u6cd5\u548c\u5de5\u5177\u6765\u5b9e\u73b0\u4ece\u6570\u636e\u9884\u5904\u7406\u5230\u6a21\u578b\u8bc4\u4f30\u7684\u5168\u8fc7\u7a0b\u3002\u901a\u8fc7\u63a2\u7d22Scikit-Learn\u4e2d\u7684\u5206\u7c7b\u5668\uff0c\u5982\u903b\u8f91\u56de\u5f52\u3001\u652f\u6301\u5411\u91cf\u673a\uff08SVM\uff09\u3001\u51b3\u7b56\u6811\u548c\u968f\u673a\u68ee\u6797\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u6570\u636e\u7684\u7279\u5f81\u548c\u4efb\u52a1\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u6a21\u578b\u8fdb\u884c\u5206\u7c7b\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u6570\u636e\u9884\u5904\u7406\u4e0e\u7279\u5f81\u9009\u62e9<\/p>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u6570\u636e\u5206\u7c7b\u4e4b\u524d\uff0c\u6570\u636e\u9884\u5904\u7406\u548c\u7279\u5f81\u9009\u62e9\u662f\u5fc5\u8981\u7684\u6b65\u9aa4\u3002\u8fd9\u4e9b\u6b65\u9aa4\u53ef\u4ee5\u5e2e\u52a9\u63d0\u9ad8\u6a21\u578b\u7684\u6027\u80fd\u548c\u51c6\u786e\u6027\u3002<\/p>\n<\/p>\n<ol>\n<li>\u6570\u636e\u6e05\u6d17<\/li>\n<\/ol>\n<p><p>\u6570\u636e\u6e05\u6d17\u662f\u6570\u636e\u9884\u5904\u7406\u7684\u7b2c\u4e00\u6b65\uff0c\u6d89\u53ca\u5904\u7406\u7f3a\u5931\u503c\u3001\u91cd\u590d\u503c\u548c\u5f02\u5e38\u503c\u3002\u53ef\u4ee5\u4f7f\u7528Pandas\u5e93\u4e2d\u7684\u51fd\u6570\u5982<code>dropna()<\/code>\u3001<code>fillna()<\/code>\u548c<code>drop_duplicates()<\/code>\u6765\u5b8c\u6210\u8fd9\u4e9b\u64cd\u4f5c\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u53ef\u89c6\u5316\u5de5\u5177\u5982Matplotlib\u548cSeaborn\u6765\u68c0\u6d4b\u548c\u5904\u7406\u5f02\u5e38\u503c\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u7279\u5f81\u5de5\u7a0b<\/li>\n<\/ol>\n<p><p>\u7279\u5f81\u5de5\u7a0b\u662f\u901a\u8fc7\u521b\u5efa\u65b0\u7684\u7279\u5f81\u6216\u9009\u62e9\u91cd\u8981\u7279\u5f81\u6765\u589e\u5f3a\u6a21\u578b\u6027\u80fd\u7684\u8fc7\u7a0b\u3002\u53ef\u4ee5\u4f7f\u7528Scikit-Learn\u4e2d\u7684<code>StandardScaler<\/code>\u548c<code>MinMaxScaler<\/code>\u8fdb\u884c\u6570\u636e\u6807\u51c6\u5316\u548c\u5f52\u4e00\u5316\u3002\u6b64\u5916\uff0c\u4f7f\u7528Pandas\u53ef\u4ee5\u8f7b\u677e\u8fdb\u884c\u7279\u5f81\u7684\u9009\u62e9\u548c\u7ec4\u5408\uff0c\u4ee5\u63d0\u9ad8\u6a21\u578b\u7684\u8868\u73b0\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u6570\u636e\u5206\u5272<\/li>\n<\/ol>\n<p><p>\u5728\u6570\u636e\u5efa\u6a21\u4e4b\u524d\uff0c\u5c06\u6570\u636e\u96c6\u5206\u5272\u4e3a\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u662f\u5fc5\u8981\u7684\u3002\u53ef\u4ee5\u4f7f\u7528Scikit-Learn\u4e2d\u7684<code>tr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n_test_split<\/code>\u51fd\u6570\u6765\u968f\u673a\u5212\u5206\u6570\u636e\u96c6\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728\u6a21\u578b\u8bad\u7ec3\u548c\u8bc4\u4f30\u8fc7\u7a0b\u4e2d\u66f4\u597d\u5730\u9a8c\u8bc1\u6a21\u578b\u7684\u6cdb\u5316\u80fd\u529b\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u9009\u62e9\u5206\u7c7b\u7b97\u6cd5<\/p>\n<\/p>\n<p><p>\u6839\u636e\u6570\u636e\u7684\u7279\u6027\u548c\u4efb\u52a1\u9700\u6c42\uff0c\u9009\u62e9\u5408\u9002\u7684\u5206\u7c7b\u7b97\u6cd5\u662f\u6210\u529f\u5206\u7c7b\u7684\u5173\u952e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u5206\u7c7b\u7b97\u6cd5\u53ca\u5176\u7279\u70b9\u3002<\/p>\n<\/p>\n<ol>\n<li>\u903b\u8f91\u56de\u5f52<\/li>\n<\/ol>\n<p><p>\u903b\u8f91\u56de\u5f52\u662f\u4e00\u79cd\u7b80\u5355\u4f46\u6709\u6548\u7684\u5206\u7c7b\u7b97\u6cd5\uff0c\u9002\u7528\u4e8e\u7ebf\u6027\u53ef\u5206\u7684\u6570\u636e\u96c6\u3002\u5b83\u901a\u8fc7\u6700\u5927\u5316\u4f3c\u7136\u51fd\u6570\u6765\u4f30\u8ba1\u53c2\u6570\uff0c\u5e76\u8f93\u51fa\u5c5e\u4e8e\u67d0\u4e2a\u7c7b\u522b\u7684\u6982\u7387\u3002Scikit-Learn\u4e2d\u7684<code>LogisticRegression<\/code>\u7c7b\u53ef\u4ee5\u7528\u4e8e\u5b9e\u73b0\u903b\u8f91\u56de\u5f52\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u652f\u6301\u5411\u91cf\u673a\uff08SVM\uff09<\/li>\n<\/ol>\n<p><p>SVM\u662f\u4e00\u79cd\u5f3a\u5927\u7684\u5206\u7c7b\u7b97\u6cd5\uff0c\u80fd\u591f\u5728\u9ad8\u7ef4\u7a7a\u95f4\u4e2d\u8fdb\u884c\u5206\u7c7b\u3002\u5b83\u901a\u8fc7\u5bfb\u627e\u6700\u4f18\u5206\u5272\u8d85\u5e73\u9762\u6765\u6700\u5927\u5316\u7c7b\u95f4\u8ddd\u79bb\u3002SVM\u9002\u7528\u4e8e\u5c0f\u6837\u672c\u3001\u9ad8\u7ef4\u5ea6\u7684\u6570\u636e\u96c6\u3002Scikit-Learn\u4e2d\u7684<code>SVC<\/code>\u7c7b\u53ef\u7528\u4e8e\u5b9e\u73b0\u652f\u6301\u5411\u91cf\u673a\u5206\u7c7b\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u51b3\u7b56\u6811<\/li>\n<\/ol>\n<p><p>\u51b3\u7b56\u6811\u662f\u4e00\u79cd\u6811\u5f62\u7ed3\u6784\u7684\u5206\u7c7b\u65b9\u6cd5\uff0c\u901a\u8fc7\u9012\u5f52\u5730\u9009\u62e9\u6700\u4f73\u5206\u5272\u70b9\u6765\u6784\u5efa\u5206\u7c7b\u6a21\u578b\u3002\u5b83\u6613\u4e8e\u89e3\u91ca\uff0c\u9002\u7528\u4e8e\u5904\u7406\u5177\u6709\u7f3a\u5931\u503c\u7684\u6570\u636e\u3002Scikit-Learn\u4e2d\u7684<code>DecisionTreeClassifier<\/code>\u7c7b\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u51b3\u7b56\u6811\u6a21\u578b\u3002<\/p>\n<\/p>\n<ol start=\"4\">\n<li>\u968f\u673a\u68ee\u6797<\/li>\n<\/ol>\n<p><p>\u968f\u673a\u68ee\u6797\u662f\u7531\u591a\u68f5\u51b3\u7b56\u6811\u7ec4\u6210\u7684\u96c6\u6210\u7b97\u6cd5\uff0c\u901a\u8fc7\u5bf9\u591a\u68f5\u6811\u7684\u9884\u6d4b\u7ed3\u679c\u8fdb\u884c\u6295\u7968\u6765\u63d0\u9ad8\u5206\u7c7b\u7cbe\u5ea6\u3002\u5b83\u80fd\u6709\u6548\u964d\u4f4e\u8fc7\u62df\u5408\u98ce\u9669\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u5206\u7c7b\u4efb\u52a1\u3002Scikit-Learn\u4e2d\u7684<code>RandomForestClassifier<\/code>\u7c7b\u53ef\u7528\u4e8e\u5b9e\u73b0\u968f\u673a\u68ee\u6797\u5206\u7c7b\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\u5408\u9002\u7684\u5206\u7c7b\u7b97\u6cd5\u540e\uff0c\u6a21\u578b\u7684\u8bad\u7ec3\u548c\u8bc4\u4f30\u662f\u786e\u4fdd\u5206\u7c7b\u6548\u679c\u7684\u5173\u952e\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<ol>\n<li>\u6a21\u578b\u8bad\u7ec3<\/li>\n<\/ol>\n<p><p>\u5728\u6a21\u578b\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u5c06\u9884\u5904\u7406\u8fc7\u7684\u6570\u636e\u8f93\u5165\u5230\u9009\u5b9a\u7684\u5206\u7c7b\u7b97\u6cd5\u4e2d\u8fdb\u884c\u8bad\u7ec3\u3002\u4f7f\u7528Scikit-Learn\u7684<code>fit()<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5c06\u8bad\u7ec3\u6570\u636e\u4f20\u9012\u7ed9\u6a21\u578b\uff0c\u5b8c\u6210\u6a21\u578b\u53c2\u6570\u7684\u5b66\u4e60\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u6a21\u578b\u8bc4\u4f30<\/li>\n<\/ol>\n<p><p>\u6a21\u578b\u8bc4\u4f30\u662f\u9a8c\u8bc1\u6a21\u578b\u6027\u80fd\u7684\u91cd\u8981\u73af\u8282\u3002\u53ef\u4ee5\u4f7f\u7528Scikit-Learn\u4e2d\u7684<code>accuracy_score<\/code>\u3001<code>precision_score<\/code>\u3001<code>recall_score<\/code>\u548c<code>f1_score<\/code>\u7b49\u8bc4\u4f30\u6307\u6807\u6765\u8861\u91cf\u6a21\u578b\u5728\u6d4b\u8bd5\u96c6\u4e0a\u7684\u8868\u73b0\u3002\u6b64\u5916\uff0c\u4ea4\u53c9\u9a8c\u8bc1\u662f\u4e00\u79cd\u5e38\u7528\u7684\u8bc4\u4f30\u65b9\u6cd5\uff0c\u53ef\u4ee5\u901a\u8fc7<code>cross_val_score<\/code>\u51fd\u6570\u5b9e\u73b0\uff0c\u8fdb\u4e00\u6b65\u9a8c\u8bc1\u6a21\u578b\u7684\u7a33\u5b9a\u6027\u548c\u6cdb\u5316\u80fd\u529b\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u6a21\u578b\u4f18\u5316<\/li>\n<\/ol>\n<p><p>\u6a21\u578b\u4f18\u5316\u662f\u63d0\u9ad8\u6a21\u578b\u6027\u80fd\u7684\u91cd\u8981\u6b65\u9aa4\uff0c\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u8d85\u53c2\u6570\u6765\u5b9e\u73b0\u3002Scikit-Learn\u4e2d\u7684<code>GridSearchCV<\/code>\u548c<code>RandomizedSearchCV<\/code>\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u8fdb\u884c\u8d85\u53c2\u6570\u8c03\u4f18\uff0c\u627e\u5230\u6700\u4f73\u53c2\u6570\u7ec4\u5408\uff0c\u4ee5\u63d0\u9ad8\u6a21\u578b\u7684\u5206\u7c7b\u6548\u679c\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u6df1\u5ea6\u5b66\u4e60\u5206\u7c7b<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u590d\u6742\u7684\u5206\u7c7b\u4efb\u52a1\uff0c\u6df1\u5ea6\u5b66\u4e60\u662f\u4e00\u79cd\u5f3a\u5927\u7684\u5de5\u5177\u3002\u901a\u8fc7\u4f7f\u7528TensorFlow\u548cKeras\u7b49\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\uff0c\u53ef\u4ee5\u6784\u5efa\u6df1\u5ea6\u795e\u7ecf\u7f51\u7edc\u8fdb\u884c\u5206\u7c7b\u3002<\/p>\n<\/p>\n<ol>\n<li>\u6df1\u5ea6\u795e\u7ecf\u7f51\u7edc<\/li>\n<\/ol>\n<p><p>\u6df1\u5ea6\u795e\u7ecf\u7f51\u7edc\u7531\u591a\u4e2a\u9690\u85cf\u5c42\u7ec4\u6210\uff0c\u80fd\u591f\u63d0\u53d6\u6570\u636e\u7684\u6df1\u5c42\u7279\u5f81\u3002Keras\u662f\u4e00\u4e2a\u9ad8\u5c42\u795e\u7ecf\u7f51\u7edcAPI\uff0c\u80fd\u591f\u5feb\u901f\u6784\u5efa\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5b9a\u4e49\u7f51\u7edc\u7ed3\u6784\u3001\u9009\u62e9\u6fc0\u6d3b\u51fd\u6570\u548c\u4f18\u5316\u5668\u6765\u521b\u5efa\u9002\u5408\u7279\u5b9a\u4efb\u52a1\u7684\u5206\u7c7b\u6a21\u578b\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08CNN\uff09<\/li>\n<\/ol>\n<p><p>CNN\u662f\u4e00\u79cd\u4e13\u95e8\u7528\u4e8e\u5904\u7406\u56fe\u50cf\u6570\u636e\u7684\u795e\u7ecf\u7f51\u7edc\uff0c\u80fd\u591f\u81ea\u52a8\u63d0\u53d6\u56fe\u50cf\u7279\u5f81\u3002\u901a\u8fc7\u4f7f\u7528Keras\u4e2d\u7684<code>Conv2D<\/code>\u3001<code>MaxPooling2D<\/code>\u7b49\u5c42\uff0c\u53ef\u4ee5\u8f7b\u677e\u6784\u5efaCNN\u6a21\u578b\uff0c\u7528\u4e8e\u56fe\u50cf\u5206\u7c7b\u4efb\u52a1\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\uff08RNN\uff09<\/li>\n<\/ol>\n<p><p>RNN\u662f\u4e00\u79cd\u9002\u7528\u4e8e\u5e8f\u5217\u6570\u636e\u7684\u795e\u7ecf\u7f51\u7edc\uff0c\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u548c\u65f6\u95f4\u5e8f\u5217\u9884\u6d4b\u4e2d\u8868\u73b0\u4f18\u5f02\u3002\u901a\u8fc7\u4f7f\u7528Keras\u4e2d\u7684<code>SimpleRNN<\/code>\u3001<code>LSTM<\/code>\u7b49\u5c42\uff0c\u53ef\u4ee5\u6784\u5efaRNN\u6a21\u578b\uff0c\u7528\u4e8e\u5904\u7406\u65f6\u5e8f\u6570\u636e\u7684\u5206\u7c7b\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u5e94\u7528\u6848\u4f8b\u4e0e\u5b9e\u6218<\/p>\n<\/p>\n<p><p>\u5728\u638c\u63e1\u4e86Python\u6570\u636e\u5206\u7c7b\u7684\u57fa\u672c\u65b9\u6cd5\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u5177\u4f53\u7684\u5e94\u7528\u6848\u4f8b\u548c\u5b9e\u6218\u6765\u8fdb\u4e00\u6b65\u7406\u89e3\u548c\u5b9e\u8df5\u8fd9\u4e9b\u6280\u672f\u3002<\/p>\n<\/p>\n<ol>\n<li>\u56fe\u50cf\u5206\u7c7b<\/li>\n<\/ol>\n<p><p>\u56fe\u50cf\u5206\u7c7b\u662f\u8ba1\u7b97\u673a\u89c6\u89c9\u9886\u57df\u7684\u4e00\u4e2a\u91cd\u8981\u4efb\u52a1\u3002\u53ef\u4ee5\u4f7f\u7528\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08CNN\uff09\u6765\u6784\u5efa\u56fe\u50cf\u5206\u7c7b\u6a21\u578b\uff0c\u5e76\u5728\u516c\u5f00\u6570\u636e\u96c6\u5982CIFAR-10\u4e0a\u8fdb\u884c\u8bad\u7ec3\u548c\u8bc4\u4f30\u3002\u901a\u8fc7\u8c03\u6574\u7f51\u7edc\u7ed3\u6784\u548c\u8d85\u53c2\u6570\uff0c\u53ef\u4ee5\u63d0\u9ad8\u6a21\u578b\u7684\u5206\u7c7b\u7cbe\u5ea6\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u6587\u672c\u5206\u7c7b<\/li>\n<\/ol>\n<p><p>\u6587\u672c\u5206\u7c7b\u662f\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4e2d\u7684\u4e00\u4e2a\u91cd\u8981\u5e94\u7528\u3002\u53ef\u4ee5\u4f7f\u7528\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\uff08RNN\uff09\u6216\u8f6c\u6362\u5668\uff08Transformer\uff09\u6a21\u578b\u6765\u5904\u7406\u6587\u672c\u6570\u636e\uff0c\u5e76\u5728\u60c5\u611f\u5206\u6790\u3001\u5783\u573e\u90ae\u4ef6\u68c0\u6d4b\u7b49\u4efb\u52a1\u4e2d\u8fdb\u884c\u5206\u7c7b\u3002\u901a\u8fc7\u5bf9\u6587\u672c\u6570\u636e\u8fdb\u884c\u9884\u5904\u7406\u548c\u7279\u5f81\u63d0\u53d6\uff0c\u53ef\u4ee5\u63d0\u9ad8\u6a21\u578b\u7684\u5206\u7c7b\u6548\u679c\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u5b9e\u65f6\u6570\u636e\u5206\u7c7b<\/li>\n<\/ol>\n<p><p>\u5b9e\u65f6\u6570\u636e\u5206\u7c7b\u662f\u7269\u8054\u7f51\u548c\u5927\u6570\u636e\u5206\u6790\u4e2d\u7684\u4e00\u4e2a\u91cd\u8981\u5e94\u7528\u573a\u666f\u3002\u53ef\u4ee5\u4f7f\u7528\u6d41\u5904\u7406\u6846\u67b6\u5982Apache Kafka\u548cApache Flink\uff0c\u4e0ePython\u5206\u7c7b\u6a21\u578b\u96c6\u6210\uff0c\u5b9e\u73b0\u5bf9\u5b9e\u65f6\u6570\u636e\u7684\u9ad8\u6548\u5206\u7c7b\u548c\u5904\u7406\u3002<\/p>\n<\/p>\n<p><p>\u7efc\u4e0a\u6240\u8ff0\uff0cPython\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5de5\u5177\u548c\u5e93\u6765\u5b9e\u73b0\u6570\u636e\u5206\u7c7b\u3002\u901a\u8fc7\u9009\u62e9\u5408\u9002\u7684\u5206\u7c7b\u7b97\u6cd5\u3001\u8fdb\u884c\u6709\u6548\u7684\u6570\u636e\u9884\u5904\u7406\u548c\u7279\u5f81\u9009\u62e9\uff0c\u4ee5\u53ca\u7ed3\u5408\u6df1\u5ea6\u5b66\u4e60\u6280\u672f\uff0c\u53ef\u4ee5\u5728\u5404\u79cd\u5e94\u7528\u573a\u666f\u4e2d\u5b9e\u73b0\u9ad8\u6548\u7684\u6570\u636e\u5206\u7c7b\u3002\u65e0\u8bba\u662f\u4f20\u7edf\u673a\u5668\u5b66\u4e60\u65b9\u6cd5\u8fd8\u662f\u6df1\u5ea6\u5b66\u4e60\u65b9\u6cd5\uff0cPython\u90fd\u80fd\u4e3a\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u5de5\u7a0b\u5e08\u63d0\u4f9b\u5f3a\u5927\u7684\u652f\u6301\u548c\u4fbf\u5229\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684\u5206\u7c7b\u7b97\u6cd5\u6765\u5904\u7406\u6211\u7684\u6570\u636e\uff1f<\/strong><br \/>\u5728\u9009\u62e9\u5206\u7c7b\u7b97\u6cd5\u65f6\uff0c\u91cd\u8981\u7684\u662f\u8981\u8003\u8651\u6570\u636e\u7684\u6027\u8d28\u3001\u89c4\u6a21\u548c\u76ee\u6807\u3002\u5e38\u89c1\u7684\u5206\u7c7b\u7b97\u6cd5\u5305\u62ec\u51b3\u7b56\u6811\u3001\u652f\u6301\u5411\u91cf\u673a\uff08SVM\uff09\u3001\u968f\u673a\u68ee\u6797\u548cK\u8fd1\u90bb\uff08KNN\uff09\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u4ea4\u53c9\u9a8c\u8bc1\u6765\u8bc4\u4f30\u6bcf\u79cd\u7b97\u6cd5\u7684\u8868\u73b0\uff0c\u5e76\u9009\u62e9\u51c6\u786e\u7387\u548c\u6548\u7387\u6700\u4f18\u7684\u7b97\u6cd5\u3002\u540c\u65f6\uff0c\u4e86\u89e3\u6570\u636e\u7684\u7279\u5f81\u548c\u6837\u672c\u91cf\u4e5f\u6709\u52a9\u4e8e\u66f4\u597d\u5730\u9009\u62e9\u9002\u5408\u7684\u6a21\u578b\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5904\u7406\u7f3a\u5931\u503c\u4ee5\u63d0\u9ad8\u5206\u7c7b\u6a21\u578b\u7684\u51c6\u786e\u6027\uff1f<\/strong><br \/>\u7f3a\u5931\u503c\u662f\u5f71\u54cd\u5206\u7c7b\u6a21\u578b\u6027\u80fd\u7684\u5e38\u89c1\u95ee\u9898\u3002\u53ef\u4ee5\u4f7f\u7528Pandas\u5e93\u4e2d\u7684<code>fillna()<\/code>\u65b9\u6cd5\u6765\u586b\u5145\u7f3a\u5931\u503c\uff0c\u6216\u4f7f\u7528<code>dropna()<\/code>\u65b9\u6cd5\u5220\u9664\u5305\u542b\u7f3a\u5931\u503c\u7684\u884c\u3002\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f7f\u7528\u63d2\u503c\u6216\u9884\u6d4b\u6a21\u578b\u6765\u63a8\u6d4b\u7f3a\u5931\u503c\u3002\u786e\u4fdd\u9009\u62e9\u7684\u5904\u7406\u65b9\u6cd5\u4e0d\u4f1a\u5f15\u5165\u504f\u5dee\uff0c\u4ece\u800c\u4fdd\u6301\u6570\u636e\u7684\u771f\u5b9e\u6027\u548c\u6a21\u578b\u7684\u51c6\u786e\u6027\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\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u6307\u6807\uff0c\u5305\u62ec\u51c6\u786e\u7387\u3001\u7cbe\u786e\u7387\u3001\u53ec\u56de\u7387\u548cF1\u5206\u6570\u3002\u4f7f\u7528\u6df7\u6dc6\u77e9\u9635\u53ef\u4ee5\u66f4\u76f4\u89c2\u5730\u4e86\u89e3\u6a21\u578b\u7684\u9884\u6d4b\u80fd\u529b\u3002Python\u4e2d\u7684Scikit-learn\u5e93\u63d0\u4f9b\u4e86\u4fbf\u6377\u7684\u51fd\u6570\u6765\u8ba1\u7b97\u8fd9\u4e9b\u6307\u6807\u3002\u53ef\u4ee5\u901a\u8fc7\u7ed8\u5236ROC\u66f2\u7ebf\u548c\u8ba1\u7b97AUC\u503c\u6765\u8fdb\u4e00\u6b65\u8bc4\u4f30\u6a21\u578b\u7684\u5206\u7c7b\u6548\u679c\uff0c\u7279\u522b\u662f\u5728\u5904\u7406\u4e0d\u5e73\u8861\u6570\u636e\u96c6\u65f6\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u5c24\u4e3a\u91cd\u8981\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5bf9\u6570\u636e\u5206\u7c7b\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u673a\u5668\u5b66\u4e60\u5e93\u5982Scikit-Learn\u3001TensorFlow\u8fdb\u884c\u5206\u7c7b [&hellip;]","protected":false},"author":3,"featured_media":978798,"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\/978789"}],"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=978789"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/978789\/revisions"}],"predecessor-version":[{"id":978799,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/978789\/revisions\/978799"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/978798"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=978789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=978789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=978789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}