Skip to Main Content
Python Machine Learning By Example
book

Python Machine Learning By Example

by Yuxi (Hayden) Liu, Ivan Idris
May 2017
Beginner to intermediate content levelBeginner to intermediate
254 pages
6h 24m
English
Packt Publishing
Content preview from Python Machine Learning By Example

Training a logistic regression model with regularization

As we briefly mentioned in the last section, the penalty parameter in the logistic regression SGDClassifier is related to model regularization. There are two basic forms of regularization, L1 and L2. In either way, the regularization is an additional term on top of the original cost function:

Where is the constant that multiplies the regularization term, and q is either 1 or 2 representing L1 or L2 regularization where:

Training a logistic regression model is a process of reducing the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Machine Learning by Example - Third Edition

Python Machine Learning by Example - Third Edition

Yuxi (Hayden) Liu
Python: Deeper Insights into Machine Learning

Python: Deeper Insights into Machine Learning

Sebastian Raschka, David Julian, John Hearty
Python: Real World Machine Learning

Python: Real World Machine Learning

Prateek Joshi, John Hearty, Bastiaan Sjardin, Luca Massaron, Alberto Boschetti

Publisher Resources

ISBN: 9781783553112Supplemental Content