{"id":318723,"date":"2021-02-27T15:00:24","date_gmt":"2021-02-27T15:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=318723"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=318723","title":{"rendered":"\u041c\u0430\u0448\u0438\u043d\u0430 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 30 \u0441\u0442\u0440\u043e\u0447\u0435\u043a"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0431\u0435\u0437 scikit-learn \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432\u0441\u0435\u0433\u043e \u0432 30 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043d\u0430 Python. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 SMO, \u043d\u043e \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <s>\u041c\u0430\u0442\u0440\u0438\u0446\u0430<\/s> \u043c\u0430\u0448\u0438\u043d\u0430 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432\u2026 \u0422\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u044d\u0442\u043e \u0441\u0430\u043c.<\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"603805848b25a4d2350c1495\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/603805848b25a4d2350c1495\"><\/iframe><\/div>\n<p>  \u0423\u0437\u043d\u0430\u0432, \u0447\u0442\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u0435\u0434\u0438\u0430\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0434\u0435\u043c\u043e (\u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u2014 \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c \u0441\u0447\u0430\u0441\u0442\u044c\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 <a href=\"#git_demo\">[1]<\/a>). \u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u043d\u0430 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c (\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u0432\u0443\u0445 \u0444\u0438\u0447 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6d6\/a4f\/78f\/6d6a4f78fbacd6edecc018ce8ad3e364.svg\" alt=\"$X$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c62\/ff2\/5ef\/c62ff25ef4caeaeaef7122a489ef9d07.svg\" alt=\"$Y$\" data-tex=\"inline\"><\/math>) \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0438 \u0441\u0438\u043d\u0438\u0445 \u0442\u043e\u0447\u0435\u043a (\u044d\u0442\u043e \u043d\u0430\u0448 \u0434\u0430\u0442\u0430\u0441\u0435\u0442) \u0438 \u043c\u0430\u0448\u0438\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0451\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e (\u043a\u0430\u0436\u0434\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0444\u043e\u043d\u0430 \u0437\u0430\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0443\u0434\u0430 \u0431\u044b\u043b \u0431\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441). \u041f\u043e\u0434\u0432\u0438\u0433\u0430\u0439\u0442\u0435 \u0442\u043e\u0447\u043a\u0438, \u043f\u043e\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u044f\u0434\u0440\u043e (\u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c Radial Basis Functions) \u0438 \u0442\u0432\u0451\u0440\u0434\u043e\u0441\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u044b (\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/47e\/792\/77d\/47e79277dc17c254743475ff05980a53.svg\" alt=\"$C$\" data-tex=\"inline\"><\/math>). \u041c\u043e\u0438 \u0438\u0437\u0432\u0438\u043d\u0435\u043d\u0438\u044f \u0437\u0430 \u0443\u0436\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 JS \u2014 \u043f\u0438\u0441\u0430\u043b \u043d\u0430 \u043d\u0451\u043c \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432 \u0436\u0438\u0437\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u0434 \u043d\u0430 Python \u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h2>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h2>\n<ul>\n<li> \u0412 <a href=\"#secSVM\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435<\/a> \u044f \u0431\u0435\u0433\u043b\u043e \u043e\u043f\u0438\u0448\u0443 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u043a \u043a\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u042d\u0442\u043e\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043b\u0438\u0448\u044c \u043f\u043e\u0434\u0432\u043e\u0434\u044f\u0449\u0438\u0439 \u043a \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0446\u0435\u043b\u0438 \u0438 \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0444\u0430\u043a\u0442\u044b, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u2014 \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0431\u0435\u0437 \u0443\u0449\u0435\u0440\u0431\u0430 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u044b \u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043b\u0435\u043a\u0446\u0438\u044e \u0443\u0436\u0435 \u0441\u0442\u0430\u0432\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u043a\u043e\u0439 \u043a\u0443\u0440\u0441\u0430 \u0412\u043e\u0440\u043e\u043d\u0446\u043e\u0432\u0430 <a href=\"#woron\">[2]<\/a> \u0438\u043b\u0438 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u0443\u044e \u043b\u0435\u043a\u0446\u0438\u044e \u043a\u0443\u0440\u0441\u0430 <a href=\"#gitrepo\">[3]<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e, \u043a\u0441\u0442\u0430\u0442\u0438, \u0432\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043c\u0435\u0442\u043e\u0434.<\/li>\n<li> \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <a href=\"#secSMO\">\u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c SMO\u00bb<\/a> \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c SMO \u0438 \u0432 \u0447\u0451\u043c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435. \u0411\u0443\u0434\u0443\u0442 \u0432\u044b\u043a\u043b\u0430\u0434\u043a\u0438, \u043d\u043e \u0438\u0445 \u043e\u0431\u044a\u0451\u043c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0432 \u0442\u0435\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u0445 \u043a SMO, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432\u0438\u0434\u0435\u0442\u044c \u043c\u043d\u0435. <\/li>\n<li> \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <a href=\"#secImplementation\">\u00ab\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u00bb<\/a> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 Python \u0438 \u0441\u0445\u0435\u043c\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434\u0435. <\/li>\n<li> \u0423\u0437\u043d\u0430\u0442\u044c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u0434\u0430\u043b\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <a href=\"#secComparison\">\u00ab\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 sklearn.svc.svm\u00bb<\/a> \u2014 \u0442\u0430\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432 \u0432 2D \u0438 confusion matrix \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438\u0437 MNIST.<\/li>\n<li> \u0410 \u0432 <a href=\"#secConclusion\">\u00ab\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438\u00bb<\/a> \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u043c.<\/li>\n<\/ul>\n<p>  <a name=\"secSVM\"><\/a>  <\/p>\n<h2>\u041c\u0430\u0448\u0438\u043d\u0430 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432<\/h2>\n<p>  \u041c\u0430\u0448\u0438\u043d\u0430 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u2014 \u043c\u0435\u0442\u043e\u0434 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f (\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441 \u0443\u0447\u0438\u0442\u0435\u043b\u0435\u043c) \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438, \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439 \u0438 \u0442.\u0434. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041d\u0430\u0448\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u2014 \u043d\u0430\u0431\u043e\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0444\u0438\u0447 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/858\/0b8\/929\/8580b8929f2472abd5d074c9d413029b.svg\" alt=\"$\\boldsymbol{x}_i$\" data-tex=\"inline\"><\/math>, \u043e\u0442\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/18f\/3ff\/1f2\/18f3ff1f267cb7b377a3b1f8f70cceec.svg\" alt=\"$y_i = \\pm 1$\" data-tex=\"inline\"><\/math>. \u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u2014 \u0432\u0435\u043a\u0442\u043e\u0440 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0d9\/1e0\/122\/0d91e0122e773a252c0591883344fa6d.svg\" alt=\"$\\boldsymbol{x}$\" data-tex=\"inline\"><\/math>, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9d1\/49e\/a8e\/9d149ea8ef8692eb106a55ce5af36ccd.svg\" alt=\"$+1$\" data-tex=\"inline\"><\/math> \u0438\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d06\/719\/edc\/d06719edc69908e7467f7e6189302b74.svg\" alt=\"$-1$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mu\/z9\/41\/muz9416gygsbrlt_hhf2n8haa44.png\" width=\"350\" align=\"left\">\u0412 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0434\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0443 \u043f\u0440\u044f\u043c\u0443\u044e \u043a\u0430\u043a \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 (\u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0444\u0438\u0447 \u044d\u0442\u043e \u0431\u044b\u043b\u0430 \u0431\u044b \u0433\u0438\u043f\u0435\u0440\u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c). \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0434\u0451\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0d9\/1e0\/122\/0d91e0122e773a252c0591883344fa6d.svg\" alt=\"$\\boldsymbol{x}$\" data-tex=\"inline\"><\/math>, \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u0435\u0451 \u043a \u0442\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443, \u043d\u0430 \u0447\u044c\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043e\u043d\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0443\u044e \u043f\u0440\u044f\u043c\u0443\u044e? \u0418\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u044f\u043c\u0430\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b\u0430 \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e\u0439 \u043a\u0430\u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5e9\/de8\/d0f\/5e9de8d0f1e27ab4ca98743e6e85d7d4.svg\" alt=\"$\\boldsymbol{x} \\cdot \\boldsymbol{w} + b = 0$\" data-tex=\"inline\"><\/math> \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u044e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u043a \u043f\u0440\u044f\u043c\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b1f\/fc8\/0e5\/b1ffc80e529841913824f4865d40c1d3.svg\" alt=\"$\\boldsymbol{x} \\cdot \\boldsymbol{w} + b = \\pm 1$\" data-tex=\"inline\"><\/math> (\u043f\u043b\u044e\u0441 \u0438\u043b\u0438 \u043c\u0438\u043d\u0443\u0441 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430) \u2014 \u044d\u0442\u0438 \u0442\u043e\u0447\u043a\u0438 \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 <i>\u043e\u043f\u043e\u0440\u043d\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438<\/i>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wo\/uf\/32\/wouf32anm4j2wa47i2mqonsmrdo.png\" width=\"350\" align=\"right\">\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u043c\u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0440\u0430\u0432\u043d\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/326\/524\/107\/326524107ecbf72def2071a8bf2207ef.svg\" alt=\"$2\/|\\boldsymbol{w}|$\" data-tex=\"inline\"><\/math>. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ed5\/108\/3d7\/ed51083d7cd09871a053a665089c7231.svg\" alt=\"$\\frac{1}{2} |\\boldsymbol{w}|^2$\" data-tex=\"inline\"><\/math>, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/bdd\/cce\/888\/bddcce8884a41695c12e7f5d4fd0f647.svg\" alt=\"$ \\begin{aligned} &amp;\\min \\frac{1}{2} |\\boldsymbol{w}|^2 \\\\ \\text{subject to: } &amp;y_i \\left(\\boldsymbol{x}_i \\cdot \\boldsymbol{w} + b\\right) - 1 \\geq 0. \\end{aligned} $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0415\u0441\u043b\u0438 \u0435\u0451 \u0440\u0435\u0448\u0438\u0442\u044c, \u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0d9\/1e0\/122\/0d91e0122e773a252c0591883344fa6d.svg\" alt=\"$\\boldsymbol{x}$\" data-tex=\"inline\"><\/math> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0430\u043a  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/653\/544\/0ce\/6535440ced4a92354ebc0eeccaa31010.svg\" alt=\"$ \\text{class}(\\boldsymbol{x}) = \\text{sign}\\left(\\boldsymbol{x} \\cdot \\boldsymbol{w} + b\\right). $\" data-tex=\"display\"><\/math><\/p>\n<p> \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>  \u0410 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u0447\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043d\u043e \u043f\u0440\u043e\u043d\u0438\u043a\u0430\u044e\u0442 \u043a\u0430\u043a \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435?<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4m\/qp\/48\/4mqp48e6vnffszin2womnwrsdns.png\" width=\"300\" align=\"left\">\u041c\u044b \u0443\u0436\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0445 \u0442\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c. \u0422\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0442\u043e\u0447\u043a\u0430\u043c \u043d\u0430\u0440\u0443\u0448\u0430\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f72\/ca7\/dd0\/f72ca7dd04eb4a1af68d70c43235303b.svg\" alt=\"$\\xi_i \\geq 0$\" data-tex=\"inline\"><\/math>, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0442\u0430\u043a\u0438\u0445 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u0435\u043b\u0435\u0439 \u0431\u044b\u043b\u043e \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u043c (\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3f7\/712\/43c\/3f771243c6e4e2826f3071100c3a50fc.svg\" alt=\"$L_1$\" data-tex=\"inline\"><\/math>):  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/78b\/d60\/daa\/78bd60daa3ac19255f333636c9f9cc82.svg\" alt=\"$ \\begin{aligned} &amp;\\min\\left( \\frac{1}{2} |\\boldsymbol{w}|^2 + C \\sum_i \\xi_i \\right)\\\\ \\text{subject to: }&amp;\\xi_i + y_i \\left(\\boldsymbol{x}_i \\cdot \\boldsymbol{w} + b\\right) - 1 \\geq 0,\\\\ &amp;\\xi_i \\geq 0, \\end{aligned} $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043f\u0440\u0435\u0436\u0434\u0435. \u0417\u0434\u0435\u0441\u044c \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/47e\/792\/77d\/47e79277dc17c254743475ff05980a53.svg\" alt=\"$C$\" data-tex=\"inline\"><\/math> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u0438\u043b\u0443 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u0433\u043e \u043c\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u043c \u043e\u0442 \u0442\u043e\u0447\u0435\u043a \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u0443: \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/47e\/792\/77d\/47e79277dc17c254743475ff05980a53.svg\" alt=\"$C$\" data-tex=\"inline\"><\/math> \u2014 \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b01\/0e8\/1d7\/b010e81d7d89ee97dedf50c138e445ae.svg\" alt=\"$\\xi_i$\" data-tex=\"inline\"><\/math> \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u043e\u043b\u044c \u0438 \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0442\u043e\u0447\u0435\u043a \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0440\u0443\u0448\u0430\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u0443. \u041e\u043f\u043e\u0440\u043d\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0442\u043e\u0447\u043a\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1c2\/eab\/a73\/1c2eaba737cb11fa05ad4b5a7a0270a2.svg\" alt=\"$\\xi_i &gt; 0$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043b\u043e\u0433\u043e\u0442\u0438\u043f \u0433\u0440\u0443\u043f\u043f\u044b The Who \u0438 \u0442\u043e\u0447\u043a\u0438 \u043d\u0438 \u0437\u0430 \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0439?<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ax\/cx\/wf\/axcxwf1nvgxilmc1gqvmhulshi8.png\" width=\"300\" align=\"right\">\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0442\u0440\u043e\u0443\u043c\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u2014 <i>\u0442\u0440\u044e\u043a \u0441 \u044f\u0434\u0440\u043e\u043c<\/i> <a href=\"#kernel\">[4]<\/a>. \u041e\u0434\u043d\u0430\u043a\u043e, \u0447\u0442\u043e\u0431\u044b \u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 <i>\u0434\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439<\/i> (\u0438\u043b\u0438 <i>\u0434\u0443\u0430\u043b\u044c\u043d\u043e\u0439<\/i>) \u0437\u0430\u0434\u0430\u0447\u0435 \u041b\u0430\u0433\u0440\u0430\u043d\u0436\u0430. \u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438 <a href=\"#wiki_opt\">[5]<\/a> \u0438\u043b\u0438 \u0432 \u0448\u0435\u0441\u0442\u043e\u0439 \u043b\u0435\u043a\u0446\u0438\u0438 \u043a\u0443\u0440\u0441\u0430 <a href=\"#gitrepo\">[3]<\/a>. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 <i>\u0434\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438<\/i> \u0438\u043b\u0438 <i>\u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u041b\u0430\u0433\u0440\u0430\u043d\u0436\u0430<\/i>. \u0414\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u043e\u0449\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u043c\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043d\u0430 \u0432\u043e\u0433\u043d\u0443\u0442\u0430 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435\u0432\u044b\u043f\u0443\u043a\u043b\u0430\u044f. \u0425\u043e\u0442\u044f \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 (\u0440\u0430\u0437\u0440\u044b\u0432 \u0434\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438), \u043d\u043e \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u0442\u0435\u043e\u0440\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 (\u0441\u0438\u043b\u044c\u043d\u0430\u044f \u0434\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c). \u0418 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430\u0448 \u0441\u043b\u0443\u0447\u0430\u0439, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0434\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0a2\/026\/4bb\/0a20264bba373e10453b2b3a123af465.svg\" alt=\"$ \\begin{aligned} &amp;\\max_{\\lambda} \\sum_{i=1}^n \\lambda_i - \\frac12 \\sum_{i=1}^n \\sum_{j=1}^n y_i y_j (\\boldsymbol{x}_i \\cdot \\boldsymbol{x}_j) \\lambda_i \\lambda_j,\\\\ \\text{subject to: } &amp;0 \\leq \\lambda_i \\leq C, \\quad \\mbox{ for } i=1, 2, \\ldots, n,\\\\ &amp;\\sum_{i=1}^n y_i \\lambda_i = 0, \\end{aligned} $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0433\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3a2\/2fb\/dfa\/3a22fbdfadff2c6be55c84e9d454a3fd.svg\" alt=\"$\\lambda_i$\" data-tex=\"inline\"><\/math> \u2014 \u0434\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/302\/c72\/04e\/302c7204ea9987e698a70307646abd71.svg\" alt=\"$b$\" data-tex=\"inline\"><\/math>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0432\u043e\u0448\u0451\u043b \u0432 \u0434\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u043e \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430   <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/008\/72f\/9d8\/00872f9d87dc00efeb50a008398574b7.svg\" alt=\"$ b = \\mathbb{E}_{k,\\xi_k \\neq 0}\\left[y_k - \\sum_i \\lambda_i y_i (\\boldsymbol{x}_i \\cdot \\boldsymbol{x}_k)\\right]. $\" data-tex=\"display\"><\/math><\/p>\n<p> \u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u043d\u043e (\u0438 \u043d\u0443\u0436\u043d\u043e) \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0434\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ee7\/d42\/446\/ee7d42446c5bf151fab3f3986ad4bbbf.svg\" alt=\"$ \\text{class}(\\boldsymbol{x}) = \\text{sign}(f(\\boldsymbol{x})),\\quad f(\\boldsymbol{x}) = \\sum_i \\lambda_i y_i (\\boldsymbol{x}_i \\cdot \\boldsymbol{x}) + b. $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0412 \u0447\u0451\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u044d\u0442\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438? \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0438\u0437 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0432\u0445\u043e\u0434\u044f\u0442 \u0441\u044e\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f35\/9c2\/ba1\/f359c2ba10551fb4bba832c3c952eb8d.svg\" alt=\"$(\\boldsymbol{x}_i \\cdot \\boldsymbol{x}_j)$\" data-tex=\"inline\"><\/math>. \u041c\u043e\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0432 \u043d\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435. \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0440\u0438\u0441\u0443\u043d\u043a\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kw\/_w\/8f\/kw_w8fehuzrwyjuex9xgkqgpzus.png\" width=\"300\" align=\"left\">\u041f\u0440\u0438 \u0443\u0434\u0430\u0447\u043d\u043e\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043e\u0431\u0440\u0430\u0437\u044b \u0442\u043e\u0447\u0435\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0433\u0438\u043f\u0435\u0440\u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c\u044e! \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432\u0441\u0451 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435: \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c-\u0442\u043e \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u0432\u0435\u0434\u044c \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0430 \u043d\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u0435\u043a. \u0422\u0430\u043a \u0447\u0442\u043e \u0432\u0441\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043c\u043e\u0436\u043d\u043e \u044d\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c8f\/c47\/0ea\/c8fc470eaa9eda3084d9de81f26cdece.svg\" alt=\"$K(\\boldsymbol{x}_i; \\boldsymbol{x}_j)$\" data-tex=\"inline\"><\/math>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 <i>\u044f\u0434\u0440\u043e\u043c<\/i>. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u044b\u0442\u044c \u044f\u0434\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043b\u044e\u0431\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u0434\u043e\u043b\u0436\u043d\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u0433\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ddc\/188\/28e\/ddc18828e11c4110c4dffc6b5177cf1b.svg\" alt=\"$\\varphi$\" data-tex=\"inline\"><\/math>, \u0442\u0430\u043a\u043e\u0435 \u0447\u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c90\/60b\/77f\/c9060b77f8727e43c15564c23611a632.svg\" alt=\"$K(\\boldsymbol{x}_i; \\boldsymbol{x}_j)=(\\varphi(\\boldsymbol{x}_i) \\cdot \\varphi(\\boldsymbol{x}_j))$\" data-tex=\"inline\"><\/math>. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0435\u043e\u0440\u0435\u043c\u0430 \u041c\u0435\u0440\u0441\u0435\u0440\u0430 <a href=\"#merser\">[6]<\/a>. \u0412 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 Python \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 (<math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/771\/96a\/c40\/77196ac40ff8b0529e7d61022149509e.svg\" alt=\"$K(\\boldsymbol{x}_i; \\boldsymbol{x}_j) = \\boldsymbol{x}_i^T \\boldsymbol{x}_j$\" data-tex=\"inline\"><\/math>), \u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 (<math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b33\/41d\/b4c\/b3341db4c706ad0cced99fe921f7add7.svg\" alt=\"$K(\\boldsymbol{x}_i; \\boldsymbol{x}_j) = (\\boldsymbol{x}_i^T \\boldsymbol{x}_j)^d$\" data-tex=\"inline\"><\/math>) \u044f\u0434\u0440\u0430 \u0438 \u044f\u0434\u0440\u043e \u0440\u0430\u0434\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u0430\u0437\u0438\u0441\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (<math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9b2\/80b\/5e4\/9b280b5e424e90d83140f23db974ac0f.svg\" alt=\"$K(\\boldsymbol{x}_i; \\boldsymbol{x}_j) = e^{-\\gamma |\\boldsymbol{x}_i - \\boldsymbol{x}_j|^2}$\" data-tex=\"inline\"><\/math>). \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u044f\u0434\u0440\u0430 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0432\u0438\u0434\u0435\u043e, \u0433\u0434\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u044f\u0441\u043d\u044f\u044e\u0442 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0442\u044f\u043d\u0443\u0442\u043e\u0439 \u0440\u0435\u0437\u0438\u043d\u043e\u0432\u043e\u0439 \u043f\u043b\u0435\u043d\u043a\u0438 \u0432 \u0444\u043e\u0440\u043c\u0435 \u0432\u043e\u0440\u043e\u043d\u043a\u0438 <a href=\"#video\">[7]<\/a>. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e \u0438\u0441\u043a\u0440\u0438\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044e \u0435\u0451 \u043e\u0431\u0440\u0430\u0437\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438, \u0435\u0441\u043b\u0438 \u0441\u043d\u0430\u0431\u0434\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u043e\u0439. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u044f\u0434\u0440\u043e \u0438\u0441\u043a\u0440\u0438\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e.<\/p>\n<p>  <a name=\"secSMO\"><\/a>  <\/p>\n<h2>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c SMO<\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u0443 \u0446\u0435\u043b\u0438, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u0434\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/55e\/3e8\/2fc\/55e3e82fc72d607a8e6609525afc27fa.svg\" alt=\"$ \\def\\M{{\\color{red}M}} \\def\\L{{\\color{blue}L}} \\begin{aligned} &amp;\\max_{\\lambda} \\sum_{i=1}^n \\lambda_i - \\frac12 \\sum_{i=1}^n \\sum_{j=1}^n y_i y_j K(\\boldsymbol{x}_i; \\boldsymbol{x}_j) \\lambda_i \\lambda_j,\\\\ \\text{subject to: } &amp;0 \\leq \\lambda_i \\leq C, \\quad \\mbox{ for } i=1, 2, \\ldots, n,\\\\ &amp;\\sum_{i=1}^n y_i \\lambda_i = 0, \\end{aligned} $\" data-tex=\"display\"><\/math><\/p>\n<p> \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/db6\/95f\/2b0\/db695f2b087489b61f79ad02de01a04b.svg\" alt=\"$ b = \\mathbb{E}_{k,\\xi_k \\neq 0}[y_k - \\sum_i \\lambda_i y_i K(\\boldsymbol{x}_i; \\boldsymbol{x}_k)], \\tag{1} $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u043c\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b45\/2e2\/2af\/b452e22afc5b86296fe8640f4c7f3165.svg\" alt=\"$ \\text{class}(\\boldsymbol{x}) = \\text{sign}(f(\\boldsymbol{x})),\\quad f(\\boldsymbol{x}) = \\sum_i \\lambda_i y_i K(\\boldsymbol{x}_i; \\boldsymbol{x}) + b. \\tag{2} $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c SMO (Sequential minimal optimization, <a href=\"#wiki_smo\">[8]<\/a>) \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c. \u0412 \u0446\u0438\u043a\u043b\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u044d\u0432\u0440\u0438\u0441\u0442\u0438\u043a\u0438 (<a href=\"#platt\">[9]<\/a>) \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430 \u0434\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b1b\/c57\/ea8\/b1bc57ea859ea7d6505ec3a3ae9be2f6.svg\" alt=\"$\\lambda_\\M$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f48\/ddd\/3e3\/f48ddd3e31ddc5a4a0f7840198760964.svg\" alt=\"$\\lambda_\\L$\" data-tex=\"inline\"><\/math>, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e \u043d\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u0441\u0442\u0432\u0430 \u0441\u0443\u043c\u043c\u044b <math>$inline$y_\\M\\lambda_\\M + y_\\L\\lambda_\\L$inline$<\/math> \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6b4\/cd3\/71b\/6b4cd371b1c055c6861b52cf622fbda6.svg\" alt=\"$0 \\leq \\lambda_\\M \\leq C$\" data-tex=\"inline\"><\/math>, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/bf8\/b0d\/141\/bf8b0d141e605639bff58c595c68c213.svg\" alt=\"$0 \\leq \\lambda_\\L \\leq C$\" data-tex=\"inline\"><\/math> (\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0436\u0451\u0441\u0442\u043a\u043e\u0441\u0442\u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b). \u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0430 \u0441\u0443\u043c\u043c\u0443 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0441\u0443\u043c\u043c\u0443 \u0432\u0441\u0435\u0445 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/129\/504\/dbf\/129504dbf3ba45bc6384cc824314c30f.svg\" alt=\"$y_i\\lambda_i$\" data-tex=\"inline\"><\/math> \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u0439 (\u0432\u0435\u0434\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043b\u044f\u043c\u0431\u0434\u044b \u043c\u044b \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u043b\u0438). \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 <i>\u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u041a\u041a\u0422<\/i> (\u041a\u0430\u0440\u0443\u0448\u0430-\u041a\u0443\u043d\u0430-\u0422\u0430\u043a\u0435\u0440\u0430 <a href=\"#wiki_kkt\">[10]<\/a>).<\/p>\n<p>  \u042f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0439.  <\/p>\n<ul>\n<li>\u041e\u0442\u043a\u0430\u0436\u0443\u0441\u044c \u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u044d\u0432\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 (\u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 \u043a\u0443\u0440\u0441\u0435 \u0421\u0442\u044d\u043d\u0444\u043e\u0440\u0434\u0441\u043a\u043e\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 <a href=\"#stanford\">[11]<\/a>) \u0438 \u0431\u0443\u0434\u0443 \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/li>\n<li> \u041e\u0442\u043a\u0430\u0436\u0443\u0441\u044c \u043e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u041a\u041a\u0422 \u0438 \u0431\u0443\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0430\u043f\u0435\u0440\u0451\u0434 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439.<\/li>\n<li>\u0412 \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b <a href=\"#platt\">[9]<\/a> \u0438\u043b\u0438 \u0441\u0442\u044d\u043d\u0444\u043e\u0440\u0434\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 <a href=\"#stanford\">[11]<\/a>, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u043c \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u044f\u043c\u043e\u0439. \u042d\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0432\u044b\u043a\u043b\u0430\u0434\u043a\u0438 (\u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u043e\u0431\u044a\u0451\u043c <a href=\"#rgarticle\">[12]<\/a> \u0438 <a href=\"#fullderiv\">[13]<\/a>).<\/li>\n<\/ul>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043a \u0434\u0435\u0442\u0430\u043b\u044f\u043c. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/29c\/8ae\/38a\/29c8ae38a046a087151299f7cfa5d228.svg\" alt=\"$ \\boldsymbol{K} = \\begin{pmatrix} y_1 y_1 K(\\boldsymbol{x}_1; \\boldsymbol{x}_1) &amp; y_1 y_2 K(\\boldsymbol{x}_1; \\boldsymbol{x}_2) &amp; \\dots &amp; y_1 y_N K(\\boldsymbol{x}_1; \\boldsymbol{x}_N) \\\\ y_2 y_1 K(\\boldsymbol{x}_2; \\boldsymbol{x}_1) &amp; y_2 y_2 K(\\boldsymbol{x}_2; \\boldsymbol{x}_2) &amp; \\dots &amp; y_2 y_N K(\\boldsymbol{x}_2; \\boldsymbol{x}_N) \\\\ \\cdots &amp; \\cdots &amp; \\cdots &amp; \\cdots \\\\ y_N y_1 K(\\boldsymbol{x}_N; \\boldsymbol{x}_1) &amp; y_N y_2 K(\\boldsymbol{x}_N; \\boldsymbol{x}_2) &amp; \\dots &amp; y_N y_N K(\\boldsymbol{x}_N; \\boldsymbol{x}_N) \\\\ \\end{pmatrix}. \\tag{3} $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u0434\u0432\u0443\u043c\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438 (<math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/16a\/c66\/321\/16ac663219bef19dba84bd607c2fd78f.svg\" alt=\"$\\boldsymbol{K}_{i,j}$\" data-tex=\"inline\"><\/math>), \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c (<math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/cae\/d94\/e5a\/caed94e5aa72ed003adff89f9e6ac7d8.svg\" alt=\"$\\boldsymbol{K}_{k}$\" data-tex=\"inline\"><\/math>) \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0430-\u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u0414\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0432 \u0432\u0435\u043a\u0442\u043e\u0440-\u0441\u0442\u043e\u043b\u0431\u0435\u0446 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/448\/87b\/31c\/44887b31c803393e09c991e732f5bfdf.svg\" alt=\"$\\boldsymbol{\\lambda}$\" data-tex=\"inline\"><\/math>. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ddb\/04d\/2c3\/ddb04d2c33f5d00207d46674dce5394e.svg\" alt=\"$ \\max_{\\boldsymbol{\\lambda}} \\underbrace{ \\sum_{i=1}^n \\lambda_i - \\frac12 \\boldsymbol{\\lambda}^T \\boldsymbol{K} \\boldsymbol{\\lambda} }_{\\mathscr{L}}. $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/087\/038\/31f\/08703831f5a691e3078e2fa4a046a90d.svg\" alt=\"$\\L$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1b8\/54d\/440\/1b854d44003f175d56fe476eed7a5275.svg\" alt=\"$\\M$\" data-tex=\"inline\"><\/math>. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/087\/038\/31f\/08703831f5a691e3078e2fa4a046a90d.svg\" alt=\"$\\L$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1b8\/54d\/440\/1b854d44003f175d56fe476eed7a5275.svg\" alt=\"$\\M$\" data-tex=\"inline\"><\/math>. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0447\u0430\u0441\u0442\u0438 \u0441 \u0441\u0443\u043c\u043c\u043e\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3a2\/2fb\/dfa\/3a22fbdfadff2c6be55c84e9d454a3fd.svg\" alt=\"$\\lambda_i$\" data-tex=\"inline\"><\/math>, \u0430 \u0432\u043e\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439.<\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6e5\/828\/993\/6e58289931470fe20af2e75c4c9fb374.svg\" alt=\"$\\boldsymbol{\\lambda}^T \\boldsymbol{K} \\boldsymbol{\\lambda}$\" data-tex=\"inline\"><\/math> \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u0434\u0432\u0443\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c, \u043f\u0443\u0441\u043a\u0430\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/bf8\/3b5\/32c\/bf83b532cd867d34004f8eded8c5c79a.svg\" alt=\"$i$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b82\/8e2\/475\/b828e2475a3a56280b895f35eb250ea2.svg\" alt=\"$j$\" data-tex=\"inline\"><\/math>. \u0412\u044b\u0434\u0435\u043b\u0438\u043c \u0446\u0432\u0435\u0442\u043e\u043c \u043f\u0430\u0440\u044b \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/087\/038\/31f\/08703831f5a691e3078e2fa4a046a90d.svg\" alt=\"$\\L$\" data-tex=\"inline\"><\/math> \u0438\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1b8\/54d\/440\/1b854d44003f175d56fe476eed7a5275.svg\" alt=\"$\\M$\" data-tex=\"inline\"><\/math>.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/s5\/yr\/gy\/s5yrgyx7-defy6wmcyzbnyeqmwu.png\" width=\"700\"><\/div>\n<p>  \u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0432 \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f48\/ddd\/3e3\/f48ddd3e31ddc5a4a0f7840198760964.svg\" alt=\"$\\lambda_\\L$\" data-tex=\"inline\"><\/math> \u0438\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b1b\/c57\/ea8\/b1bc57ea859ea7d6505ec3a3ae9be2f6.svg\" alt=\"$\\lambda_\\M$\" data-tex=\"inline\"><\/math>. \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u0447\u0435 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/cd1\/1d0\/c1c\/cd11d0c1c39d0e55d43becdd467aed11.svg\" alt=\"$\\boldsymbol{K}$\" data-tex=\"inline\"><\/math> \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438.  <\/p>\n<p><math>$$display$$ \\begin{aligned} \\mathscr{L} &amp;= \\lambda_\\M + \\lambda_\\L &#8212; \\sum_{j} \\lambda_\\M \\lambda_j K_{\\M,j} &#8212; \\sum_{i} \\lambda_\\L \\lambda_i K_{\\L,i} + \\text{const} + \\\\ {\\text{\u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0430\u0446\u0438\u044f}\\atop\\text{\u0434\u0432\u043e\u0439\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430}} \\rightarrow\\qquad &amp;+ \\frac{1}{2}\\lambda_\\M^2 K_{\\M,\\M} + \\lambda_\\M \\lambda_\\L K_{\\M,\\L} + \\frac{1}{2}\\lambda_\\L^2 K_{\\L,\\L} = \\\\ &amp;= \\lambda_\\M \\left(1-\\sum_{j} \\lambda_j K_{\\M,j}\\right) + \\lambda_\\L \\left(1-\\sum_{i} \\lambda_i K_{\\L,i}\\right)+\\\\ &amp;+\\frac{1}{2}\\left(\\lambda_\\M^2 K_{\\M,\\M} + 2 \\lambda_\\M \\lambda_\\L K_{\\M,\\L}+\\lambda_\\L^2 K_{\\L,\\L} \\right) + \\text{const} = \\\\ &amp;=\\boldsymbol{k}^T_0 \\boldsymbol{v}_0 + \\frac{1}{2}\\boldsymbol{v}^{\\,T}_0 \\, \\boldsymbol{Q} \\, \\boldsymbol{v}_0 + \\text{const}, \\end{aligned} $$display$$<\/math><\/p>\n<p> \u0433\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a77\/2d9\/3f9\/a772d93f97eae0f8436ef69b561ccdca.svg\" alt=\"$\\text{const}$\" data-tex=\"inline\"><\/math> \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435, \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f48\/ddd\/3e3\/f48ddd3e31ddc5a4a0f7840198760964.svg\" alt=\"$\\lambda_\\L$\" data-tex=\"inline\"><\/math> \u0438\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b1b\/c57\/ea8\/b1bc57ea859ea7d6505ec3a3ae9be2f6.svg\" alt=\"$\\lambda_\\M$\" data-tex=\"inline\"><\/math>. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f  <\/p>\n<p><math>$$display$$ \\begin{align} \\boldsymbol{v}_0 &amp;= (\\lambda_\\M, \\lambda_\\L)^T, \\tag{4a}\\\\ \\boldsymbol{k}_0 &amp;= \\left(1 &#8212; \\boldsymbol{\\lambda}^T\\boldsymbol{K}_{\\M}, 1 &#8212; \\boldsymbol{\\lambda}^T\\boldsymbol{K}_{\\L}\\right)^T, \\tag{4b}\\\\ \\boldsymbol{Q} &amp;= \\begin{pmatrix} K_{\\M,\\M} &amp; K_{\\M,\\L} \\\\ K_{\\L,\\M} &amp; K_{\\L,\\L} \\\\ \\end{pmatrix},\\tag{4c}\\\\ \\boldsymbol{u} &amp;= (-y_\\L, y_\\M)^T. \\tag{4d} \\end{align} $$display$$<\/math><\/p>\n<p> \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/be2\/00a\/0a0\/be200a0a0efa9c00f3ff53a62068dd57.svg\" alt=\"$\\boldsymbol{k}_0 + \\boldsymbol{Q} \\boldsymbol{v}_0$\" data-tex=\"inline\"><\/math> \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043d\u0438 \u043e\u0442 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f48\/ddd\/3e3\/f48ddd3e31ddc5a4a0f7840198760964.svg\" alt=\"$\\lambda_\\L$\" data-tex=\"inline\"><\/math>, \u043d\u0438 \u043e\u0442 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b1b\/c57\/ea8\/b1bc57ea859ea7d6505ec3a3ae9be2f6.svg\" alt=\"$\\lambda_\\M$\" data-tex=\"inline\"><\/math>  <\/p>\n<p><math>$$display$$ \\boldsymbol{k}_0 = \\begin{pmatrix} 1 &#8212; \\lambda_\\M K_{\\M,\\M} &#8212; \\lambda_\\L K_{\\M,\\L} &#8212; \\sum_{i \\neq \\M,\\L} \\lambda_i K_{\\M,i}\\\\ 1 &#8212; \\lambda_\\M K_{\\L,\\M} &#8212; \\lambda_\\L K_{\\L,\\L} &#8212; \\sum_{i \\neq \\M,\\L} \\lambda_i K_{\\L,i}\\\\ \\end{pmatrix} = \\begin{pmatrix} 1 &#8212; \\sum_{i \\neq \\M,\\L} \\lambda_i K_{\\M,i}\\\\ 1 &#8212; \\sum_{i \\neq \\M,\\L} \\lambda_i K_{\\L,i}\\\\ \\end{pmatrix} &#8212; \\boldsymbol{Q} \\boldsymbol{v}_0. $$display$$<\/math><\/p>\n<p> \u042f\u0434\u0440\u043e \u2014 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d43\/ca6\/b7f\/d43ca6b7fb90af48cb15624047916b0f.svg\" alt=\"$\\boldsymbol{Q}^T = \\boldsymbol{Q}$\" data-tex=\"inline\"><\/math> \u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6ed\/a58\/b13\/6eda58b13f88192c896e8c11b7ab13f3.svg\" alt=\"$ \\mathscr{L} = (\\boldsymbol{k}_0 + \\boldsymbol{Q} \\boldsymbol{v}_0 - \\boldsymbol{Q} \\boldsymbol{v}_0)^T \\boldsymbol{v}_0 + \\frac{1}{2}\\boldsymbol{v}^{\\,T}_0 \\, \\boldsymbol{Q} \\, \\boldsymbol{v}_0 + \\text{const} = (\\boldsymbol{k}_0 + \\boldsymbol{Q} \\boldsymbol{v}_0)^T \\boldsymbol{v}_0 - \\frac{1}{2} \\boldsymbol{v}^{\\,T}_0 \\, \\boldsymbol{Q} \\, \\boldsymbol{v}_0 + \\text{const} $\" data-tex=\"display\"><\/math><\/p>\n<p> \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b <math>$inline$y_\\L\\lambda_\\L + y_\\M\\lambda_\\M$inline$<\/math> \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u043b\u0435\u0436\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u044f\u043c\u043e\u0439  <\/p>\n<p><math>$$display$$ (\\lambda_\\M^\\text{new}, \\lambda_\\L^\\text{new})^T = \\boldsymbol{v}(t) = \\boldsymbol{v}_0 + t \\boldsymbol{u}. $$display$$<\/math><\/p>\n<p> \u041d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9b0\/012\/4e4\/9b00124e411362185d05b841bc32695f.svg\" alt=\"$t$\" data-tex=\"inline\"><\/math>  <\/p>\n<p><math>$$display$$ y_\\M\\lambda_\\M^\\text{new} + y_\\L\\lambda_\\L^\\text{new} = y_\\M \\lambda_\\M + y_\\L \\lambda_\\L + t (-y_\\M y_\\L + y_\\L y_\\M) = y_\\M\\lambda_\\M + y_\\L\\lambda_\\L. $$display$$<\/math><\/p>\n<p> \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c   <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8aa\/888\/507\/8aa8885078114c2c0d84db7cfc6a96ad.svg\" alt=\"$ \\mathscr{L}(t) = (\\boldsymbol{k}_0 + \\boldsymbol{Q} \\boldsymbol{v}_0)^T \\boldsymbol{v}(t) - \\frac12 \\boldsymbol{v}^{\\,T}(t) \\, \\boldsymbol{Q} \\, \\boldsymbol{v}(t) + \\text{const}, $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0447\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0437\u044f\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0443\u044e  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4c8\/abb\/446\/4c8abb4460c987d87553d6a1364fadae.svg\" alt=\"$ \\begin{align} \\frac{d \\mathscr{L}(t)}{d t} = (\\boldsymbol{k}_0 + \\boldsymbol{Q} \\boldsymbol{v}_0)^T \\frac{d \\boldsymbol{v}}{dt} &amp;- \\frac12 \\left(\\frac{d(\\boldsymbol{v}^{\\,T} \\, \\boldsymbol{Q} \\, \\boldsymbol{v})}{d \\boldsymbol{v}}\\right)^T \\frac{d\\boldsymbol{v}}{d t} =\\\\ &amp;= \\boldsymbol{k}_0^T \\boldsymbol{u} + \\underbrace{\\boldsymbol{v}_0^T \\boldsymbol{Q}^T \\boldsymbol{u} - \\boldsymbol{v}^T \\boldsymbol{Q}^T \\boldsymbol{u}}_{(\\boldsymbol{v}_0^T - \\boldsymbol{v}^T)\\boldsymbol{Q} \\boldsymbol{u}} = \\boldsymbol{k}_0^T \\boldsymbol{u} - t \\boldsymbol{u}^T \\boldsymbol{Q} \\boldsymbol{u}. \\end{align} $\" data-tex=\"display\"><\/math><\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ac\/h5\/y3\/ach5y34cjav7psqpbx8bapxumlm.png\" width=\"350\" align=\"left\">\u041f\u0440\u0438\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0443\u044e \u043a \u043d\u0443\u043b\u044e, \u043f\u043e\u043b\u0443\u0447\u0438\u043c  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2f6\/cf9\/de1\/2f6cf9de16a8832764066a5eeb068c7b.svg\" alt=\"$ t_* = \\frac{\\boldsymbol{k}^T_0 \\boldsymbol{u}}{\\boldsymbol{u}^{\\,T} \\boldsymbol{Q} \\boldsymbol{u}}. \\tag{5} $\" data-tex=\"display\"><\/math><\/p>\n<p> \u0418 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043c\u044b \u0437\u0430\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0438 \u043e\u043a\u0430\u0436\u0435\u043c\u0441\u044f \u0432\u043d\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u043a\u0430\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435. \u0422\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0448\u0430\u0433 \u043d\u0430\u0437\u0430\u0434 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u0435\u0433\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0443  <\/p>\n<p><math>$$display$$ (\\lambda_\\M^\\text{new}, \\lambda_\\L^\\text{new}) = \\boldsymbol{v}_0 + t_*^{\\text{restr}} \\boldsymbol{u}. $$display$$<\/math><\/p>\n<p> \u041d\u0430 \u044d\u0442\u043e\u043c \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b.<\/p>\n<p>  <a name=\"secImplementation\"><\/a>  <\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5g\/o_\/tj\/5go_tjn4lkkl5mc-dhhzpnkghua.png\" width=\"700\"><\/div>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043a\u043e\u0434 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043b\u044e\u0431\u0438\u0442\u0435 \u043a\u043e\u0434 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 <a href=\"#smo_repo\">[14]<\/a>.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import numpy as np  class SVM:   def __init__(self, kernel='linear', C=10000.0, max_iter=100000, degree=3, gamma=1):     self.kernel = {'poly'  : lambda x,y: np.dot(x, y.T)**degree,          'rbf': lambda x,y: np.exp(-gamma*np.sum((y-x[:,np.newaxis])**2,axis=-1)),          'linear': lambda x,y: np.dot(x, y.T)}[kernel]     self.C = C     self.max_iter = max_iter    # \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 t, \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0432\u044b\u0435 \u043b\u044f\u043c\u0431\u0434\u044b \u043d\u0435 \u043f\u043e\u043a\u0438\u0434\u0430\u043b\u0438 \u0433\u0440\u0430\u043d\u0438\u0446 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430   def restrict_to_square(self, t, v0, u):      t = (np.clip(v0 + t*u, 0, self.C) - v0)[1]\/u[1]     return (np.clip(v0 + t*u, 0, self.C) - v0)[0]\/u[0]    def fit(self, X, y):     self.X = X.copy()     # \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 0,1 \u0432 -1,+1; \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 sklearn     self.y = y * 2 - 1      self.lambdas = np.zeros_like(self.y, dtype=float)     # \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (3)     self.K = self.kernel(self.X, self.X) * self.y[:,np.newaxis] * self.y          # \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c self.max_iter \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439     for _ in range(self.max_iter):       # \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u043b\u044f\u043c\u0431\u0434\u0430        for idxM in range(len(self.lambdas)):                                             # idxL \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e         idxL = np.random.randint(0, len(self.lambdas))                                  # \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (4\u0441)         Q = self.K[[[idxM, idxM], [idxL, idxL]], [[idxM, idxL], [idxM, idxL]]]          # \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (4a)         v0 = self.lambdas[[idxM, idxL]]                                                 # \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (4b)         k0 = 1 - np.sum(self.lambdas * self.K[[idxM, idxL]], axis=1)                    # \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (4d)         u = np.array([-self.y[idxL], self.y[idxM]])                                     # \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (5), \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f idxM = idxL         t_max = np.dot(k0, u) \/ (np.dot(np.dot(Q, u), u) + 1E-15)          self.lambdas[[idxM, idxL]] = v0 + u * self.restrict_to_square(t_max, v0, u)          # \u043d\u0430\u0439\u0442\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432     idx, = np.nonzero(self.lambdas &gt; 1E-15)      # \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (1)     self.b = np.mean((1.0-np.sum(self.K[idx]*self.lambdas, axis=1))*self.y[idx])       def decision_function(self, X):     return np.sum(self.kernel(X, self.X) * self.y * self.lambdas, axis=1) + self.b    def predict(self, X):      # \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 -1,+1 \u0432 0,1; \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 sklearn     return (np.sign(self.decision_function(X)) + 1) \/\/ 2 <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 SVM \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 fit, \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043a\u0430\u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f9c\/3c8\/e48\/f9c3c8e488ead4696749012f5ece6d13.svg\" alt=\"$0$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3e4\/c77\/a6e\/3e4c77a6e7c579a778fa84a18b6f4be0.svg\" alt=\"$1$\" data-tex=\"inline\"><\/math> (\u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d06\/719\/edc\/d06719edc69908e7467f7e6189302b74.svg\" alt=\"$-1$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9d1\/49e\/a8e\/9d149ea8ef8692eb106a55ce5af36ccd.svg\" alt=\"$+1$\" data-tex=\"inline\"><\/math>, \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 sklearn), \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0444\u0438\u0447 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439. \u0414\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f predict.<\/p>\n<p>  <a name=\"secComparison\"><\/a>  <\/p>\n<h2>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 sklearn.svm.SVC<\/h2>\n<p>  \u041d\u0435 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043b\u043e \u043e\u0441\u043e\u0431\u044b\u0439 \u0441\u043c\u044b\u0441\u043b, \u0432\u0435\u0434\u044c \u0440\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0446\u0435\u043b\u044f\u0445 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0438 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u0438\u043c \u0432\u0441\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f) \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 (\u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431 <a href=\"#smo_repo\">[14]<\/a>)<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 sklearn.svm.SVC \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from sklearn.svm import SVC import matplotlib.pyplot as plt import seaborn as sns; sns.set() from sklearn.datasets import make_blobs, make_circles from matplotlib.colors import ListedColormap  def test_plot(X, y, svm_model, axes, title):   plt.axes(axes)   xlim = [np.min(X[:, 0]), np.max(X[:, 0])]   ylim = [np.min(X[:, 1]), np.max(X[:, 1])]   xx, yy = np.meshgrid(np.linspace(*xlim, num=700), np.linspace(*ylim, num=700))   rgb=np.array([[210, 0, 0], [0, 0, 150]])\/255.0      svm_model.fit(X, y)   z_model = svm_model.decision_function(np.c_[xx.ravel(), yy.ravel()]).reshape(xx.shape)      plt.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn')   plt.contour(xx, yy, z_model, colors='k', levels=[-1, 0, 1], alpha=0.5, linestyles=['--', '-', '--'])   plt.contourf(xx, yy, np.sign(z_model.reshape(xx.shape)), alpha=0.3, levels=2, cmap=ListedColormap(rgb), zorder=1)   plt.title(title)  X, y = make_circles(100, factor=.1, noise=.1) fig, axs = plt.subplots(nrows=1,ncols=2,figsize=(12,4)) test_plot(X, y, SVM(kernel='rbf', C=10, max_iter=60, gamma=1), axs[0], 'OUR ALGORITHM') test_plot(X, y, SVC(kernel='rbf', C=10, gamma=1), axs[1], 'sklearn.svm.SVC')  X, y = make_blobs(n_samples=50, centers=2, random_state=0, cluster_std=1.4) fig, axs = plt.subplots(nrows=1,ncols=2,figsize=(12,4)) test_plot(X, y, SVM(kernel='linear', C=10, max_iter=60), axs[0], 'OUR ALGORITHM') test_plot(X, y, SVC(kernel='linear', C=10), axs[1], 'sklearn.svm.SVC')  fig, axs = plt.subplots(nrows=1,ncols=2,figsize=(12,4)) test_plot(X, y, SVM(kernel='poly', C=5, max_iter=60, degree=3), axs[0], 'OUR ALGORITHM') test_plot(X, y, SVC(kernel='poly', C=5, degree=3), axs[1], 'sklearn.svm.SVC') <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u043d\u0434\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439, \u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043b\u0435\u0433\u043a\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 (\u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e: \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435, \u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0438 rbf \u044f\u0434\u0440\u0430)  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r7\/wy\/fk\/r7wyfk4adqlxvhwigiruscornpm.png\" width=\"300\"><\/div>\n<\/td>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dm\/bj\/1u\/dmbj1u7smri93dawzwfcm3lmbyu.png\" width=\"300\"><\/div>\n<\/td>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rj\/p3\/pi\/rjp3piyovg0pzo3u-eamanquvx0.png\" width=\"300\"><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  \u0410 \u044d\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432.  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ky\/70\/g8\/ky70g8odtyjszv3z5aqgccytefm.png\" width=\"300\"><\/div>\n<\/td>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zn\/wy\/pg\/znwypgz4p_rjuktzmhkwblwkmfw.png\" width=\"300\"><\/div>\n<\/td>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hz\/ms\/a_\/hzmsa_9kte_cf2htdfmolegf750.png\" width=\"300\"><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/dfd\/8a0\/d2f\/dfd8a0d2fe6ea30b4cde7f570eca349b.svg\" alt=\"$2$\" data-tex=\"inline\"><\/math> \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 MNIST<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 sklearn.svm.SVC \u043d\u0430 2-\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0438\u0437 MNIST<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from sklearn import datasets, svm from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix import matplotlib.pyplot as plt import seaborn as sns  class_A = 3 class_B = 8  digits = datasets.load_digits() mask = (digits.target == class_A) | (digits.target == class_B) data = digits.images.reshape((len(digits.images), -1))[mask] target = digits.target[mask] \/\/ max([class_A, class_B]) # rescale to 0,1 X_train, X_test, y_train, y_test = train_test_split(data, target, test_size=0.5, shuffle=True)  def plot_confusion(clf):   clf.fit(X_train, y_train)   y_fit = clf.predict(X_test)    mat = confusion_matrix(y_test, y_fit)   sns.heatmap(mat.T, square=True, annot=True, fmt='d', cbar=False, xticklabels=[class_A,class_B], yticklabels=[class_A,class_B])   plt.xlabel('true label')   plt.ylabel('predicted label');   plt.show()  print('sklearn:') plot_confusion(svm.SVC(C=1.0, kernel='rbf', gamma=0.001)) print('custom svm:') plot_confusion(SVM(kernel='rbf', C=1.0, max_iter=60, gamma=0.001)) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0414\u043b\u044f MNIST \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u0430\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 (\u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0443\u044e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e), \u043d\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0438 sklearn \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0430\u0451\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f confusion matrix.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j0\/rj\/u9\/j0rju98q2-ofe4lu2srjvvsadr4.png\" width=\"268\"><\/div>\n<p>  <a name=\"secConclusion\"><\/a>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b \u0434\u043e \u043a\u043e\u043d\u0446\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u0443\u044e \u0443\u0447\u0435\u0431\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0441\u0442\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u043c, \u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u0430 Python, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 SMO \u0431\u044b\u043b\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b, \u044d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f SVM \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0451 \u043c\u0435\u0441\u0442\u043e \u0432 \u0443\u0447\u0435\u0431\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u043e\u0449\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043c\u0443\u0434\u0440\u0451\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 <a href=\"#platt\">[9]<\/a>, \u043d\u043e \u0434\u0430\u0436\u0435 \u0435\u0433\u043e \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u0442 \u0421\u0442\u044d\u043d\u0444\u043e\u0440\u0434\u0441\u043a\u043e\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 <a href=\"#stanford\">[11]<\/a>. \u0412\u0441\u0435-\u0442\u0430\u043a\u0438 \u043c\u0430\u0448\u0438\u043d\u0430 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 30 \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u0445 \u2014 \u044d\u0442\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e.<\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/h2>\n<ol>\n<li><a name=\"git_demo\"><\/a> <a href=\"https:\/\/fbeilstein.github.io\/simplest_smo_ever\/\" rel=\"nofollow noopener noreferrer\">https:\/\/fbeilstein.github.io\/simplest_smo_ever\/<\/a> <\/li>\n<li><a name=\"woron\"><\/a><a href=\"http:\/\/www.machinelearning.ru\/wiki\/index.php?title=%D0%9C%D0%B0%D1%88%D0%B8%D0%BD%D0%BD%D0%BE%D0%B5_%D0%BE%D0%B1%D1%83%D1%87%D0%B5%D0%BD%D0%B8%D0%B5_%28%D0%BA%D1%83%D1%80%D1%81_%D0%BB%D0%B5%D0%BA%D1%86%D0%B8%D0%B9%2C_%D0%9A.%D0%92.%D0%92%D0%BE%D1%80%D0%BE%D0%BD%D1%86%D0%BE%D0%B2%29\" rel=\"nofollow noopener noreferrer\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0430 http:\/\/www.machinelearning.ru<\/a><\/li>\n<li><a name=\"gitrepo\"><\/a> <a href=\"https:\/\/github.com\/fbeilstein\/machine_learning\" rel=\"nofollow noopener noreferrer\">\u00ab\u041d\u0430\u0447\u0430\u043b\u0430 \u041c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u044f\u00bb, \u041a\u0410\u0423<\/a> <\/li>\n<li><a name=\"kernel\"><\/a> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Kernel_method\" rel=\"nofollow noopener noreferrer\">https:\/\/en.wikipedia.org\/wiki\/Kernel_method<\/a> <\/li>\n<li><a name=\"wiki_opt\"><\/a> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Duality_(optimization)\" rel=\"nofollow noopener noreferrer\">https:\/\/en.wikipedia.org\/wiki\/Duality_(optimization)<\/a> <\/li>\n<li><a name=\"merser\"><\/a> <a href=\"http:\/\/www.machinelearning.ru\/wiki\/index.php?title=%D0%A2%D0%B5%D0%BE%D1%80%D0%B5%D0%BC%D0%B0_%D0%9C%D0%B5%D1%80%D1%81%D0%B5%D1%80%D0%B0\" rel=\"nofollow noopener noreferrer\">\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430 http:\/\/www.machinelearning.ru<\/a> <\/li>\n<li><a name=\"video\"><\/a> <a href=\"https:\/\/www.youtube.com\/watch?v=MTY1Kje0yLg\" rel=\"nofollow noopener noreferrer\">https:\/\/www.youtube.com\/watch?v=MTY1Kje0yLg<\/a> <\/li>\n<li><a name=\"wiki_smo\"><\/a> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Sequential_minimal_optimization\" rel=\"nofollow noopener noreferrer\">https:\/\/en.wikipedia.org\/wiki\/Sequential_minimal_optimization<\/a> <\/li>\n<li><a name=\"platt\"><\/a> Platt, John. Fast Training of Support Vector Machines using Sequential Minimal Optimization, in Advances in Kernel Methods \u2013 Support Vector Learning, B. Scholkopf, C. Burges, A. Smola, eds., MIT Press (1998). <\/li>\n<li><a name=\"wiki_kkt\"><\/a> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Karush%E2%80%93Kuhn%E2%80%93Tucker_conditions\" rel=\"nofollow noopener noreferrer\">https:\/\/en.wikipedia.org\/wiki\/Karush%E2%80%93Kuhn%E2%80%93Tucker_conditions<\/a> <\/li>\n<li><a name=\"stanford\"><\/a> <a href=\"http:\/\/cs229.stanford.edu\/materials\/smo.pdf\" rel=\"nofollow noopener noreferrer\">http:\/\/cs229.stanford.edu\/materials\/smo.pdf<\/a> <\/li>\n<li><a name=\"rgarticle\"><\/a> <a href=\"https:\/\/www.researchgate.net\/publication\/344460740_Yet_more_simple_SMO_algorithm\" rel=\"nofollow noopener noreferrer\">https:\/\/www.researchgate.net\/publication\/344460740_Yet_more_simple_SMO_algorithm<\/a> <\/li>\n<li><a name=\"fullderiv\"><\/a> <a href=\"http:\/\/fourier.eng.hmc.edu\/e176\/lectures\/ch9\/node9.html\" rel=\"nofollow noopener noreferrer\">http:\/\/fourier.eng.hmc.edu\/e176\/lectures\/ch9\/node9.html<\/a> <\/li>\n<li><a name=\"smo_repo\"><\/a> <a href=\"https:\/\/github.com\/fbeilstein\/simplest_smo_ever\" rel=\"nofollow noopener noreferrer\">https:\/\/github.com\/fbeilstein\/simplest_smo_ever<\/a> <\/li>\n<\/ol>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/544282\/\"> https:\/\/habr.com\/ru\/post\/544282\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0431\u0435\u0437 scikit-learn \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432\u0441\u0435\u0433\u043e \u0432 30 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043d\u0430 Python. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 SMO, \u043d\u043e \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-318723","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=318723"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318723\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}