参考西瓜书,仅当做自己学习笔记使用。
1. 精度 vs 错误率
- 精度:
a
c
c
=
1
n
∑
i
=
1
n
1
{
f
(
x
i
)
=
y
i
}
=
∫
x
1
f
(
x
)
=
y
p
(
x
)
d
x
acc=\frac{1}{n}\sum\limits_{i=1}^n1_{\{f(x_i)=y_i\}}=\int_{x}1_{f(x)=y}p(x)\mathrm{d}x
acc=n1?i=1∑n?1{f(xi?)=yi?}?=∫x?1f(x)=y?p(x)dx
- 错误率:
e
r
r
o
r
?
r
a
t
e
=
1
n
∑
i
=
1
n
1
{
f
(
x
i
)
≠
y
i
}
=
∫
x
1
{
f
(
x
)
≠
y
}
p
(
x
)
d
x
\mathrm{error\ rate}=\frac{1}{n}\sum\limits_{i=1}^n1_{\{f(x_i)\ne y_i\}}=\int_x1_{\{f(x)\ne y\}}p(x)\mathrm{d}x
error?rate=n1?i=1∑n?1{f(xi?)?=yi?}?=∫x?1{f(x)?=y}?p(x)dx
2. 准确率precision vs. 召回率recall
-
p
r
e
c
i
s
i
o
n
=
T
P
T
P
+
F
P
precision=\frac{TP}{TP+FP}
precision=TP+FPTP?
-
r
e
c
a
l
l
=
T
P
T
P
+
F
N
recall=\frac{TP}{TP+FN}
recall=TP+FNTP?
-
F
1
=
2
?
p
r
e
c
i
s
i
o
n
?
r
e
c
a
l
l
p
r
e
c
i
s
i
o
n
+
r
e
c
a
l
l
F1=\frac{2\cdot precision\cdot recall}{precision+recall}
F1=precision+recall2?precision?recall?
- 如果有多个精确率结果和召回率结果,则有macro结果
-
m
a
c
r
o
?
p
r
e
c
i
s
i
o
n
=
1
n
∑
i
=
1
n
p
r
e
c
i
s
i
o
n
i
\mathrm{macro\ precision}=\frac{1}{n}\sum\limits_{i=1}^nprecision_i
macro?precision=n1?i=1∑n?precisioni?
-
m
a
c
r
o
?
r
e
c
a
l
l
=
1
n
∑
i
=
1
n
r
e
c
a
l
l
i
\mathrm{macro\ recall}=\frac{1}{n}\sum\limits_{i=1}^nrecall_i
macro?recall=n1?i=1∑n?recalli?
|