Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于第二章中的宏平均F1和微平均F1计算 #490

Open
luwanglin opened this issue Oct 11, 2020 · 0 comments
Open

关于第二章中的宏平均F1和微平均F1计算 #490

luwanglin opened this issue Oct 11, 2020 · 0 comments

Comments

@luwanglin
Copy link

关于第二章中的宏平均F1和微平均F1,我在周志华的机器学习一书中看到的计算是这样的,跟仓库中的介绍的有所区别。
image-20201011182835191
Markdown格式的文本如下:

一种直接的做法是先在各混淆矩阵上分别计算出查准率和查全率,
记为 $\left(P_{1}, R_{1}\right),\left(P_{2}, R_{2}\right), \ldots,\left(P_{n}, R_{n}\right),$ 再计算平均值, 这样就得到“宏查准
率” $(\operatorname{macro}-P) 、 “{\text { 宏查全率” }(\operatorname{macro}-R), \text { 以及相应的“宏 } F 1 "(\operatorname{macro}-F 1):}$
$$
\begin{array}{c}
\operatorname{macro}-P=\frac{1}{n} \sum_{i=1}^{n} P_{i} \
\operatorname{macro}-R=\frac{1}{n} \sum_{i=1}^{n} R_{i} \
\operatorname{macro}-F 1=\frac{2 \times \operatorname{macro}-P \times \operatorname{macro}-R}{\operatorname{macro}-P+\operatorname{macro}-R}
\end{array}
$$
还可先将各混淆矩阵的对应元素进行平均, 得到 $T P 、 F P 、 T N 、 F N$ 的 平均值, 分别记为 $\overline{T P} 、 \overline{F P} 、 \overline{T N} 、 \overline{F N},$ 再基于这些平均值计算出“微查准
$$
\begin{array}{c}
\operatorname{micro}-P=\frac{\overline{T P}}{\overline{T P}+\overline{F P}} \
\operatorname{micro}-R=\frac{\overline{T P}}{\overline{T P}+\overline{F N}} \
\operatorname{micro-} F 1=\frac{2 \times \operatorname{micro}-P \times \operatorname{micro}-R}{\operatorname{micro}-P+\operatorname{micro}-R}
\end{array}
$$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant