![]() |
#51
|
|||
|
|||
![]()
Just an update for 2013... similar to earlier posters in this thread, I tried using the R package "quadprog" and solve.QP kept aborting with the complaint that my (correctly formatted) matrix D was not positive definite. Simply switching to the kernlab package and using ipop fixed the issue.
Next time I should check the forums first... this cost me quite a few hours looking for a bug that wasn't there. |
#52
|
|||
|
|||
![]()
How did you get ipop to work. It works for me, but I keep getting errors (such as the matrix is not positive definite), or I get an answer that is not actually the right one. For n=10 everything worked great, but not for n=100. Do you mind sharing your settings for the inputs into ipop?
Thanks |
#53
|
|||
|
|||
![]()
EDIT: Marc: I see you have a thread with *ANSWER* in the title, I will discuss there.
|
#54
|
|||
|
|||
![]()
I've tried the C package below, and it gives mostly correct results (as far as I know), although the running time varies widely, and sometimes it seems to loop forever. It is a fairly minimal implementation, e.g. it is assumed that the caller will provide a feasible solution to start with. Fortunately, alpha = 0 satisfies the bounds and is therefore a feasible solution of the quadratic program.
http://cmp.felk.cvut.cz/~xfrancv/libqp/libqp.zip I've also downloaded SupportVectorMachines.nb and MathSVM.m for Mathematica from the below URL. I've examined the code and it appears to do more or less the right thing, but also seems like a minimal implementation. http://www.mathematica-journal.com/i...10i1/download/ I finally went with CGAL in C++ which has an exceptional pedigree. It was also very easy to install on my Fedora Linux system. ("yum install CGAL\*"). I can get around in C++, but I am hardly an expert. What I did was take a couple of the example programs and cobble them together. "/usr/share/CGAL/QP_solver/print_first_nonnegative_qp_from_mps.cpp" almost did what I wanted, but I changed the prototyping to use floating point instead of integer arithmetic, borrowing the prototypes from "/usr/share/CGAL/QP_solver/cycling.cpp". The code solves both linear and quadratic programs, and if you define them using integers, then it gives exact rational solutions using multiple precision arithmetic. If you use floating point, it also works out the solution using exact, multiple precision arithmetic. (Which is why it prints the weights as ratios of two floating point numbers.) This particular example program reads the quadratic program from an .mps file, which is defined in the CGAL manual. I modified the example program to read from the standard input. It already wrote the solution on the standard output. This meant that I had a utility program that I could now call from any programming language. My language of choice for this exercise was C. The CGAL manual was not part of the Fedora Linux package, but I was able to obtain it from: http://www.cgal.org/download.html Lastly, if you want to roll your own, a nice overview can be had in Keerthi, S.S. & Gilbert, E.G.(2002)Convergence of a Generalized SMO Algorithm for SVM Classifier Design. Machine Learning, 46, 351--360, 2002, Kluwer Academic Publishers. Additional details can be found in the references, including: Keerthi, S.S., Shevade, S.K., Bhattacharyya, C. & Murthy, K.R.K.(1999)Improvements to Platt's SMO algorithm for SVM classifier design. Technical Report CD-99-14, Control Division, Dept. of Mechanical and Production Engineering, National University of Singapore. I had no trouble obtaining free copies of these documents by Googling on their titles. |
#55
|
|||
|
|||
![]()
Hi there,
Regarding Q8-Q10 in HW#7 Is there a Quadratic Programming package that works with excel 2003? I haven't used C or C++ since a very very long time and don't even have a compiler ![]() Appreciate any help pointing in the right direction. many thanks |
#56
|
|||
|
|||
![]()
I'm using python and the easiest way I found to install a quadratic programming package is by following the instructions in this Stack Overflow comment. Download the MLK build for numpy even though it includes numpy, because if you already have numpy it doesn't mean that you have MLK.
|
![]() |
Tags |
hw7, package, quadratic programming |
Thread Tools | |
Display Modes | |
|
|