CVXOPT converges to same solution regardless of constraints

55 views
Skip to first unread message

Ankit Kulshrestha

unread,
Feb 15, 2021, 6:15:09 PM2/15/21
to CVXOPT
Hi, 

I'm trying to optimize a  quadratic program to obtain a solution for a constrained SVM. There are 3 parameters that my algorithm takes. C: margin for soft SVM, gamma: the term in rbf kernel, and eps: epsilon to constrain the SVM into obtaining little bit different solution. 

The overall quadratic program is of the form:

```
P = np.outer(y, y) * K # Kernel matrix computed from data
q = np.ones(N) * -1 # N = num samples
A = y.astype(np.double).reshape(1, N)
b = 0.0
tau = [(np.sum(K[pts1, i])/len(pts1)) - (np.sum(K[pts2, i])/len(pts2)) for i in range(len(y))] 
G = np.vstack([np.eye(N) * -1, np.identity(N), np.diag(tau)] 
h = np.hstack([np.zeros(N), np.ones(N) * C, np.ones(N) * eps] # last constraint tau <= eps
```
My observation is that whenever I change the eps constraint, the value of the optimal solution does not change (the solver returns `optimal` status).  I'm not sure what's going on and how to debug this situation. 

Any help will be appreciated. 



Reply all
Reply to author
Forward
0 new messages