Hands-On Machine Learning with Scikit-Learn and TensorFlow


Gini Impurity or Entropy?



Download 26,57 Mb.
Pdf ko'rish
bet151/225
Sana16.03.2022
Hajmi26,57 Mb.
#497859
1   ...   147   148   149   150   151   152   153   154   ...   225
Bog'liq
Hands on Machine Learning with Scikit Learn Keras and TensorFlow

Gini Impurity or Entropy?
By default, the Gini impurity measure is used, but you can select the 
entropy
impurity
measure instead by setting the 
criterion
hyperparameter to 
"entropy"
. The concept
of entropy originated in thermodynamics as a measure of molecular disorder:
entropy approaches zero when molecules are still and well ordered. It later spread to a
wide variety of domains, including Shannon’s 
information theory
, where it measures
184 | Chapter 6: Decision Trees


4
A reduction of entropy is often called an 
information gain
.
5
See Sebastian Raschka’s 
interesting analysis for more details
.
the average information content of a message:
4
 entropy is zero when all messages are
identical. In Machine Learning, it is frequently used as an impurity measure: a set’s
entropy is zero when it contains instances of only one class. 
Equation 6-3
shows the
definition of the entropy of the i
th
node. For example, the depth-2 left node in
Figure 6-1
has an entropy equal to −
49
54
log
2
49
54

5
54
log
2
5
54
≈ 0.445.
Equation 6-3. Entropy
H
i
= −

k
= 1
pi
,
k
≠ 0
n
p
i
,
k
log
2
p
i
,
k
So should you use Gini impurity or entropy? The truth is, most of the time it does not
make a big difference: they lead to similar trees. Gini impurity is slightly faster to
compute, so it is a good default. However, when they differ, Gini impurity tends to
isolate the most frequent class in its own branch of the tree, while entropy tends to
produce slightly more balanced trees.
5

Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   147   148   149   150   151   152   153   154   ...   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