LFD Book Forum  

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

Reply
 
Thread Tools Display Modes
  #21  
Old 05-20-2012, 07:39 PM
alfansome alfansome is offline
Member
 
Join Date: Apr 2012
Posts: 35
Default Re: What Quadratic Programming Package?

Quote:
Originally Posted by lucag View Post
mmm that's weird: I do get tons of warnings but at the end it works just fine (tried with one of the examples provided). The version installed is 2.7.1
Did you install it globally or only for a specific user? I don't know if it changes anything, but I installed it as root -- sudo python setup.py install -- on my machine.
I replied earlier, but not posted (yet); I was trying to install for specific user; I have now done it for all users and, despite the warnings, it does run the examples ok. Now on to the hard part

@dudefromdayton - thanks for the input, yes mac os x has the correct dependencies.
Reply With Quote
  #22  
Old 05-20-2012, 08:14 PM
markweitzman markweitzman is offline
Invited Guest
 
Join Date: Apr 2012
Location: Las Vegas
Posts: 69
Default Re: What Quadratic Programming Package?

I too am using Mac OSX lion and was unable to install the CVXQPT package. Kept getting unable to find gcc etc. errors. I have several python distributions installed and I am currently using the Enthought 7.2-2 64 bit distribution which comes with many packages but unfortunately not CVXQPT. But it does come with scikit-learn which is a complete machine learning package and has many machine learning algorithms including support vector machines. As a test I used maple 15 quadratic program solver and unfortunately I am getting agreement between the Maple and python programs only 75% of the time.

Mark Weitzman
Reply With Quote
  #23  
Old 05-20-2012, 09:14 PM
Yellin Yellin is offline
Member
 
Join Date: Apr 2012
Posts: 26
Default Re: What Quadratic Programming Package?

The matrix D (called Q in the lecture) is such that for any b (called alpha in the lecture) b^T D b is w^T w, which cannot be negative. But with enough x_n vectors the x_n will surely be linearly dependent, so there are possible b such that w will be zero. D is therefore non-negative, but is certainly not positive definite. I think the statement in the quadprod code which causes the error is in dpofa, which checks that something is positive before taking the square root. Maybe it would work to modify the dpofa source so that where it's about to take the square root it checks that it's not negative, to within roundoff errors, and if the quantity is almost zero, replace its square root with something very small and positive.

I tried the modification of dpofa, and it gave strange results, so I undid the change and instead forced D to be positive definite by adding a small number to each of the diagonal elements. But even though D is now positive definite, the program returns complaining that it isn't.
Reply With Quote
  #24  
Old 05-20-2012, 09:21 PM
alfansome alfansome is offline
Member
 
Join Date: Apr 2012
Posts: 35
Default Re: What Quadratic Programming Package?

Quote:
Originally Posted by markweitzman View Post
I too am using Mac OSX lion and was unable to install the CVXQPT package. Kept getting unable to find gcc etc. errors. I have several python distributions installed and I am currently using the Enthought 7.2-2 64 bit distribution which comes with many packages but unfortunately not CVXQPT. But it does come with scikit-learn which is a complete machine learning package and has many machine learning algorithms including support vector machines. As a test I used maple 15 quadratic program solver and unfortunately I am getting agreement between the Maple and python programs only 75% of the time.

Mark Weitzman
you may need to download Xcode dev tools from app store to build cvxopt
Reply With Quote
  #25  
Old 05-20-2012, 10:44 PM
markweitzman markweitzman is offline
Invited Guest
 
Join Date: Apr 2012
Location: Las Vegas
Posts: 69
Default Re: What Quadratic Programming Package?

Thank you - I have started that process - I used xcode before but I have not updated it so maybe when I have finished installing new version it will work.

Mark Weitzman
Reply With Quote
  #26  
Old 05-21-2012, 10:17 AM
alfansome alfansome is offline
Member
 
Join Date: Apr 2012
Posts: 35
Default Re: What Quadratic Programming Package?

Quote:
Originally Posted by markweitzman View Post
Thank you - I have started that process - I used xcode before but I have not updated it so maybe when I have finished installing new version it will work.

Mark Weitzman
ok; good luck; while you're waiting, you might also check out the Sage site - it is python based but includes a number of add-on packages, including cvxopt. The problem is that the latest version (5.0) seems to have a few bugs in it when run on mac platform - But, you can actually use their online notebook to write and execute programs, so you don't have to download and install anything. It can be referenced from sage www.math.org (general site) and then www.sagenb.org (for the online notebook).

(I used this while I was having problems with cvxopt and it seemed to work well)
Reply With Quote
  #27  
Old 05-21-2012, 02:55 PM
markweitzman markweitzman is offline
Invited Guest
 
Join Date: Apr 2012
Location: Las Vegas
Posts: 69
Default Re: What Quadratic Programming Package?

Well I finally got cvxopt installed and running, and it worked on my first test, but now I keep getting errors about rank(A) < p or Rank([P;A;G])< n. I make sure my y's have different values so I am confused why I am getting these errors. Any help appreciated. Guess I will have to go with my machine learning scientific package,

Mark Weitzman
Reply With Quote
  #28  
Old 05-21-2012, 03:34 PM
jg2012 jg2012 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 7
Default Re: What Quadratic Programming Package?

Anyone have success with Octave + qp? I always get zeros back for all alphas, which is the first return parameter from qp.

It seemed straightforward to setup and I'm having trouble seeing my mistake. I am making sure to have points on both sides of the objective function. The only difference I see from class is that I have y on the diagonal of a matrix, instead of a vector, for the constraint.
Reply With Quote
  #29  
Old 05-21-2012, 04:01 PM
lucag lucag is offline
Member
 
Join Date: Apr 2012
Posts: 44
Default Re: What Quadratic Programming Package?

Quote:
Originally Posted by markweitzman View Post
Well I finally got cvxopt installed and running, and it worked on my first test, but now I keep getting errors about rank(A) < p or Rank([P;A;G])< n. I make sure my y's have different values so I am confused why I am getting these errors. Any help appreciated. Guess I will have to go with my machine learning scientific package,
A is the vector that defines the equality constraint A\cdot x = 0 therefore in our case it's just the vector y. cvxopt notation is somewhat confusing and I myself thought A was a matrix ...
Reply With Quote
  #30  
Old 05-21-2012, 04:28 PM
markweitzman markweitzman is offline
Invited Guest
 
Join Date: Apr 2012
Location: Las Vegas
Posts: 69
Default Re: What Quadratic Programming Package?

I am using A as a 1 by n matrix (or a transpose of vector ) and b is a 1 by 1 matrix scalar. Doesn't seem to work

Mark Weitzman
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 12:54 PM.


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.