LFD Book Forum  

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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-23-2012, 06:28 AM
invis invis is offline
Senior Member
 
Join Date: Jul 2012
Posts: 50
Question Quadratic programming

I never used QP in my practice. And I using Octave for solve HWs.
So there is built-in function for quadratic programming in Octave - qp. (example)

But I still dont know what parameters I should use to solve:

\min_{w,b} 0.5w^Tw
s.t.
y_n(w^Tx_n+b)=>1

Looks like H is Y*Y^T .* X*X^T (.* is element by element product)
But what is the other parameters
Reply With Quote
  #2  
Old 08-23-2012, 10:09 AM
invis invis is offline
Senior Member
 
Join Date: Jul 2012
Posts: 50
Default Re: Quadratic programming

And where is ?
Reply With Quote
  #3  
Old 08-23-2012, 11:23 AM
invis invis is offline
Senior Member
 
Join Date: Jul 2012
Posts: 50
Default Re: Quadratic programming

I am absolutly confused

Should I use QP to solve this inequality:

\min_{w,b} 0.5w^Tw
s.t.
y_n(w^Tx_n+b)=>1

OR to solve inequality in picture in previous message ?
Reply With Quote
  #4  
Old 08-23-2012, 05:22 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Quadratic programming

Quote:
Originally Posted by invis View Post
I am absolutly confused

Should I use QP to solve this inequality:

\min_{w,b} 0.5w^Tw
s.t.
y_n(w^Tx_n+b)=>1

OR to solve inequality in picture in previous message ?
The version in the picture. It's the dual problem (equivalent) to the version that is in the quote.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #5  
Old 08-24-2012, 04:40 AM
invis invis is offline
Senior Member
 
Join Date: Jul 2012
Posts: 50
Default Re: Quadratic programming

Why sometimes it is impossible to find the solution and what to do with that ?
On 200 iterations with random line and random dots (#10) 81 times QP didnt find the solution (I plot the line and dots for this situations and all looks pretty clear).
This is the parameters for QP I use:

H = (Y*Y') .* (X*X');
A = Y';
q=-1*ones(n,1);
b=0;
lb=zeros(n,1); (lower bound)
ub=[]; (upper bound)

min 0.5 x'*H*x + x'*q
subject to

A*x = b
lb <= x <= ub


where x is our \alpha
Reply With Quote
  #6  
Old 08-24-2012, 05:30 AM
htlin's Avatar
htlin htlin is offline
NTU
 
Join Date: Aug 2009
Location: Taipei, Taiwan
Posts: 601
Default Re: Quadratic programming

Quote:
Originally Posted by invis View Post
Why sometimes it is impossible to find the solution and what to do with that ?
On 200 iterations with random line and random dots (#10) 81 times QP didnt find the solution (I plot the line and dots for this situations and all looks pretty clear).
This is the parameters for QP I use:

H = (Y*Y') .* (X*X');
A = Y';
q=-1*ones(n,1);
b=0;
lb=zeros(n,1); (lower bound)
ub=[]; (upper bound)

min 0.5 x'*H*x + x'*q
subject to

A*x = b
lb <= x <= ub


where x is our \alpha
Sometimes the numerical condition of the optimization problem makes it hard for the solver to locate a good solution. One possibility is to set ub (upper bound) to a really large value. Hope this helps.
__________________
When one teaches, two learn.
Reply With Quote
  #7  
Old 08-24-2012, 07:08 AM
apinde apinde is offline
Member
 
Join Date: Jul 2012
Posts: 12
Default Re: Quadratic programming

Can one use Solver in Excel for this problem? I've not used the other languages and platforms for quadratic programming packages and am desperately searching for a package that can be learned and used in a few days.
Reply With Quote
Reply

Tags
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 02:08 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.