LFD Book Forum Question on regularization for logistic regression
 Register FAQ Calendar Mark Forums Read

#1
02-15-2013, 08:59 AM
 melipone Senior Member Join Date: Jan 2013 Posts: 72
Question on regularization for logistic regression

We have done regularization for linear regression. How do we get the gradients with regularization for logistic regression?
#2
02-15-2013, 09:43 AM
 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478
Re: Question on regularization for logistic regression

Quote:
 Originally Posted by melipone We have done regularization for linear regression. How do we get the gradients with regularization for logistic regression?
For linear regression, both the unregularized and the (weight decay) regularized cases had closed-form solutions. For logistic regression, both are handled using an iterative method like gradient descent. You write down the error measure and add the regularization term, then carry out gradient descent (with respect to ) on this augmented error. The gradient will be the sum of the gradients of the original error term given in the lecture and the weight-decay term which is quadratic in (hence its gradient will be linear in ).
__________________
Where everyone thinks alike, no one thinks very much
#3
02-16-2013, 12:00 PM
 melipone Senior Member Join Date: Jan 2013 Posts: 72
Re: Question on regularization for logistic regression

Thanks. Okay, so if I take the derivative of for the regularization, I just add to the gradient in the update of each weight in stochastic gradient descent. Is that correct?

I was also looking into L1 and L2 regularization. That would be L2 regularization above. My understanding is that L1 regulation would just add a penalty term to the gradient regardless of the weight itself. Is my understanding correct?

TIA
#4
02-16-2013, 09:49 PM
 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478
Re: Question on regularization for logistic regression

Quote:
 Originally Posted by melipone Thanks. Okay, so if I take the derivative of for the regularization, I just add to the gradient in the update of each weight in stochastic gradient descent. Is that correct? I was also looking into L1 and L2 regularization. That would be L2 regularization above. My understanding is that L1 regulation would just add a penalty term to the gradient regardless of the weight itself. Is my understanding correct? TIA
Indeed, you add the linear term to get the new gradient. L2 and L1 define the regularization term based on squared value and absolute value, respectively. What is added to the gradient is the derivative of that.
__________________
Where everyone thinks alike, no one thinks very much

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General     General Discussion of Machine Learning     Free Additional Material         Dynamic e-Chapters         Dynamic e-Appendices Course Discussions     Online LFD course         General comments on the course         Homework 1         Homework 2         Homework 3         Homework 4         Homework 5         Homework 6         Homework 7         Homework 8         The Final         Create New Homework Problems Book Feedback - Learning From Data     General comments on the book     Chapter 1 - The Learning Problem     Chapter 2 - Training versus Testing     Chapter 3 - The Linear Model     Chapter 4 - Overfitting     Chapter 5 - Three Learning Principles     e-Chapter 6 - Similarity Based Methods     e-Chapter 7 - Neural Networks     e-Chapter 8 - Support Vector Machines     e-Chapter 9 - Learning Aides     Appendix and Notation     e-Appendices

All times are GMT -7. The time now is 04:07 PM.