{"id":46972,"date":"2023-08-06T13:55:12","date_gmt":"2023-08-06T05:55:12","guid":{"rendered":"https:\/\/docs.pingcode.com\/?p=46972"},"modified":"2023-08-06T13:55:13","modified_gmt":"2023-08-06T05:55:13","slug":"%e4%bb%80%e4%b9%88%e6%98%af%e4%b8%80%e7%b1%bb%e6%94%af%e6%8c%81%e5%90%91%e9%87%8f%e6%9c%ba","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/46972.html","title":{"rendered":"\u4ec0\u4e48\u662f\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\">\n<p>\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\uff08OC-SVM\uff09\u662f\u652f\u6301\u5411\u91cf\u673a\uff08SVM\uff09\u7684\u4e00\u79cd\u53d8\u79cd\uff0c\u7528\u4e8e\u89e3\u51b3\u5355\u7c7b\u522b\u5206\u7c7b\u95ee\u9898\u3002\u5728\u4f20\u7edf\u7684\u4e8c\u5206\u7c7b\u95ee\u9898\u4e2d\uff0cSVM\u7684\u76ee\u6807\u662f\u627e\u5230\u4e00\u4e2a\u8d85\u5e73\u9762\uff0c\u5c06\u4e24\u7c7b\u6570\u636e\u70b9\u5206\u5f00\u3002\u800c\u5728\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\u4e2d\uff0c\u76ee\u6807\u662f\u627e\u5230\u4e00\u4e2a\u8d85\u5e73\u9762\uff0c\u5c06\u5355\u7c7b\u522b\u7684\u6570\u636e\u70b9\u5305\u56f4\u5728\u5176\u5185\u90e8\uff0c\u540c\u65f6\u5c3d\u91cf\u4f7f\u5f97\u8d85\u5e73\u9762\u7684\u8fb9\u754c\u4e0e\u6570\u636e\u70b9\u4e4b\u95f4\u7684\u8ddd\u79bb\u6700\u5927\u5316\u3002<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"576\" data-id=\"46973\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/08\/4-2-1024x576.png?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\" class=\"wp-image-46973\" srcset=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/08\/4-2-1024x576.png 1024w, https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/08\/4-2-300x169.png 300w, https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/08\/4-2-768x432.png 768w, https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/08\/4-2-270x152.png 270w, https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/08\/4-2-1536x865.png 1536w, https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/08\/4-2.png 1993w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\u7684\u6982\u5ff5 <\/h2>\n\n\n\n<p>\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\uff08One-Class Support Vector Machine\uff0c\u7b80\u79f0OC-SVM\uff09\u662f\u652f\u6301\u5411\u91cf\u673a\uff08SVM\uff09\u7684\u4e00\u79cd\u53d8\u79cd\uff0c\u7528\u4e8e\u89e3\u51b3\u5355\u7c7b\u522b\u5206\u7c7b\u95ee\u9898\u3002\u5728\u4f20\u7edf\u7684\u4e8c\u5206\u7c7b\u95ee\u9898\u4e2d\uff0cSVM\u7684\u76ee\u6807\u662f\u627e\u5230\u4e00\u4e2a\u8d85\u5e73\u9762\uff0c\u5c06\u4e24\u7c7b\u6570\u636e\u70b9\u5206\u5f00\u3002\u800c\u5728\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\u4e2d\uff0c\u76ee\u6807\u662f\u627e\u5230\u4e00\u4e2a\u8d85\u5e73\u9762\uff0c\u5c06\u5355\u7c7b\u522b\u7684\u6570\u636e\u70b9\u5305\u56f4\u5728\u5176\u5185\u90e8\uff0c\u540c\u65f6\u5c3d\u91cf\u4f7f\u5f97\u8d85\u5e73\u9762\u7684\u8fb9\u754c\u4e0e\u6570\u636e\u70b9\u4e4b\u95f4\u7684\u8ddd\u79bb\u6700\u5927\u5316\u3002<\/p>\n\n\n\n<p>\u5728\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\u4e2d\uff0c\u53ea\u6709\u4e00\u4e2a\u7c7b\u522b\u7684\u6570\u636e\u88ab\u79f0\u4e3a\u6b63\u7c7b\uff08positive class\uff09\uff0c\u800c\u5176\u4ed6\u6570\u636e\u5219\u88ab\u8ba4\u4e3a\u662f\u5f02\u5e38\u6216\u566a\u58f0\uff08negative class\uff09\u3002OC-SVM\u7684\u4e3b\u8981\u601d\u60f3\u662f\u901a\u8fc7\u627e\u5230\u4e00\u4e2a\u4f18\u5f02\u7684\u8d85\u5e73\u9762\u6765\u62df\u5408\u6b63\u7c7b\u6570\u636e\uff0c\u5e76\u4f7f\u5f97\u5728\u8fd9\u4e2a\u8d85\u5e73\u9762\u4e0a\u7684\u6295\u5f71\u70b9\u5c3d\u91cf\u96c6\u4e2d\u5728\u8d85\u5e73\u9762\u7684\u4e2d\u5fc3\uff0c\u540c\u65f6\u6700\u5c0f\u5316\u5f02\u5e38\u6570\u636e\u70b9\u4e0e\u8d85\u5e73\u9762\u4e4b\u95f4\u7684\u8ddd\u79bb\u3002<\/p>\n\n\n\n<p>OC-SVM\u7684\u76ee\u6807\u51fd\u6570\u901a\u5e38\u53ef\u4ee5\u8868\u793a\u4e3a\uff1a<\/p>\n\n\n\n<p>minimize:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(1\/2) * ||w||^2 + (1\/\u03bd) * \u03a3\u03be_i - \u03c1<\/code><\/pre>\n\n\n\n<p>subject to:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">w^T * \u03c6(x_i) \u2265 \u03c1 - \u03be_i,   for all positive class data points x_i\r\n\u03be_i \u2265 0,                 for all positive class data points x_i\r<\/pre>\n\n\n\n<p>\u5176\u4e2d\uff0cw\u662f\u8d85\u5e73\u9762\u7684\u6cd5\u5411\u91cf\uff0c\u03c6(x_i)\u662f\u6570\u636e\u70b9 x_i \u5728\u7279\u5f81\u7a7a\u95f4\u4e2d\u7684\u6620\u5c04\uff0c\u03be_i\u662f\u677e\u5f1b\u53d8\u91cf\uff0c\u03bd\u662f\u4e00\u4e2a\u7528\u6237\u5b9a\u4e49\u7684\u53c2\u6570\u7528\u4e8e\u63a7\u5236\u6b63\u7c7b\u6570\u636e\u70b9\u7684\u62df\u5408\u7a0b\u5ea6\uff0c\u03c1\u662f\u8d85\u5e73\u9762\u7684\u504f\u7f6e\u9879\u3002<\/p>\n\n\n\n<p>OC-SVM\u7684\u4f18\u70b9\u662f\u80fd\u591f\u5728\u5355\u7c7b\u522b\u6570\u636e\u4e2d\u5bfb\u627e\u5f02\u5e38\u503c\u6216\u79bb\u7fa4\u70b9\uff0c\u53ef\u4ee5\u7528\u4e8e\u5f02\u5e38\u68c0\u6d4b\u3001\u566a\u58f0\u53bb\u9664\u7b49\u5e94\u7528\u3002\u7136\u800c\uff0cOC-SVM\u7684\u6027\u80fd\u9ad8\u5ea6\u4f9d\u8d56\u4e8e\u8d85\u53c2\u6570\u7684\u9009\u62e9\u548c\u7279\u5f81\u5de5\u7a0b\u7684\u8d28\u91cf\uff0c\u9700\u8981\u4ed4\u7ec6\u8c03\u6574\u4ee5\u83b7\u5f97\u597d\u7684\u7ed3\u679c\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6839\u636e\u5177\u4f53\u95ee\u9898\u7684\u7279\u70b9\u9009\u62e9\u5408\u9002\u7684OC-SVM\u6a21\u578b\u548c\u53c2\u6570\u8bbe\u7f6e\u975e\u5e38\u91cd\u8981\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\u7684\u7279\u70b9<\/h2>\n\n\n\n<p><strong>1\u3001\u7528\u4e8e\u4e8c\u5206\u7c7b\u95ee\u9898<\/strong><\/p>\n\n\n\n<p>\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\u662f\u4e00\u79cd\u4e8c\u5206\u7c7b\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\uff0c\u5373\u5b83\u4e3b\u8981\u7528\u4e8e\u5c06\u6570\u636e\u5206\u4e3a\u4e24\u4e2a\u7c7b\u522b\uff1a\u6b63\u7c7b\u548c\u8d1f\u7c7b\u3002\u901a\u8fc7\u6784\u5efa\u4e00\u4e2a\u5408\u9002\u7684\u5206\u7c7b\u8d85\u5e73\u9762\uff0c\u652f\u6301\u5411\u91cf\u673a\u8bd5\u56fe\u5728\u4e0d\u540c\u7c7b\u522b\u4e4b\u95f4\u627e\u5230\u4f18\u5f02\u7684\u51b3\u7b56\u8fb9\u754c\uff0c\u4ece\u800c\u5b9e\u73b0\u5206\u7c7b\u4efb\u52a1\u3002<\/p>\n\n\n\n<p><strong>2\u3001\u57fa\u4e8e\u95f4\u9694\u6700\u5927\u5316<\/strong><\/p>\n\n\n\n<p>\u652f\u6301\u5411\u91cf\u673a\u7684\u4e3b\u8981\u76ee\u6807\u662f\u627e\u5230\u4e00\u4e2a\u4f18\u5f02\u7684\u8d85\u5e73\u9762\uff0c\u4f7f\u5f97\u5b83\u80fd\u591f\u5728\u6b63\u7c7b\u548c\u8d1f\u7c7b\u4e4b\u95f4\u4fdd\u6301\u6700\u5927\u7684\u95f4\u9694\u3002\u95f4\u9694\u6307\u7684\u662f\u79bb\u8d85\u5e73\u9762\u6700\u8fd1\u7684\u6b63\u7c7b\u548c\u8d1f\u7c7b\u6837\u672c\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u901a\u8fc7\u6700\u5927\u5316\u8fd9\u4e2a\u95f4\u9694\uff0c\u652f\u6301\u5411\u91cf\u673a\u53ef\u4ee5\u63d0\u9ad8\u5206\u7c7b\u7684\u9c81\u68d2\u6027\u548c\u6cdb\u5316\u80fd\u529b\u3002<\/p>\n\n\n\n<p><strong>3\u3001\u4f9d\u8d56\u4e8e\u652f\u6301\u5411\u91cf<\/strong><\/p>\n\n\n\n<p>\u652f\u6301\u5411\u91cf\u662f\u8bad\u7ec3\u6837\u672c\u4e2d\u79bb\u5206\u7c7b\u8d85\u5e73\u9762\u6700\u8fd1\u7684\u6837\u672c\u70b9\uff0c\u5b83\u4eec\u5bf9\u4e8e\u5b9a\u4e49\u5206\u7c7b\u8fb9\u754c\u81f3\u5173\u91cd\u8981\u3002\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\u7684\u51b3\u7b56\u8fb9\u754c\u53ea\u4e0e\u652f\u6301\u5411\u91cf\u6709\u5173\uff0c\u800c\u5176\u4ed6\u6837\u672c\u70b9\u5bf9\u51b3\u7b56\u8fb9\u754c\u6ca1\u6709\u5f71\u54cd\u3002\u8fd9\u4f7f\u5f97\u652f\u6301\u5411\u91cf\u6210\u4e3a\u652f\u6301\u5411\u91cf\u673a\u7b97\u6cd5\u7684\u6838\u5fc3\u3002<\/p>\n\n\n\n<p><strong>4\u3001\u975e\u7ebf\u6027\u5206\u7c7b\u80fd\u529b<\/strong><\/p>\n\n\n\n<p>\u867d\u7136\u652f\u6301\u5411\u91cf\u673a\u6700\u521d\u662f\u4e3a\u7ebf\u6027\u5206\u7c7b\u95ee\u9898\u8bbe\u8ba1\u7684\uff0c\u4f46\u5b83\u53ef\u4ee5\u901a\u8fc7\u6838\u51fd\u6570\u5c06\u6570\u636e\u6620\u5c04\u5230\u9ad8\u7ef4\u7a7a\u95f4\uff0c\u4ece\u800c\u5b9e\u73b0\u975e\u7ebf\u6027\u5206\u7c7b\u3002\u901a\u8fc7\u4f7f\u7528\u6838\u51fd\u6570\uff0c\u652f\u6301\u5411\u91cf\u673a\u53ef\u4ee5\u5904\u7406\u66f4\u52a0\u590d\u6742\u7684\u6570\u636e\u5206\u5e03\uff0c\u5177\u5907\u8f83\u5f3a\u7684\u975e\u7ebf\u6027\u5206\u7c7b\u80fd\u529b\u3002<\/p>\n\n\n\n<p><strong>5\u3001\u5bf9\u6570\u636e\u91cf\u548c\u7279\u5f81\u7ef4\u5ea6\u654f\u611f<\/strong><\/p>\n\n\n\n<p>\u652f\u6301\u5411\u91cf\u673a\u5728\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u96c6\u65f6\uff0c\u9700\u8981\u5b58\u50a8\u548c\u8ba1\u7b97\u652f\u6301\u5411\u91cf\uff0c\u56e0\u6b64\u5bf9\u4e8e\u5927\u89c4\u6a21\u6570\u636e\u96c6\u7684\u5904\u7406\u8f83\u4e3a\u8017\u65f6\u3002\u6b64\u5916\uff0c\u652f\u6301\u5411\u91cf\u673a\u5bf9\u4e8e\u9ad8\u7ef4\u7279\u5f81\u7684\u6570\u636e\u4e5f\u9700\u8981\u8f83\u5927\u7684\u8ba1\u7b97\u5f00\u9500\u3002\u56e0\u6b64\uff0c\u5728\u9762\u5bf9\u5927\u89c4\u6a21\u6570\u636e\u96c6\u548c\u9ad8\u7ef4\u7279\u5f81\u65f6\uff0c\u9700\u8981\u8c28\u614e\u9009\u62e9\u652f\u6301\u5411\u91cf\u673a\u4f5c\u4e3a\u5206\u7c7b\u7b97\u6cd5\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u5ef6\u4f38\u9605\u8bfb<\/strong><\/h2>\n\n\n\n<p><strong>SVM\u7684\u4f18\u70b9<\/strong><\/p>\n\n\n\n<ol>\n<li>\u5728\u5904\u7406\u9ad8\u7ef4\u7279\u5f81\u6570\u636e\u65f6\u8868\u73b0\u51fa\u8272\u3002<\/li>\n\n\n\n<li>\u53ef\u4ee5\u9002\u7528\u4e8e\u7ebf\u6027\u548c\u975e\u7ebf\u6027\u95ee\u9898\uff0c\u901a\u8fc7\u6838\u51fd\u6570\u8fdb\u884c\u6620\u5c04\u5904\u7406\u3002<\/li>\n\n\n\n<li>\u5bf9\u4e8e\u5c0f\u6837\u672c\u6570\u636e\u548c\u6570\u636e\u7ef4\u5ea6\u9ad8\u7684\u95ee\u9898\u4e5f\u80fd\u5f97\u5230\u8f83\u597d\u7684\u7ed3\u679c\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"\u4e00\u7c7b\u652f\u6301\u5411\u91cf\u673a\uff08OC-SVM\uff09\u662f\u652f\u6301\u5411\u91cf\u673a\uff08SVM\uff09\u7684\u4e00\u79cd\u53d8\u79cd\uff0c\u7528\u4e8e\u89e3\u51b3\u5355\u7c7b\u522b\u5206\u7c7b\u95ee\u9898\u3002\u5728\u4f20\u7edf\u7684\u4e8c\u5206\u7c7b\u95ee\u9898\u4e2d\uff0c [&hellip;]","protected":false},"author":4,"featured_media":46973,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[119],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/46972"}],"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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=46972"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/46972\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/46973"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=46972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=46972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=46972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}