• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

vincent27hugh/mySVM-MATLAB: Here is my implementation of Support Vector Machine ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

vincent27hugh/mySVM-MATLAB

开源软件地址(OpenSource Url):

https://github.com/vincent27hugh/mySVM-MATLAB

开源编程语言(OpenSource Language):

MATLAB 100.0%

开源软件介绍(OpenSource Introduction):

My own implementation of SVM and TSVM in MATLAB

Here are files of my own implementation of Support Vector Machine (SVM) & Transductive SVM (TSVM) in MATLAB.

Kernel Method

Kernels used in this project1:

  • Linear kernel: ;
  • Polynomial kernel: ;
  • Gaussian Kernel (RBF): ;
  • Sigmoid kernel: ;

Optimization

The dual problems of SVM is a quadratic optimization problem with linear constraints. So we solved it using quadprog function of MATLAB Quadratic Programming Toolbox.

How to use it

  • Step 1: Load the data. You'd better reshape the data as follow:
    • X is the matrix of input data with dimension of N-by-p where N is the number of instances and p is the number of features. For the convenience of visualization, we define p=2 here;
    • Y is the column vector of output data with dimension of N-by-1;
  • Step 2: Define parameters ion define_parameters.m file.
    • poly_con is the parameter for Polynomial Kernel,
    • gamma is the parameter for Gaussian Kernel,
    • kappa1 & kappa2 are the parameters for Sigmoid Kernel,
    • precision is the tolerance of precision,
    • Cost is the hyperparameter for SVM.
  • Step 3: Fit the model using SVM.m file. Choose the kernel you want and fit the model with your data.
  • Step 4: Visualize the 2D plot. If the number of features of your data is 2, you can visualize your result using SVM_plot.m file.

Demo of binary classification of hard margin models

Data-set

MATLAB sample data set Fisher's 1936 iris data (fisheriris) consists of measurements on the sepal length, sepal width, petal length, and petal width for 150 iris specimens. There are 50 specimens from each of three species:

  • Setosa,
  • Versicolor,
  • Virginica.

SVM

Support Vector Machine (SVM) [Cortes & Vapnuk, 1995] is a supervised learning model.

The following are the demo of SVM:

Transductive SVM (TSVM)

Transductive SVM (TSVM) [Joachims, 1995] is a semi-supervised learning model.

The following are the demo of TSVM:

Readings

Other Implementations on GitHub

Reference

  • Cortes, C., & Vapnik, V. (1995). Support-vector networks. Machine learning, 20(3), 273-297.
  • Joachims, T. (1999, June). Transductive inference for text classification using support vector machines. In ICML (Vol. 99, pp. 200-209).

Task lists

  • Hard margin SVM with linear kernel
  • Hard margin TSVM with linear kernel
  • Add nonlinear kernels to SVM
  • Add nonlinear kernels to TSVM
  • Soft margin for SVM
  • Soft margin for TSVM
  • Add multiple level classification function
  • Visualization of hyper-plane in 3D plot

Footnotes

  1. Kernel Functions for Machine Learning Applications




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap