Skip to Content
精通機器學習
book

精通機器學習

by Aurélien Géron
April 2020
Intermediate to advanced
816 pages
18h 32m
Chinese
GoTop Information, Inc.
Content preview from 精通機器學習
136
|
第四章:訓練模型
在使用
Lasso
為了避免梯度下降最後在最佳值附近彈跳
你必須在訓
練期間逐漸減少學習速度
它仍然會在最佳值附近彈跳
但幅度會越來越
所以它會收斂
)。
Lasso
代價函式在
θ
i
= 0i = 1, 2, , n
是不可微的
但是當任何一個
θ
i
= 0
如果改
次梯度向量
g
13
梯度下降仍然有不錯的表現
公式
4-11
是你可以在使用梯度下降與
Lasso
代價函數時使用的次梯度向量公式
公式
4-11 Lasso
回歸次梯度向量
這個
Scikit-Learn
範例使用
Lasso
類別
>>> from sklearn.linear_model import
Lasso
>>>
lasso_reg = Lasso(alpha=0.1)
>>>
lasso_reg.fit(X, y)
>>>
lasso_reg.predict([[1.5]])
array([1.53788174])
你也可以改用
SGDRegressor(penalty="l1")
彈性網路
彈性網路
Elastic Net
介於山嶺回歸與
Lasso
回歸之間
它的正則化項單純只是山嶺與
Lasso
的正則化項的混合
你也可以控制混合比率
r
r = 0
彈性網路相當於山嶺回
r = 1
它相當於
Lasso
回歸
見公式
4-12)。
公式
4-12 
彈性網路代價函數
13
在不可微點上面的次梯度向量
可視為圍繞著該點的梯度向量之間的中間向量
含正則化的線性模型
|
137
所以什麼時候該使用一般的線性回歸
也就是沒有任何正則化 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

下一代空间计算:AR与VR创新理论与实践

下一代空间计算:AR与VR创新理论与实践

Erin Pangilinan, Steve Lukas, Vasanth Mohan
C语言核心技术(原书第2版)

C语言核心技术(原书第2版)

Peter Prinz, Tony Crawford

Publisher Resources

ISBN: 9789865024345