LFD Book Forum  

Go Back   LFD Book Forum > Course Discussions > Online LFD course > Homework 7

Reply
 
Thread Tools Display Modes
  #51  
Old 02-23-2013, 05:55 PM
Haowen Haowen is offline
Member
 
Join Date: Jan 2013
Posts: 24
Default Re: What Quadratic Programming Package?

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.
Reply With Quote
  #52  
Old 02-23-2013, 08:18 PM
Marc Zucker Marc Zucker is offline
Member
 
Join Date: Jan 2013
Posts: 24
Default Re: What Quadratic Programming Package?

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
Reply With Quote
  #53  
Old 02-23-2013, 09:45 PM
Haowen Haowen is offline
Member
 
Join Date: Jan 2013
Posts: 24
Default Re: What Quadratic Programming Package?

EDIT: Marc: I see you have a thread with *ANSWER* in the title, I will discuss there.
Reply With Quote
  #54  
Old 02-25-2013, 12:30 PM
hemphill hemphill is offline
Member
 
Join Date: Jan 2013
Posts: 18
Default Re: What Quadratic Programming Package?

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.
Reply With Quote
  #55  
Old 05-18-2013, 05:54 PM
alpha alpha is offline
Junior Member
 
Join Date: Apr 2013
Posts: 1
Default Re: What Quadratic Programming Package?

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
Reply With Quote
  #56  
Old 01-28-2016, 10:52 AM
galo galo is offline
Junior Member
 
Join Date: Jan 2016
Posts: 7
Default Re: What Quadratic Programming Package?

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.
Reply With Quote
Reply

Tags
hw7, package, quadratic programming

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:16 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.