Unexpected result when solving a SVM model (Quadratic Programming)
回答済みI am trying to use Gurobi to solve the following risk-averse SVM model from a paper:

In the above pic, the model is trying to apply two coherent risk measures on two classes, note that the upper index is not powers, they meant to indicate the first class and second, the lower index means the jth data from that class. So this is a convex quadratic programming, and the only quadratic terms are those in the norm of v squared, here the norm is Euclidean.
And the following is my code:
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi,
You could use the Model.write() function to write an LP file and check whether the problem looks as you expect. You can write problem files from third party API by using the ResultFile parameter or as described in How do I write an MPS model file from a third-party API?
Best regards,
Jaromił0 -
Hi,
Thank you for the reply. But I have already tried this, the lp file looks perfect for me, still the answer is somehow very far from perfect.
Best,
Xiangyu
0 -
Hi,
Did you write the LP files from both interfaces, i.e., from Gurobi's Python interface and from the CVXOPT interface? If you write out the two LP files and solve them using the command line tool, do you get the same results when setting ResultFile=solution.sol?
Best regards,
Jaromił0 -
I only inspected LP file written by Gurobi. I don't know if it is possible to write the model with CVXOPT, I have searched for a while but haven't found anyway to do that yet. Do you know how to do this or any links for me to go see for myself? Thank you again.
0 -
You can write an MPS file as described in How do I write an MPS model file from a third-party API? You can then translate the MPS file to a human readable LP format using the write() function, or via
gurobi_cl ResultFile=myModel.lp myModel.mps
The parameter ResultFile makes Gurobi write the problem to an LP file after the optimization problem is done.
0
投稿コメントは受け付けていません。
コメント
6件のコメント