File Exchange

SVM for nonlinear classification

version 1.0.0.0 (91.8 KB) by Bhartendu

Bhartendu (view profile)

SVM on (Non-linearly Seperable Data) using polynomial Kernel

Updated 19 May 2017

Refer: An Introduction to Support Vector Machines and Other Kernel-based Learning Methods by Nello Cristianini and John Shawe-Taylor]
The training algorithm only depend on the data through dot products in H, i.e. on functions of the form Φ(x_i)·Φ(x_j). Now if there were a “kernel function” K such that
K(x_i,x_j) = Φ(x_i)·Φ(x_j),
we would only need to use K in the training algorithm, and would never need to explicitly even know what Φ is. One example is radial basis functions (RBF) or gaussian kernels where, H is inﬁnite dimensional, so it would not be very easy to work with Φ explicitly.
Training the model requires the choice of:
• the kernel function, that determines the shape of the decision surface
• parameters in the kernel function (eg: for gaussian kernel:variance of the Gaussian, for polynomial kernel: degree of the polynomial)
• the regularization parameter λ.

fatima farooq

Bhartendu

Bhartendu (view profile)

@Luji tel : Try the following changes:
w1=(alp_old.*Y).*X; ==> w1=(alp_old.*Y)'*X;
w2=(alpha.*Y).*X; ==> w2=(alpha.*Y)'*X;

https://in.mathworks.com/matlabcentral/fileexchange/63158-support-vector-machine

Bhartendu

Bhartendu (view profile)

I see no bugs. Better brush-up your skills.

Yueyin Zhou

bug exist

Luji tel

Luji tel (view profile)

Hi.When I run svm_NonLinear.m using the given dataset 'conical.csv'. I am just testing the program and not changing anything and getting this error at line 12:
Error using .*
Matrix dimensions must agree.

Error in grad_asc_poly (line 12)
w1=(alp_old.*Y_Data).*X_Data;

Error in svm_NonLinear (line 32)

earth science learner

Vidhula M.V

Santhana Raj

Santhana Raj (view profile)

Hi,

The non linear SVM is unable to classify the dataset generated as below. Can you help me on this?

no_feat=2;
N1 = 50; N2 = 60; N3=65;% Class sizes
x = [randn(N1,no_feat);rand(N2,no_feat)+6;rand(N3,no_feat)+12];
y = [repmat(-1,N1,1);repmat(1,N2,1);repmat(-1,N3,1)];

DUSHYANTH S R

SHARON BABU

SHARON BABU (view profile)

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux