{"id":92228,"date":"2026-08-09T19:17:13","date_gmt":"2026-08-09T11:17:13","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/92228.html"},"modified":"2026-08-09T19:17:13","modified_gmt":"2026-08-09T11:17:13","slug":"%e9%80%9f%e9%80%9a%e6%9c%ba%e5%99%a8%e5%ad%a6%e4%b9%a0-10%ef%bd%9c%e6%94%af%e6%8c%81%e5%90%91%e9%87%8f%e6%9c%ba-svm","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/92228.html","title":{"rendered":"\u901f\u901a\u673a\u5668\u5b66\u4e60 10\uff5c\u652f\u6301\u5411\u91cf\u673a SVM"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"-toc\" style=\"margin-left:40px\">\n<p id=\"%E5%89%8D%E8%A8%80-toc\" style=\"margin-left:40px\">\u524d\u8a00<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E6%A0%B8%E5%BF%83%E5%9F%BA%E7%A1%80%E6%A6%82%E5%BF%B5-toc\" style=\"margin-left:40px\">\u4e00\u3001\u6838\u5fc3\u57fa\u7840\u6982\u5ff5<\/p>\n<p id=\"1.%20%E7%AE%97%E6%B3%95%E6%A0%B8%E5%BF%83%E5%AE%9A%E4%BD%8D%EF%BC%88%E4%B8%8E%E9%80%BB%E8%BE%91%E5%9B%9E%E5%BD%92%E5%AF%B9%E6%AF%94%EF%BC%89-toc\" style=\"margin-left:80px\">1. \u7b97\u6cd5\u6838\u5fc3\u5b9a\u4f4d&#xff08;\u4e0e\u903b\u8f91\u56de\u5f52\u5bf9\u6bd4&#xff09;<\/p>\n<p id=\"2.%20%E8%B6%85%E5%B9%B3%E9%9D%A2%E6%95%B0%E5%AD%A6%E5%AE%9A%E4%B9%89-toc\" style=\"margin-left:80px\">2. \u8d85\u5e73\u9762\u6570\u5b66\u5b9a\u4e49<\/p>\n<p id=\"3.%20%E9%97%B4%E9%9A%94%E4%B8%8E%E6%94%AF%E6%8C%81%E5%90%91%E9%87%8F-toc\" style=\"margin-left:80px\">3. \u95f4\u9694\u4e0e\u652f\u6301\u5411\u91cf<\/p>\n<p id=\"4.%20SVM%E6%A0%87%E5%87%86%E4%BC%98%E5%8C%96%E7%9B%AE%E6%A0%87-toc\" style=\"margin-left:80px\">4. SVM\u6807\u51c6\u4f18\u5316\u76ee\u6807<\/p>\n<p id=\"%E4%BA%8C%E3%80%81%E7%A1%AC%E9%97%B4%E9%9A%94%20SVM%20vs%20%E8%BD%AF%E9%97%B4%E9%9A%94%20SVM-toc\" style=\"margin-left:40px\">\u4e8c\u3001\u786c\u95f4\u9694 SVM vs \u8f6f\u95f4\u9694 SVM<\/p>\n<p id=\"1.%20%E7%A1%AC%E9%97%B4%E9%9A%94%EF%BC%88Hard%E2%80%91margin%20SVM%EF%BC%89-toc\" style=\"margin-left:80px\">1. \u786c\u95f4\u9694&#xff08;Hard\u2011margin SVM&#xff09;<\/p>\n<p id=\"2.%20%E8%BD%AF%E9%97%B4%E9%9A%94%EF%BC%88Soft%E2%80%91margin%20SVM%EF%BC%89-toc\" style=\"margin-left:80px\">2. \u8f6f\u95f4\u9694&#xff08;Soft\u2011margin SVM&#xff09;<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E6%A0%B8%E5%87%BD%E6%95%B0%EF%BC%88Kernel%20Trick%EF%BC%89-toc\" style=\"margin-left:40px\">\u4e09\u3001\u6838\u51fd\u6570&#xff08;Kernel Trick&#xff09;<\/p>\n<p id=\"1.%20%E7%BA%BF%E6%80%A7%E6%A0%B8%EF%BC%88linear%EF%BC%89-toc\" style=\"margin-left:80px\">1. \u7ebf\u6027\u6838&#xff08;linear&#xff09;<\/p>\n<p id=\"2.%20%E9%AB%98%E6%96%AF%20RBF%20%E6%A0%B8%EF%BC%88%E5%BE%84%E5%90%91%E5%9F%BA%E6%A0%B8%EF%BC%8C%E6%9C%80%E5%B8%B8%E7%94%A8%EF%BC%89-toc\" style=\"margin-left:80px\">2. \u9ad8\u65af RBF \u6838&#xff08;\u5f84\u5411\u57fa\u6838&#xff0c;\u6700\u5e38\u7528&#xff09;<\/p>\n<p id=\"3.%20%E5%A4%9A%E9%A1%B9%E5%BC%8F%E6%A0%B8%EF%BC%88poly%EF%BC%89-toc\" style=\"margin-left:80px\">3. \u591a\u9879\u5f0f\u6838&#xff08;poly&#xff09;<\/p>\n<p id=\"%E5%9B%9B%E3%80%81%E6%A0%B8%E5%BF%83API%E4%B8%8E%E8%B6%85%E5%8F%82%E6%95%B0%E8%AF%A6%E8%A7%A3-toc\" style=\"margin-left:40px\">\u56db\u3001\u6838\u5fc3API\u4e0e\u8d85\u53c2\u6570\u8be6\u89e3<\/p>\n<p id=\"%E4%BA%94%E3%80%81%E5%AE%9E%E6%88%98%E6%A1%88%E4%BE%8B%EF%BC%9ASVM%E5%A4%9A%E5%8F%82%E6%95%B0%E7%BD%91%E6%A0%BC%E5%AF%BB%E4%BC%98%E5%88%86%E7%B1%BB%E5%BB%BA%E6%A8%A1-toc\" style=\"margin-left:40px\">\u4e94\u3001\u5b9e\u6218\u6848\u4f8b&#xff1a;SVM\u591a\u53c2\u6570\u7f51\u683c\u5bfb\u4f18\u5206\u7c7b\u5efa\u6a21<\/p>\n<p id=\"%E5%85%AD%E3%80%81%E7%AB%A0%E8%8A%82%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:40px\">\u516d\u3001\u7ae0\u8282\u603b\u7ed3<\/p>\n<h3>\u524d\u8a00<\/h3>\n<p style=\"margin-left:.0001pt;text-align:left\">\u672c\u8282\u5b66\u4e60\u652f\u6301\u5411\u91cf\u673a SVM&#xff08;Support Vector Machine&#xff09;&#xff0c;\u5b83\u662f\u7ecf\u5178\u5224\u522b\u5f0f\u5206\u7c7b\u7b97\u6cd5&#xff0c;\u5728\u5c0f\u6837\u672c\u3001\u9ad8\u7ef4\u6570\u636e\u4e0a\u8868\u73b0\u4f18\u79c0&#xff0c;\u6838\u5fc3\u601d\u60f3&#xff1a;\u5bfb\u627e\u6700\u4f18\u5206\u9694\u8d85\u5e73\u9762&#xff0c;\u6700\u5927\u5316\u7c7b\u522b\u4e4b\u95f4\u7684\u95f4\u9694\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">SVM \u65e2\u53ef\u4ee5\u505a\u4e8c\u5206\u7c7b&#xff0c;\u901a\u8fc7 One\u2011vs\u2011Rest \u7b49\u65b9\u5f0f\u62d3\u5c55\u591a\u5206\u7c7b&#xff1b;\u4e5f\u53ef\u4ee5\u505a\u56de\u5f52 SVR\u3002<\/p>\n<h3 id=\"%E4%B8%80%E3%80%81%E6%A0%B8%E5%BF%83%E5%9F%BA%E7%A1%80%E6%A6%82%E5%BF%B5\">\u4e00\u3001\u6838\u5fc3\u57fa\u7840\u6982\u5ff5<\/h3>\n<h4 id=\"1.%20%E7%AE%97%E6%B3%95%E6%A0%B8%E5%BF%83%E5%AE%9A%E4%BD%8D%EF%BC%88%E4%B8%8E%E9%80%BB%E8%BE%91%E5%9B%9E%E5%BD%92%E5%AF%B9%E6%AF%94%EF%BC%89\">1. \u7b97\u6cd5\u6838\u5fc3\u5b9a\u4f4d&#xff08;\u4e0e\u903b\u8f91\u56de\u5f52\u5bf9\u6bd4&#xff09;<\/h4>\n<p style=\"margin-left:.0001pt;text-align:left\">\u652f\u6301\u5411\u91cf\u673a&#xff08;SVM&#xff09;\u4e0e\u903b\u8f91\u56de\u5f52\u540c\u5c5e\u5224\u522b\u5f0f\u7ebf\u6027\u5206\u7c7b\u7b97\u6cd5&#xff0c;\u5747\u901a\u8fc7\u8d85\u5e73\u9762\u5212\u5206\u6837\u672c\u7c7b\u522b&#xff0c;\u4f46\u6c42\u89e3\u903b\u8f91\u5b58\u5728\u672c\u8d28\u5dee\u5f02&#xff1a;\u903b\u8f91\u56de\u5f52\u4f9d\u6258\u68af\u5ea6\u4e0b\u964d\u8fed\u4ee3\u66f4\u65b0\u53c2\u6570&#xff0c;\u62df\u5408\u6700\u4f18\u5206\u7c7b\u9762&#xff1b;\u800cSVM\u4f9d\u6258\u4e25\u683c\u7684\u6570\u5b66\u63a8\u5bfc&#xff0c;\u901a\u8fc7\u7ea6\u675f\u4f18\u5316\u76f4\u63a5\u6c42\u89e3\u5168\u5c40\u6700\u4f18\u8d85\u5e73\u9762&#xff0c;\u5206\u7c7b\u9c81\u68d2\u6027\u66f4\u5f3a\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">SVM\u6838\u5fc3\u6838\u5fc3\u51c6\u5219&#xff1a;\u5728\u4e24\u7c7b\u6837\u672c\u4e4b\u95f4&#xff0c;\u5bfb\u627e\u4e00\u4e2a\u6700\u4f18\u5206\u9694\u8d85\u5e73\u9762&#xff0c;\u6700\u5927\u5316\u6837\u672c\u4e0e\u8d85\u5e73\u9762\u7684\u6700\u5c0f\u51e0\u4f55\u95f4\u9694&#xff0c;\u4ec5\u4f9d\u9760\u8fb9\u754c\u9644\u8fd1\u7684\u652f\u6301\u5411\u91cf\u786e\u5b9a\u5206\u7c7b\u9762&#xff0c;\u4e0e\u8fdc\u79bb\u8d85\u5e73\u9762\u7684\u6837\u672c\u65e0\u5173\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u901a\u4fd7\u6982\u62ec\u5176\u6838\u5fc3\u903b\u8f91&#xff1a;\u7b5b\u9009\u51fa\u8ddd\u79bb\u5206\u7c7b\u8d85\u5e73\u9762\u6700\u8fd1\u7684\u6837\u672c\u70b9&#xff0c;\u901a\u8fc7\u6c42\u89e3\u6700\u4f18\u8d85\u5e73\u9762&#xff0c;\u6700\u5927\u5316\u8d85\u5e73\u9762\u4e0e\u8fd9\u4e9b\u4e34\u754c\u6837\u672c\u70b9\u7684\u95f4\u8ddd&#xff08;\u5c31\u662f\u4f7f\u6700\u8fd1\u7684\u6837\u672c\u70b9\u5728\u95f4\u9694\u8fb9\u754c\u4e0a\u6216\u8005\u4e4b\u5916&#xff09;&#xff0c;\u4ee5\u6b64\u5b9e\u73b0\u6700\u4f18\u5206\u7c7b\u6548\u679c\u3002\u4e0b\u9762\u6709\u8be6\u7ec6\u7684\u6570\u5b66\u6c42\u89e3\u8fc7\u7a0b&#xff0c;\u4e0d\u61c2\u7684\u8bdd\u8bb0\u4f4f\u4e0b\u4e2a\u6838\u5fc3\u903b\u8f91\u5c31\u597d\u3002<\/p>\n<h4 id=\"2.%20%E8%B6%85%E5%B9%B3%E9%9D%A2%E6%95%B0%E5%AD%A6%E5%AE%9A%E4%B9%89\">2. \u8d85\u5e73\u9762\u6570\u5b66\u5b9a\u4e49<\/h4>\n<p style=\"margin-left:.0001pt;text-align:left\">\u5728n\u7ef4\u7279\u5f81\u7a7a\u95f4\u4e2d&#xff0c;\u5206\u7c7b\u8d85\u5e73\u9762\u4e3an-1\u7ef4\u7ebf\u6027\u5206\u5272\u9762&#xff0c;\u901a\u7528\u6570\u5b66\u516c\u5f0f&#xff1a;<img decoding=\"async\" alt=\"w^T x+b=0\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b86f102.png\" \/>\u5f0f\u4e2d&#xff1a;w<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u4e3a\u6743\u91cd\u6cd5\u5411\u91cf&#xff08;\u5782\u76f4\u4e8e\u8d85\u5e73\u9762&#xff0c;\u51b3\u5b9a\u8d85\u5e73\u9762\u65b9\u5411&#xff09;&#xff1b;b\u4e3a\u504f\u7f6e\u9879&#xff08;\u51b3\u5b9a\u8d85\u5e73\u9762\u4f4d\u7f6e&#xff09;\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u57fa\u4e8e\u8d85\u5e73\u9762\u53ef\u5b8c\u6210\u6837\u672c\u7c7b\u522b\u5224\u522b&#xff0c;\u89c4\u5219\u5982\u4e0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\"><img decoding=\"async\" alt=\"\\\\begin{cases} \\\\boldsymbol w^T \\\\boldsymbol x + b &gt; 0 \\\\Rightarrow y=+1 \\\\\\\\ \\\\boldsymbol w^T \\\\boldsymbol x + b &lt; 0 \\\\Rightarrow y=-1 \\\\end{cases}\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b878511.png\" \/><\/p>\n<h4 id=\"3.%20%E9%97%B4%E9%9A%94%E4%B8%8E%E6%94%AF%E6%8C%81%E5%90%91%E9%87%8F\">3. \u95f4\u9694\u4e0e\u652f\u6301\u5411\u91cf<\/h4>\n<p style=\"margin-left:.0001pt;text-align:left\">\u95f4\u9694\u662fSVM\u7684\u6838\u5fc3\u6838\u5fc3\u6982\u5ff5&#xff0c;\u5206\u4e3a\u51fd\u6570\u95f4\u9694\u4e0e\u51e0\u4f55\u95f4\u9694&#xff0c;\u662f\u6c42\u89e3\u6700\u4f18\u8d85\u5e73\u9762\u7684\u6838\u5fc3\u4f9d\u636e\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">&#xff08;1&#xff09;\u51fd\u6570\u95f4\u9694<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u7528\u4e8e\u8868\u5f81\u6837\u672c\u5206\u7c7b\u7684\u7f6e\u4fe1\u5ea6&#xff0c;\u5355\u4e2a\u6837\u672c\u51fd\u6570\u95f4\u9694\u516c\u5f0f&#xff1a;<img decoding=\"async\" alt=\"\\\\hat{\\\\gamma}_i = y_i\\\\left(\\\\boldsymbol w^T \\\\boldsymbol x_i + b\\\\right)\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b880e74.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u51fd\u6570\u95f4\u9694\u53d7\u53c2\u6570\u7f29\u653e\u5f71\u54cd&#xff0c;\u65e0\u6cd5\u771f\u5b9e\u8868\u5f81\u6837\u672c\u8ddd\u79bb&#xff0c;\u4e0d\u80fd\u4f5c\u4e3a\u4f18\u5316\u4f9d\u636e\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">&#xff08;2&#xff09;\u51e0\u4f55\u95f4\u9694<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u6837\u672c\u5230\u8d85\u5e73\u9762\u7684\u771f\u5b9e\u5782\u76f4\u8ddd\u79bb&#xff0c;\u5177\u5907\u5c3a\u5ea6\u4e0d\u53d8\u6027&#xff0c;\u4e8c\u7ef4\u5f53\u4e2d\u5c31\u662f\u70b9\u5230\u76f4\u7ebf\u7684\u8ddd\u79bb&#xff0c;\u662fSVM\u4f18\u5316\u7684\u6838\u5fc3\u6307\u6807&#xff0c;\u516c\u5f0f&#xff1a;<img decoding=\"async\" alt=\"\\\\gamma_i=\\\\frac{\\\\left|\\\\boldsymbol w^T \\\\boldsymbol x_i+b\\\\right|}{\\\\|\\\\boldsymbol w\\\\|}\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b8895c0.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u95f4\u9694\u8fb9\u754c\u5c31\u662f&#xff0c;\u6837\u672c\u70b9\u8ddd\u79bb\u4e00\u5b9a\u8ddd\u79bb\u7684\u8fb9\u754c&#xff0c;\u5e73\u884c\u4e8e\u8d85\u5e73\u9762\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">&#xff08;3&#xff09;\u652f\u6301\u5411\u91cf&#xff1a;\u8ddd\u79bb\u6700\u4f18\u8d85\u5e73\u9762\u6700\u8fd1\u7684\u6837\u672c\u70b9&#xff0c;\u6ee1\u8db3\u51e0\u4f55\u95f4\u9694\u6700\u5c0f\u3002\u5168\u5c40\u6700\u4f18\u8d85\u5e73\u9762\u4ec5\u7531\u652f\u6301\u5411\u91cf\u552f\u4e00\u786e\u5b9a&#xff0c;\u5176\u4f59\u6837\u672c\u4e0d\u53c2\u4e0e\u6a21\u578b\u53c2\u6570\u6c42\u89e3\u3002<\/p>\n<h4 id=\"4.%20SVM%E6%A0%87%E5%87%86%E4%BC%98%E5%8C%96%E7%9B%AE%E6%A0%87\">4. SVM\u6807\u51c6\u4f18\u5316\u76ee\u6807<\/h4>\n<p style=\"margin-left:.0001pt;text-align:left\">SVM\u6700\u7ec8\u76ee\u6807&#xff1a;\u6c42\u89e3\u53c2\u6570 <img decoding=\"async\" alt=\"\\\\min_{\\\\boldsymbol w,b}\\\\frac12\\\\|\\\\boldsymbol w\\\\|^2 \\\\\\\\ \\\\text{s.t.}\\\\quad y_i\\\\left(\\\\boldsymbol w^T \\\\boldsymbol x_i + b\\\\right) \\\\ge 1,\\\\quad i=1,2,\\\\dots,n\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b8909b4.png\" \/>&#xff0c;\u6700\u5927\u5316\u5168\u5c40\u6700\u5c0f\u51e0\u4f55\u95f4\u9694&#xff0c;\u4f18\u5316\u95ee\u9898\u53ef\u7b49\u4ef7\u8f6c\u5316\u4e3a\u6807\u51c6\u51f8\u4e8c\u6b21\u89c4\u5212\u95ee\u9898&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u8be5\u7ea6\u675f\u4f18\u5316\u95ee\u9898\u53ef\u901a\u8fc7\u62c9\u683c\u6717\u65e5\u4e58\u6570\u6cd5\u6c42\u89e3&#xff0c;\u5f15\u5165\u62c9\u683c\u6717\u65e5\u7b97\u5b50\u5c06\u5e26\u7ea6\u675f\u4f18\u5316\u95ee\u9898\u8f6c\u5316\u4e3a\u65e0\u7ea6\u675f\u5bf9\u5076\u95ee\u9898&#xff0c;\u6700\u7ec8\u89e3\u51fa\u6700\u4f18\u6743\u91cdw\u4e0e\u504f\u7f6eb\u3002<\/p>\n<h3 id=\"%E4%BA%8C%E3%80%81%E7%A1%AC%E9%97%B4%E9%9A%94%20SVM%20vs%20%E8%BD%AF%E9%97%B4%E9%9A%94%20SVM\">\u4e8c\u3001\u786c\u95f4\u9694 SVM vs \u8f6f\u95f4\u9694 SVM<\/h3>\n<h4 id=\"1.%20%E7%A1%AC%E9%97%B4%E9%9A%94%EF%BC%88Hard%E2%80%91margin%20SVM%EF%BC%89\">1. \u786c\u95f4\u9694&#xff08;Hard\u2011margin SVM&#xff09;<\/h4>\n<p style=\"margin-left:.0001pt;text-align:left\">\u8981\u6c42\u6240\u6709\u6837\u672c\u5168\u90e8\u5206\u7c7b\u6b63\u786e&#xff0c;\u6837\u672c\u4e25\u683c\u5728\u95f4\u9694\u8fb9\u754c\u5916\u4fa7\u3002<\/p>\n<ul>\n<li style=\"text-align:left\">\u9002\u7528&#xff1a;\u6570\u636e\u5b8c\u5168\u7ebf\u6027\u53ef\u5206<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u7f3a\u70b9&#xff1a;\u566a\u58f0\u3001\u5f02\u5e38\u70b9\u4f1a\u5bfc\u81f4\u5b8c\u5168\u627e\u4e0d\u5230\u53ef\u884c\u89e3<\/li>\n<\/ul>\n<h4 id=\"2.%20%E8%BD%AF%E9%97%B4%E9%9A%94%EF%BC%88Soft%E2%80%91margin%20SVM%EF%BC%89\">2. \u8f6f\u95f4\u9694&#xff08;Soft\u2011margin SVM&#xff09;<\/h4>\n<p style=\"margin-left:.0001pt;text-align:left\">\u73b0\u5b9e\u6570\u636e\u5927\u591a\u4e0d\u5b8c\u5168\u7ebf\u6027\u53ef\u5206&#xff0c;\u5141\u8bb8\u5c11\u91cf\u6837\u672c\u51fa\u9519&#xff08;\u5373\u5141\u8bb8\u5c11\u5c11\u91cf\u7684\u6837\u672c\u70b9\u5728\u95f4\u9694\u8fb9\u754c\u4e4b\u5185&#xff09;&#xff0c;\u5f15\u5165\u677e\u5f1b\u53d8\u91cfC\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u4f18\u5316\u76ee\u6807&#xff1a;<\/p>\n<ul>\n<li style=\"text-align:left\">C&#xff1a;\u60e9\u7f5a\u7cfb\u6570&#xff0c;SVM \u6700\u91cd\u8981\u8d85\u53c2\u6570<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">C\u5f88\u5927&#xff1a;\u60e9\u7f5a\u9519\u5206\u6837\u672c&#xff0c;\u5c3d\u91cf\u4e0d\u5141\u8bb8\u51fa\u9519&#xff0c;\u5bb9\u6613\u8fc7\u62df\u5408&#xff0c;\u95f4\u9694\u7a84<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">C\u5f88\u5c0f&#xff1a;\u5bf9\u9519\u8bef\u5bbd\u5bb9&#xff0c;\u8ffd\u6c42\u66f4\u5927\u95f4\u9694&#xff0c;\u5bb9\u6613\u6b20\u62df\u5408<\/li>\n<\/ul>\n<h3 id=\"%E4%B8%89%E3%80%81%E6%A0%B8%E5%87%BD%E6%95%B0%EF%BC%88Kernel%20Trick%EF%BC%89\">\u4e09\u3001\u6838\u51fd\u6570&#xff08;Kernel Trick&#xff09;<\/h3>\n<p style=\"margin-left:.0001pt;text-align:left\">\u5f88\u591a\u6837\u672c\u7ebf\u6027\u4e0d\u53ef\u5206&#xff0c;\u4f4e\u7ef4\u627e\u4e0d\u5230\u5206\u5272\u8d85\u5e73\u9762&#xff0c;\u628a\u6837\u672c\u6620\u5c04\u5230\u9ad8\u7ef4\u7a7a\u95f4&#xff0c;\u5728\u9ad8\u7ef4\u5b9e\u73b0\u7ebf\u6027\u53ef\u5206\u3002<\/p>\n<table cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"vertical-align:top;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;text-align:left\"><span style=\"color:#646a73\">\u6838\u6280\u5de7&#xff1a;\u4e0d\u663e\u5f0f\u8ba1\u7b97\u9ad8\u7ef4\u6620\u5c04&#xff0c;\u76f4\u63a5\u901a\u8fc7\u6838\u51fd\u6570\u8ba1\u7b97\u6837\u672c\u5728\u9ad8\u7ef4\u7684\u5185\u79ef&#xff0c;\u5927\u5e45\u964d\u4f4e\u8ba1\u7b97\u5f00\u9500\u3002<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;text-align:left\">\u5e38\u7528\u6838\u51fd\u6570&#xff1a;<\/p>\n<h4 id=\"1.%20%E7%BA%BF%E6%80%A7%E6%A0%B8%EF%BC%88linear%EF%BC%89\">1. \u7ebf\u6027\u6838&#xff08;linear&#xff09;<\/h4>\n<p style=\"text-align:left\"><img decoding=\"async\" alt=\"K(x_i,x_j)=x_i^\\\\mathrm{T} x_j\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b89bf42.png\" \/><\/p>\n<p style=\"text-align:left\">\u7b49\u4ef7\u666e\u901a\u7ebf\u6027\u5206\u7c7b&#xff0c;\u901f\u5ea6\u5feb&#xff0c;\u7279\u5f81\u6570\u591a\u65f6\u4f18\u5148\u9009\u3002<\/p>\n<h4 id=\"2.%20%E9%AB%98%E6%96%AF%20RBF%20%E6%A0%B8%EF%BC%88%E5%BE%84%E5%90%91%E5%9F%BA%E6%A0%B8%EF%BC%8C%E6%9C%80%E5%B8%B8%E7%94%A8%EF%BC%89\">2. \u9ad8\u65af RBF \u6838&#xff08;\u5f84\u5411\u57fa\u6838&#xff0c;\u6700\u5e38\u7528&#xff09;<\/h4>\n<p><img decoding=\"async\" alt=\"K(x_i,x_j)=\\\\exp\\\\big(-\\\\gamma\\\\,\\\\|x_i-x_j\\\\|^2\\\\big)\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b8a3658.png\" \/><\/p>\n<ul>\n<li style=\"text-align:left\">\u03b3&#xff1a;\u63a7\u5236\u6838\u7684\u4f5c\u7528\u8303\u56f4<\/li>\n<li style=\"text-align:left\">\u03b3\u8fc7\u5927&#xff1a;\u8fc7\u62df\u5408&#xff1b;\u8fc7\u5c0f&#xff1a;\u6b20\u62df\u5408<\/li>\n<\/ul>\n<h4 id=\"3.%20%E5%A4%9A%E9%A1%B9%E5%BC%8F%E6%A0%B8%EF%BC%88poly%EF%BC%89\">3. \u591a\u9879\u5f0f\u6838&#xff08;poly&#xff09;<\/h4>\n<p style=\"margin-left:.0001pt;text-align:left\"><img decoding=\"async\" alt=\"K(x_i,x_j)=\\\\big(\\\\gamma\\\\,x_i^\\\\mathrm{T}x_j + r\\\\big)^d\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b8acc3a.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u9002\u5408\u7279\u5f81\u6709\u7ec4\u5408\u5173\u7cfb\u7684\u573a\u666f\u3002<\/p>\n<table cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"vertical-align:top;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;text-align:left\"><span style=\"color:#646a73\">\u7ecf\u9a8c&#xff1a;\u4e0d\u77e5\u9053\u9009\u4ec0\u4e48\u6838&#xff0c;\u4f18\u5148\u5c1d\u8bd5 <\/span><span style=\"background-color:#eff0f1\"><span style=\"color:#646a73\">RBF<\/span><\/span><span style=\"color:#646a73\">&#xff1b;\u7279\u5f81\u7ef4\u5ea6\u5f88\u9ad8\u4f18\u5148 <\/span><span style=\"background-color:#eff0f1\"><span style=\"color:#646a73\">linear<\/span><\/span><span style=\"color:#646a73\">\u3002<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"%E5%9B%9B%E3%80%81%E6%A0%B8%E5%BF%83API%E4%B8%8E%E8%B6%85%E5%8F%82%E6%95%B0%E8%AF%A6%E8%A7%A3\">\u56db\u3001\u6838\u5fc3API\u4e0e\u8d85\u53c2\u6570\u8be6\u89e3<\/h3>\n<p style=\"margin-left:.0001pt;text-align:left\">\u652f\u6301\u5411\u91cf\u673a\u5206\u7c7b\u6a21\u578b\u6838\u5fc3\u8c03\u7528\u63a5\u53e3\u4e3a <span style=\"background-color:#eff0f1\">SVC<\/span>&#xff0c;\u57fa\u4e8esklearn\u5e93\u5b9e\u73b0&#xff0c;\u6807\u51c6\u5bfc\u5165\u4e0e\u521d\u59cb\u5316\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>python<br \/>\n# \u5bfc\u5165SVM\u5206\u7c7b\u6a21\u578b<br \/>\nfrom sklearn.svm import SVC<br \/>\n\u6a21\u578b\u521d\u59cb\u5316\u901a\u7528\u683c\u5f0f<br \/>\nsvc_model &#061; SVC(kernel, gamma, C, random_state) <\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u5404\u6838\u5fc3\u8d85\u53c2\u6570\u7cbe\u7ec6\u5316\u91ca\u4e49\u5982\u4e0b&#xff1a;<\/p>\n<li style=\"text-align:left\">kernel&#xff08;\u6838\u51fd\u6570&#xff09;&#xff1a;\u8bbe\u5b9a\u6a21\u578b\u6620\u5c04\u65b9\u5f0f&#xff0c;\u53ef\u9009 <span style=\"background-color:#eff0f1\">linear<\/span>\u7ebf\u6027\u6838\u3001<span style=\"background-color:#eff0f1\">rbf<\/span>\u9ad8\u65af\u6838\u3001<span style=\"background-color:#eff0f1\">poly<\/span>\u591a\u9879\u5f0f\u6838&#xff0c;\u9ed8\u8ba4\u9ad8\u65af\u6838&#xff0c;\u9002\u914d\u5927\u591a\u6570\u975e\u7ebf\u6027\u5206\u7c7b\u573a\u666f\u3002<\/li>\n<li style=\"text-align:left\">C&#xff08;\u60e9\u7f5a\u7cfb\u6570&#xff09;&#xff1a;\u8f6f\u95f4\u9694SVM\u6838\u5fc3\u53c2\u6570&#xff0c;\u7528\u4e8e\u5e73\u8861\u6a21\u578b\u590d\u6742\u5ea6\u4e0e\u5206\u7c7b\u8bef\u5dee\u3002\u6570\u503c\u8d8a\u5927&#xff0c;\u5bf9\u8bef\u5206\u7c7b\u6837\u672c\u60e9\u7f5a\u8d8a\u91cd&#xff0c;\u6613\u8fc7\u62df\u5408&#xff1b;\u6570\u503c\u8d8a\u5c0f&#xff0c;\u6a21\u578b\u5bb9\u9519\u6027\u8d8a\u9ad8&#xff0c;\u6613\u6b20\u62df\u5408\u3002<\/li>\n<li style=\"text-align:left\">gamma&#xff08;\u6838\u51fd\u6570\u7cfb\u6570&#xff09;&#xff1a;\u4ec5\u4f5c\u7528\u4e8eRBF\u9ad8\u65af\u6838&#xff0c;\u63a7\u5236\u6837\u672c\u4f5c\u7528\u8f90\u5c04\u8303\u56f4\u3002\u6570\u503c\u8fc7\u5927\u7f29\u5c0f\u4f5c\u7528\u533a\u95f4\u3001\u6613\u8fc7\u62df\u5408&#xff1b;\u6570\u503c\u8fc7\u5c0f\u6269\u5927\u4f5c\u7528\u533a\u95f4\u3001\u6613\u6b20\u62df\u5408\u3002<\/li>\n<li style=\"text-align:left\">random_state&#xff08;\u968f\u673a\u79cd\u5b50&#xff09;&#xff1a;\u56fa\u5b9a\u6a21\u578b\u968f\u673a\u8fd0\u7b97\u903b\u8f91&#xff0c;\u4fdd\u8bc1\u5b9e\u9a8c\u7ed3\u679c\u53ef\u590d\u73b0&#xff0c;\u4fbf\u4e8e\u53c2\u6570\u8c03\u4f18\u4e0e\u7ed3\u679c\u5bf9\u6bd4\u3002<\/li>\n<h3 id=\"%E4%BA%94%E3%80%81%E5%AE%9E%E6%88%98%E6%A1%88%E4%BE%8B%EF%BC%9ASVM%E5%A4%9A%E5%8F%82%E6%95%B0%E7%BD%91%E6%A0%BC%E5%AF%BB%E4%BC%98%E5%88%86%E7%B1%BB%E5%BB%BA%E6%A8%A1\">\u4e94\u3001\u5b9e\u6218\u6848\u4f8b&#xff1a;SVM\u591a\u53c2\u6570\u7f51\u683c\u5bfb\u4f18\u5206\u7c7b\u5efa\u6a21<\/h3>\n<p style=\"margin-left:.0001pt;text-align:left\">\u672c\u7ae0\u8282\u57fa\u4e8e\u6570\u636e\u96c6datingTestSet\u5b8c\u6210SVM\u5206\u7c7b\u5b9e\u6218&#xff0c;\u7ed3\u5408\u7279\u5f81\u6807\u51c6\u5316\u300110\u6298\u4ea4\u53c9\u9a8c\u8bc1\u3001\u591a\u53c2\u6570\u7f51\u683c\u904d\u5386\u5bfb\u4f18&#xff0c;\u81ea\u52a8\u7b5b\u9009\u6700\u4f18\u6838\u51fd\u6570\u3001\u60e9\u7f5a\u7cfb\u6570\u3001Gamma\u53c2\u6570&#xff0c;\u6784\u5efa\u6700\u4f18SVM\u5206\u7c7b\u6a21\u578b&#xff0c;\u540c\u65f6\u5b8c\u6210\u6a21\u578b\u8bad\u7ec3\u3001\u6d4b\u8bd5\u4e0e\u53ef\u89c6\u5316\u8bc4\u4f30\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:left\">\u6570\u636e\u96c6&#xff1a;\u901f\u901a\u673a\u5668\u5b66\u4e6010&#xff5c;\u652f\u6301\u5411\u91cf\u673aSVM\u8d44\u6e90-CSDN\u4e0b\u8f7d<\/p>\n<p># \u5bfc\u5165\u6240\u9700\u5de5\u5177\u5e93<br \/>\nimport numpy as np<br \/>\nimport pandas as pd<br \/>\nimport matplotlib.pyplot as plt<br \/>\nfrom sklearn.svm import SVC<br \/>\nfrom sklearn import metrics<br \/>\nfrom sklearn.model_selection import train_test_split, cross_val_score<br \/>\nfrom sklearn.preprocessing import StandardScaler<br \/>\nfrom sklearn.metrics import confusion_matrix<\/p>\n<p># 1. \u81ea\u5b9a\u4e49\u6df7\u6dc6\u77e9\u9635\u53ef\u89c6\u5316\u51fd\u6570<br \/>\ndef cm_plot(y, yp):<br \/>\n    # \u8ba1\u7b97\u6df7\u6dc6\u77e9\u9635<br \/>\n    cm &#061; confusion_matrix(y, yp)<br \/>\n    # \u7ed8\u5236\u6df7\u6dc6\u77e9\u9635\u70ed\u529b\u56fe<br \/>\n    plt.matshow(cm, cmap&#061;plt.cm.Blues)<br \/>\n    plt.colorbar()<br \/>\n    # \u904d\u5386\u586b\u5145\u77e9\u9635\u6570\u503c<br \/>\n    for x in range(len(cm)):<br \/>\n        for y in range(len(cm)):<br \/>\n            plt.annotate(cm[x, y], xy&#061;(y, x), ha&#061;&#034;center&#034;, va&#061;&#034;center&#034;)<br \/>\n    plt.ylabel(&#039;True label&#039;)   # \u771f\u5b9e\u6807\u7b7e<br \/>\n    plt.xlabel(&#039;Predicted label&#039;)# \u9884\u6d4b\u6807\u7b7e<br \/>\n    return plt<\/p>\n<p># 2. \u6570\u636e\u96c6\u8bfb\u53d6\u4e0e\u5212\u5206<br \/>\n# \u8bfb\u53d6\u5236\u8868\u7b26\u5206\u9694\u7684\u76f8\u4eb2\u6570\u636e\u96c6<br \/>\ndatas &#061; pd.read_csv(r&#039;D:\\\\pythoncode2\\\\bigdata_ai40\\\\\u673a\u68b0\u5b66\u4e60\\\\data\\\\datingTestSet2.txt&#039;, sep&#061;&#039;\\\\t&#039;, header&#061;None)<br \/>\n# \u62c6\u5206\u7279\u5f81\u96c6\u4e0e\u6807\u7b7e\u96c6<br \/>\ndata &#061; datas.iloc[:, :-1]   # \u6240\u6709\u5217\u9664\u6700\u540e\u4e00\u5217\u4e3a\u7279\u5f81<br \/>\nlabels &#061; datas.iloc[:, -1]  # \u6700\u540e\u4e00\u5217\u4e3a\u5206\u7c7b\u6807\u7b7e<\/p>\n<p># 3. \u7279\u5f81\u6807\u51c6\u5316&#xff08;SVM\u5fc5\u5907\u9884\u5904\u7406&#xff09;<br \/>\nscaler &#061; StandardScaler()<br \/>\n# \u5212\u52068:2\u8bad\u7ec3\u96c6\u3001\u6d4b\u8bd5\u96c6<br \/>\nx_train, x_test, y_train, y_test &#061; train_test_split(data, labels, test_size&#061;0.2, random_state&#061;42)<br \/>\n# \u8bad\u7ec3\u96c6\u62df\u5408\u5e76\u6807\u51c6\u5316&#xff0c;\u6d4b\u8bd5\u96c6\u4ec5\u505a\u6807\u51c6\u5316&#xff08;\u907f\u514d\u6570\u636e\u6cc4\u9732&#xff09;<br \/>\nx_train &#061; scaler.fit_transform(x_train)<br \/>\nx_test &#061; scaler.transform(x_test)<\/p>\n<p># 4. \u591a\u53c2\u6570\u7f51\u683c\u904d\u5386&#043;10\u6298\u4ea4\u53c9\u9a8c\u8bc1\u5bfb\u4f18<br \/>\n# \u5b9a\u4e49\u8d85\u53c2\u6570\u904d\u5386\u8303\u56f4<br \/>\nc_list &#061; [0.1, 0.5, 1, 10, 100]        # \u60e9\u7f5a\u7cfb\u6570C\u53d6\u503c<br \/>\nkernels &#061; [&#034;poly&#034;, &#034;rbf&#034;, &#034;sigmoid&#034;]   # \u4e09\u7c7b\u6838\u51fd\u6570<br \/>\ngammas &#061; [0.001, 0.01, 0.1, 1, 2]      # RBF\u6838gamma\u7cfb\u6570\u53d6\u503c<\/p>\n<p># \u521d\u59cb\u5316\u6700\u4f18\u53c2\u6570\u4e0e\u7cbe\u5ea6\u5b58\u50a8\u53d8\u91cf<br \/>\nbest_accuracy &#061; 0.0<br \/>\nbest_params &#061; {&#039;C&#039;: 0, &#039;kernel&#039;: &#039;&#039;, &#039;gamma&#039;: 0}<\/p>\n<p># \u4e09\u91cd\u5faa\u73af\u904d\u5386\u6240\u6709\u53c2\u6570\u7ec4\u5408<br \/>\nfor c in c_list:<br \/>\n    for kernel in kernels:<br \/>\n        for gamma in gammas:<br \/>\n            # \u521d\u59cb\u5316SVM\u6a21\u578b<br \/>\n            sv_model &#061; SVC(kernel&#061;kernel, gamma&#061;gamma, C&#061;c, random_state&#061;42)<br \/>\n            # 10\u6298\u4ea4\u53c9\u9a8c\u8bc1\u8ba1\u7b97\u5e73\u5747\u51c6\u786e\u7387<br \/>\n            cv_scores &#061; cross_val_score(sv_model, x_train, y_train, cv&#061;10, scoring&#061;&#039;accuracy&#039;)<br \/>\n            mean_score &#061; np.mean(cv_scores)<br \/>\n            # \u6253\u5370\u6bcf\u7ec4\u53c2\u6570\u7684\u9a8c\u8bc1\u6548\u679c<br \/>\n            print(f&#034;\u6838\u51fd\u6570:{kernel:6s} | Gamma:{gamma:4f} | \u60e9\u7f5a\u7cfb\u6570C:{c:4.1f} | \u4ea4\u53c9\u9a8c\u8bc1\u51c6\u786e\u7387:{mean_score:.4f}&#034;)<br \/>\n            # \u66f4\u65b0\u6700\u4f18\u53c2\u6570\u7ec4\u5408<br \/>\n            if mean_score &gt; best_accuracy:<br \/>\n                best_accuracy &#061; mean_score<br \/>\n                best_params[&#039;C&#039;] &#061; c<br \/>\n                best_params[&#039;kernel&#039;] &#061; kernel<br \/>\n                best_params[&#039;gamma&#039;] &#061; gamma<\/p>\n<p># \u8f93\u51fa\u5168\u5c40\u6700\u4f18\u8d85\u53c2\u6570<br \/>\nprint(&#034;&#061;&#034;*80)<br \/>\nprint(f&#034;\u6700\u4f18\u53c2\u6570\u7ec4\u5408&#xff1a;{best_params}&#034;)<br \/>\nprint(f&#034;\u6700\u4f18\u8bad\u7ec3\u96c6\u4ea4\u53c9\u9a8c\u8bc1\u51c6\u786e\u7387&#xff1a;{best_accuracy:.4f}&#034;)<br \/>\nprint(&#034;&#061;&#034;*80)<\/p>\n<p># 5. \u57fa\u4e8e\u6700\u4f18\u53c2\u6570\u8bad\u7ec3\u6700\u7ec8SVM\u6a21\u578b<br \/>\nfinal_svm &#061; SVC(<br \/>\n    kernel&#061;best_params[&#039;kernel&#039;],<br \/>\n    C&#061;best_params[&#039;C&#039;],<br \/>\n    gamma&#061;best_params[&#039;gamma&#039;],<br \/>\n    random_state&#061;42<br \/>\n)<br \/>\nfinal_svm.fit(x_train, y_train)<\/p>\n<p># 6. \u8bad\u7ec3\u96c6\u6a21\u578b\u8bc4\u4f30<br \/>\ntrain_pred &#061; final_svm.predict(x_train)<br \/>\nprint(&#034;\\\\n\u3010\u8bad\u7ec3\u96c6\u5206\u7c7b\u8bc4\u4f30\u62a5\u544a\u3011&#034;)<br \/>\nprint(metrics.classification_report(y_train, train_pred))<br \/>\ncm_plot(y_train, train_pred).show()<\/p>\n<p># 7. \u6d4b\u8bd5\u96c6\u6cdb\u5316\u80fd\u529b\u8bc4\u4f30<br \/>\ntest_pred &#061; final_svm.predict(x_test)<br \/>\nprint(&#034;\\\\n\u3010\u6d4b\u8bd5\u96c6\u6cdb\u5316\u8bc4\u4f30\u62a5\u544a\u3011&#034;)<br \/>\nprint(metrics.classification_report(y_test, test_pred))<br \/>\ncm_plot(y_test, test_pred).show()<\/p>\n<h3 id=\"%E5%85%AD%E3%80%81%E7%AB%A0%E8%8A%82%E6%80%BB%E7%BB%93\">\u516d\u3001\u7ae0\u8282\u603b\u7ed3<\/h3>\n<p style=\"margin-left:.0001pt;text-align:left\">\u672c\u7ae0\u5bf9\u652f\u6301\u5411\u91cf\u673a&#xff08;SVM&#xff09;\u6838\u5fc3\u539f\u7406\u3001\u7279\u6027\u4e0e\u9002\u7528\u573a\u666f\u8fdb\u884c\u7cfb\u7edf\u6027\u603b\u7ed3&#xff0c;\u5206\u70b9\u5f52\u7eb3\u5982\u4e0b&#xff1a;<\/p>\n<li style=\"text-align:left\">\u6838\u5fc3\u539f\u7406&#xff1a;SVM\u662f\u7406\u8bba\u4f53\u7cfb\u4e25\u8c28\u7684\u7ecf\u5178\u5224\u522b\u5f0f\u5206\u7c7b\u7b97\u6cd5&#xff0c;\u6838\u5fc3\u9075\u5faa\u6700\u8fd1\u6837\u672c\u3001\u6700\u5927\u95f4\u9694\u51c6\u5219\u3002\u4f9d\u6258\u51fd\u6570\u95f4\u9694\u4e0e\u51e0\u4f55\u95f4\u9694\u53cc\u91cd\u7ea6\u675f&#xff0c;\u901a\u8fc7\u51f8\u4e8c\u6b21\u89c4\u5212\u3001\u62c9\u683c\u6717\u65e5\u5bf9\u5076\u4f18\u5316\u6c42\u89e3\u5168\u5c40\u6700\u4f18\u8d85\u5e73\u9762&#xff0c;\u6a21\u578b\u53c2\u6570\u53ef\u901a\u8fc7\u4e25\u683c\u6570\u5b66\u63a8\u5bfc\u5f97\u51fa&#xff0c;\u5177\u5907\u8f83\u5f3a\u53ef\u89e3\u91ca\u6027\u3002<\/li>\n<li style=\"text-align:left\">\u6838\u5fc3\u4f18\u52bf&#xff1a;\u7b97\u6cd5\u6cdb\u5316\u80fd\u529b\u4f18\u5f02&#xff0c;\u4ec5\u4f9d\u9760\u652f\u6301\u5411\u91cf\u786e\u5b9a\u6700\u4f18\u5206\u7c7b\u9762&#xff0c;\u6709\u6548\u89c4\u907f\u5197\u4f59\u6837\u672c\u5e72\u6270&#xff1b;\u9002\u914d\u5c0f\u6837\u672c\u3001\u9ad8\u7ef4\u7279\u5f81\u6570\u636e\u96c6&#xff0c;\u5206\u7c7b\u7cbe\u5ea6\u9ad8&#xff0c;\u7ed3\u5408\u6838\u51fd\u6570\u53ef\u9ad8\u6548\u5904\u7406\u7ebf\u6027\u4e0d\u53ef\u5206\u95ee\u9898\u3002<\/li>\n<li style=\"text-align:left\">\u7b97\u6cd5\u5c40\u9650&#xff1a;\u65f6\u95f4\u590d\u6742\u5ea6\u8f83\u9ad8&#xff0c;\u6a21\u578b\u8bad\u7ec3\u8fd0\u7b97\u6210\u672c\u5927&#xff1b;\u9762\u5bf9\u5341\u4e07\u7ea7\u4ee5\u4e0a\u6d77\u91cf\u6570\u636e\u96c6&#xff0c;\u8bad\u7ec3\u8017\u65f6\u663e\u8457\u589e\u52a0&#xff0c;\u6c42\u89e3\u6548\u7387\u5927\u5e45\u964d\u4f4e&#xff0c;\u96be\u4ee5\u62df\u5408\u6700\u4f18\u8d85\u5e73\u9762\u3002<\/li>\n<li style=\"text-align:left\">\u9002\u7528\u573a\u666f&#xff1a;\u4f18\u5148\u5e94\u7528\u4e8e\u4e2d\u5c0f\u89c4\u6a21\u3001\u9ad8\u7ef4\u5ea6\u7684\u6570\u636e\u5206\u7c7b\u4efb\u52a1&#xff1b;\u4e0d\u9002\u5408\u8d85\u5927\u6279\u91cf\u6d77\u91cf\u6570\u636e\u5efa\u6a21&#xff0c;\u8be5\u573a\u666f\u4e0b\u8bad\u7ec3\u6548\u7387\u4e0e\u62df\u5408\u6548\u679c\u5747\u4e0d\u7406\u60f3\u3002<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55 \u524d\u8a00<br \/>\n\u4e00\u3001\u6838\u5fc3\u57fa\u7840\u6982\u5ff5<br \/>\n1. \u7b97\u6cd5\u6838\u5fc3\u5b9a\u4f4d&#xff08;\u4e0e\u903b\u8f91\u56de\u5f52\u5bf9\u6bd4&#xff09;<br \/>\n2. \u8d85\u5e73\u9762\u6570\u5b66\u5b9a\u4e49<br \/>\n3. \u95f4\u9694\u4e0e\u652f\u6301\u5411\u91cf<br \/>\n4. SVM\u6807\u51c6\u4f18\u5316\u76ee\u6807<br \/>\n\u4e8c\u3001\u786c\u95f4\u9694 SVM vs \u8f6f\u95f4\u9694 SVM<br \/>\n1. \u786c\u95f4\u9694&#xff08;Hard\u2011margin SVM&#xff09;<br \/>\n2. \u8f6f\u95f4\u9694&#xff08;Soft\u2011margin SVM&#xff09;<br \/>\n\u4e09\u3001\u6838\u51fd\u6570&#xff08;Kernel Trick&#xff09;<br \/>\n1. \u7ebf\u6027\u6838&#xff08;li<\/p>\n","protected":false},"author":2,"featured_media":92220,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[50,2792,207],"topic":[],"class_list":["post-92228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-50","tag-2792","tag-207"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u901f\u901a\u673a\u5668\u5b66\u4e60 10\uff5c\u652f\u6301\u5411\u91cf\u673a SVM - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/92228.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u901f\u901a\u673a\u5668\u5b66\u4e60 10\uff5c\u652f\u6301\u5411\u91cf\u673a SVM - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 \u524d\u8a00 \u4e00\u3001\u6838\u5fc3\u57fa\u7840\u6982\u5ff5 1. \u7b97\u6cd5\u6838\u5fc3\u5b9a\u4f4d&#xff08;\u4e0e\u903b\u8f91\u56de\u5f52\u5bf9\u6bd4&#xff09; 2. \u8d85\u5e73\u9762\u6570\u5b66\u5b9a\u4e49 3. \u95f4\u9694\u4e0e\u652f\u6301\u5411\u91cf 4. SVM\u6807\u51c6\u4f18\u5316\u76ee\u6807 \u4e8c\u3001\u786c\u95f4\u9694 SVM vs \u8f6f\u95f4\u9694 SVM 1. \u786c\u95f4\u9694&#xff08;Hard\u2011margin SVM&#xff09; 2. \u8f6f\u95f4\u9694&#xff08;Soft\u2011margin SVM&#xff09; \u4e09\u3001\u6838\u51fd\u6570&#xff08;Kernel Trick&#xff09; 1. \u7ebf\u6027\u6838&#xff08;li\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/92228.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-09T11:17:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b86f102.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92228.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/92228.html\",\"name\":\"\u901f\u901a\u673a\u5668\u5b66\u4e60 10\uff5c\u652f\u6301\u5411\u91cf\u673a SVM - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-09T11:17:13+00:00\",\"dateModified\":\"2026-08-09T11:17:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/92228.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/92228.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92228.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u901f\u901a\u673a\u5668\u5b66\u4e60 10\uff5c\u652f\u6301\u5411\u91cf\u673a SVM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u901f\u901a\u673a\u5668\u5b66\u4e60 10\uff5c\u652f\u6301\u5411\u91cf\u673a SVM - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/92228.html","og_locale":"zh_CN","og_type":"article","og_title":"\u901f\u901a\u673a\u5668\u5b66\u4e60 10\uff5c\u652f\u6301\u5411\u91cf\u673a SVM - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 \u524d\u8a00 \u4e00\u3001\u6838\u5fc3\u57fa\u7840\u6982\u5ff5 1. \u7b97\u6cd5\u6838\u5fc3\u5b9a\u4f4d&#xff08;\u4e0e\u903b\u8f91\u56de\u5f52\u5bf9\u6bd4&#xff09; 2. \u8d85\u5e73\u9762\u6570\u5b66\u5b9a\u4e49 3. \u95f4\u9694\u4e0e\u652f\u6301\u5411\u91cf 4. SVM\u6807\u51c6\u4f18\u5316\u76ee\u6807 \u4e8c\u3001\u786c\u95f4\u9694 SVM vs \u8f6f\u95f4\u9694 SVM 1. \u786c\u95f4\u9694&#xff08;Hard\u2011margin SVM&#xff09; 2. \u8f6f\u95f4\u9694&#xff08;Soft\u2011margin SVM&#xff09; \u4e09\u3001\u6838\u51fd\u6570&#xff08;Kernel Trick&#xff09; 1. \u7ebf\u6027\u6838&#xff08;li","og_url":"https:\/\/www.wsisp.com\/helps\/92228.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-09T11:17:13+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809111712-6a7861b86f102.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/92228.html","url":"https:\/\/www.wsisp.com\/helps\/92228.html","name":"\u901f\u901a\u673a\u5668\u5b66\u4e60 10\uff5c\u652f\u6301\u5411\u91cf\u673a SVM - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-09T11:17:13+00:00","dateModified":"2026-08-09T11:17:13+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/92228.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/92228.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/92228.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u901f\u901a\u673a\u5668\u5b66\u4e60 10\uff5c\u652f\u6301\u5411\u91cf\u673a SVM"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=92228"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92228\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/92220"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=92228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=92228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=92228"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=92228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}