How to simulate the given optimization problem related to SVM in MATLAB ?

Hello all, I am trying to optimize the following problem in MATLAB. It is related to multiclass classification using SVM. There are total 16 classes (𝓁 is from 1 to 16).
where is a column vector of dimension , is also a column vector of dimension , is matrix of dimension , is row vector of and is the Gaussian radial basis function, where is the variance.
The main moto in this optmization problem is to obtain the value of α for 16 different 𝓁 i.e., I have to obtain .
With the help from Torsten (Level 9 MVP) and Matt J (Level 10 MVP), I had understood how to solve the function inside two summation.
My query is for 16 different b each of dimension , how to solve this optimization problem.
Any help in this regard will be highly appreciated.

4 Commenti

I have the following code for .
K=rand(3);
K=K*K.';
b=rand(3,1)-0.5;
C=5;
alpha=optimvar('alpha',numel(b),'LowerBound',0,'UpperBound',C);
prob=optimproblem('Objective',alpha.'*(b.*K.*b')*alpha/2-sum(alpha),...
'Constraints', b'*alpha==0);
sol=solve(prob).alpha
So by repeating the above code 16 times, we get 16 different α i.e.,
So is this approach correct ?
Any hint in this regard will be highly appreciated.
So is this approach correct ?
Probably. But why not just try it, rather than waiting hours and hours for other people to weight in? You could have verified by now whether it works.
The code above is not for l=1, but a general code for arbitrary dimension of alpha.
You only need to fill in the correct values for K, b and C instead of the phantasy values used here:
K=rand(3);
K=K*K.';
b=rand(3,1)-0.5;
C=5;

Accedi per commentare.

Risposte (0)

Richiesto:

il 21 Mar 2023

Modificato:

il 23 Mar 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by