Hands-On Machine Learning with Scikit-Learn and TensorFlow


Polynomial Regression | 133



Download 26,57 Mb.
Pdf ko'rish
bet111/225
Sana16.03.2022
Hajmi26,57 Mb.
#497859
1   ...   107   108   109   110   111   112   113   114   ...   225
Bog'liq
Hands on Machine Learning with Scikit Learn Keras and TensorFlow

Polynomial Regression | 133


two features 
a
and 
b

PolynomialFeatures
with 
degree=3
would not only add the
features 
a
2

a
3

b
2
, and 
b
3
, but also the combinations 
ab

a
2
b
, and 
ab
2
.
PolynomialFeatures(degree=d)
transforms an array containing 
n
features into an array containing 
n
+
d
!
d
!
n
! features, where 
n
! is the
factorial
of 
n
, equal to 1 × 2 × 3 × 

× 
n
. Beware of the combinato‐
rial explosion of the number of features!
Learning Curves
If you perform high-degree Polynomial Regression, you will likely fit the training
data much better than with plain Linear Regression. For example, 
Figure 4-14
applies
a 300-degree polynomial model to the preceding training data, and compares the
result with a pure linear model and a quadratic model (2
nd
-degree polynomial).
Notice how the 300-degree polynomial model wiggles around to get as close as possi‐
ble to the training instances.
Figure 4-14. High-degree Polynomial Regression
Of course, this high-degree Polynomial Regression model is severely overfitting the
training data, while the linear model is underfitting it. The model that will generalize
best in this case is the quadratic model. It makes sense since the data was generated
using a quadratic model, but in general you won’t know what function generated the
data, so how can you decide how complex your model should be? How can you tell
that your model is overfitting or underfitting the data?

Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   107   108   109   110   111   112   113   114   ...   225




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish