Hello, everyone, could you help me? just as the paper (“Robust twin support vector machine for pattern classification”) says, I want to solve this problem. Although no error, but the results seems errors. This is my code:
A = X_train(y_train == 1, :);
B = X_train(y_train ~= 1, :);
n = size(X_train, 1);
n1 = size(A, 1);
n2 = size(B, 1);
c1 = 100;
But one thing I noticed is that unless r is a vector of ones, you are missing it in norm(lambda1’ * A - alpha1’ * B) <= sum(alpha1 - gamma1).
I also have no idea whether gamma1 is supposed to be inside or outside the sum. That is for you to determine.
From a CVX perspective, this problem is extremely straightforward to enter. Getting it correct is a matter of getting the details correct, and very importantly, understanding the actual optimization problem specification, even though it might be ambiguous in the image you posted.
Hi, Mrak, Thank you for your kind reply. For the sake of simplification, I regard r as a vector of 1. I’m still stuck in how to solve this problem (fig:1). Similar to the paper(“Robust twin support vector machine for pattern classificatio”), I’m trying my best to solve the same optimization problem:
These can be entered in CVX “as is”, and will be solved as SOCP. Getting it correct is a matter of making sure your indexing is correct, which is really more a standard MATLAB syntax than CVX-specific matter.
Thank you, sincerely. Perhaps, I got it. I need to transfer the objective function and the corresponding constrains into CVX-specific form rather than MATLAB syntax. I’m tring my best to do that… Thank you again
hi, Mark, your comments have helped me a lot and the optimization problem (SOCP) have been solved by cvx. However, I found the speed seems too slow. Thus, I want to use sedumi instead cvx to solve SOCP. I have convert my SOCP to sedumi(At, bt, ct, K), and I want to know the difference between my form and that by cvx. In a words, is there any methods to display the At, bt, ct, K in cvx?
Run time in CVX is roughly divided into CVX modeling time, solver time and CVX post-processing time, the last of which is generally negligible. Your time savings from directly calling sedumi would be eliminating CVX modeling time, which is the time until the first output is written. if the excessive run time is in the solution phase (after first CVX output is written), you are unlikely to save much, if any, time, by directly calling sedumik.
Edit: See my next post.
You could use YALMIP, instead of CVX, and make use of its optimizer capability, which allows for repeated solution of the same problem with different input data, in a way which avoids most of the model setup time. it also allows you to export models into various formats, such as sedumi, as shown at export - YALMIP .