Hands-On Machine Learning with Scikit-Learn and TensorFlow


Performance Measures | 95



Download 26,57 Mb.
Pdf ko'rish
bet80/225
Sana16.03.2022
Hajmi26,57 Mb.
#497859
1   ...   76   77   78   79   80   81   82   83   ...   225
Bog'liq
Hands on Machine Learning with Scikit Learn Keras and TensorFlow

Performance Measures | 95


FN is of course the number of false negatives.
If you are confused about the confusion matrix, 
Figure 3-2
may help.
Figure 3-2. An illustrated confusion matrix
Precision and Recall
Scikit-Learn provides several functions to compute classifier metrics, including preci‐
sion and recall:
>>> 
from
sklearn.metrics
import
precision_score

recall_score
>>> 
precision_score
(
y_train_5

y_train_pred

# == 4096 / (4096 + 1522)
0.7290850836596654
>>> 
recall_score
(
y_train_5

y_train_pred

# == 4096 / (4096 + 1325)
0.7555801512636044
Now your 5-detector does not look as shiny as it did when you looked at its accuracy.
When it claims an image represents a 5, it is correct only 72.9% of the time. More‐
over, it only detects 75.6% of the 5s.
It is often convenient to combine precision and recall into a single metric called the 
F
1
score
, in particular if you need a simple way to compare two classifiers. The F
1
score is 
the 
harmonic mean
of precision and recall (
Equation 3-3
). Whereas the regular mean
treats all values equally, the harmonic mean gives much more weight to low values.
As a result, the classifier will only get a high F
1
score if both recall and precision are
high.
Equation 3-3. F
1
F
1
=
2
1
precision
+
1
recall
= 2 × precision × recall
precision + recall =
TP
TP
+
FN
+
FP
2

Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   76   77   78   79   80   81   82   83   ...   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