当前位置: 首页 > news >正文

SMO算法,platt论文的原始算法及优化算法

 platt论文:[PDF] Sequential Minimal Optimization : A Fast Algorithm for Training Support Vector Machines | Semantic Scholar

算法优化:[PDF] Improvements to Platt's SMO Algorithm for SVM Classifier Design | Semantic Scholar

包含个人platt版SMO代码实现、SMO 优化算法、libsvm:yanzhi0922/SVM: 2024.07.12 (github.com)

数据集获取:LIBSVM Data: Classification, Regression, and Multi-label (ntu.edu.tw)

platt原论文SMO伪代码:

target = desired output vector
point = training point matrix
procedure takeStep(i1,i2)if (i1 == i2) return 0alph1 = Lagrange multiplier for i1y1 = target[i1]E1 = SVM output on point[i1] – y1 (check in error cache)s = y1*y2Compute L, H via equations (13) and (14)if (L == H)return 0k11 = kernel(point[i1],point[i1])k12 = kernel(point[i1],point[i2])k22 = kernel(point[i2],point[i2])eta = k11+k22-2*k12if (eta > 0){a2 = alph2 + y2*(E1-E2)/etaif (a2 < L) a2 = Lelse if (a2 > H) a2 = H}else{Lobj = objective function at a2=LHobj = objective function at a2=Hif (Lobj < Hobj-eps)a2 = Lelse if (Lobj > Hobj+eps)a2 = Helsea2 = alph2}if (|a2-alph2| < eps*(a2+alph2+eps))return 0a1 = alph1+s*(alph2-a2)Update threshold to reflect change in Lagrange multipliersUpdate weight vector to reflect change in a1 & a2, if SVM is linearUpdate error cache using new Lagrange multipliersStore a1 in the alpha arrayStore a2 in the alpha arrayreturn 1
endprocedureprocedure examineExample(i2)y2 = target[i2]alph2 = Lagrange multiplier for i2E2 = SVM output on point[i2] – y2 (check in error cache)r2 = E2*y2if ((r2 < -tol && alph2 < C) || (r2 > tol && alph2 > 0)){if (number of non-zero & non-C alpha > 1){i1 = result of second choice heuristic (section 2.2)if takeStep(i1,i2)return 1}loop over all non-zero and non-C alpha, starting at a random point{i1 = identity of current alphaif takeStep(i1,i2)return 1}loop over all possible i1, starting at a random point{i1 = loop variableif (takeStep(i1,i2)return 1}}return 0
endproceduremain routine:numChanged = 0;examineAll = 1;while (numChanged > 0 | examineAll){numChanged = 0;if (examineAll)loop I over all training examplesnumChanged += examineExample(I)elseloop I over examples where alpha is not 0 & not CnumChanged += examineExample(I)if (examineAll == 1)examineAll = 0else if (numChanged == 0)examineAll = 1
}

以上算法基本原理相同,结果相同,优化是时间复杂度上的优化 ,libsvm时间复杂度最优

http://www.lryc.cn/news/408612.html

相关文章:

  • 2.3 openCv -- 对矩阵执行掩码操作
  • 【Django】 js实现动态赋值、显示show隐藏hide效果
  • qt--做一个拷贝文件器
  • Eclipse 搭建 C/C++ 开发环境以及eclipse的使用
  • 【初阶数据结构】复杂度算法题篇
  • 20240725项目的maven环境报红-重新配置maven
  • 若依 ruoyi poi Excel合并行的导入
  • 优化算法:1.遗传算法(GA)及Python实现
  • 企业化运维(8)Docker容器技术
  • Unity C#底层原理(二)
  • 计算机网络-配置路由器ACL(访问控制列表)
  • 51单片机嵌入式开发:20、STC89C52R基于C51嵌入式点阵广告屏的设计
  • VLC输出NDI媒体流
  • WiFi 局域网通信 - 发现服务和解析
  • ChatGPT建议前端学习计划
  • YOLO5项目目录最强解析
  • 【python】sklearn基础教程及示例
  • Linux:传输层(2) -- TCP协议(2)
  • AcWing 802. 区间和
  • 实验2-2-1 温度转换
  • Spark实时(六):Output Sinks案例演示
  • 在SQL编程中DROP、DELETE和TRUNCATE的区别
  • 【AI大模型】Prompt 提示词工程使用详解
  • 学习记录day18——数据结构 算法
  • 一篇文章带你学完Java所有的时间与日期类
  • 利用GPT4o Captcha工具和AI技术全面识别验证码
  • 大学生算法高等数学学习平台设计方案 (第一版)
  • 机器学习算法与Python实战 | 两行代码即可应用 40 个机器学习模型--lazypredict 库!
  • 使用WebSocket协议调用群发方法将消息返回客户端页面
  • 【北京迅为】《i.MX8MM嵌入式Linux开发指南》-第三篇 嵌入式Linux驱动开发篇-第五十七章 Linux中断实验