性能度量
-
- 错误率:分错样本占样本总数的比例
- 精度:分对样本占样本总数的比率

准确率 (Accuracy )= $\frac{T P+T N}{T P+T N+F P+F N}$ 预 测 正 确 的 结 果 占 总 样 本 的 百 分 比
查准率 ( Precision ) = $\frac{T P}{TP+F P}$ 挑出的西瓜中有多少比例是好的?
查全率/召回率/敏感度 ( Recall/Sensitivity ) = $\frac{T P}{T P+F N} $
- 若一个学习算法的PR曲线被另一个学习算法的曲线完全“包住”,则可认为后者的性能优于前者,如A优于C;
- 若两个学习算法的PR曲线发生交叉(如A和B),则难以判断孰优孰劣,只能在具体的查准率和查全率条件下进行比较;
- 可通过比较P-R曲线下的面积(PR-AUC)
- 利用平衡点(即P=R时的取值)
- 利用F1度量

$ \beta=1$: 标准F1
$\beta>1 $: 偏重查全率(逃犯信息检索)
$ \beta<1$ : 偏重查准率(商品推荐系统)
我们希望在 $ \mathrm{n} $ 个二分类混淆矩阵上综合考虑查准率和查全率
先在混淆矩阵上分别计算出查准率和查全率,记为 $\left(P_{1}, R_{1}\right),\left(P_{2}, R_{2}\right), \ldots,\left(P_{n}, R_{n}\right) $, 再计算平均值,这样得到“宏查准率”、“宏查全率”以及“宏 F1 ” :
$\begin{aligned}\text { macro }-\boldsymbol{P} &=\frac{1}{n} \sum \limits _{i=1}^{n} P_{i} \\\text { macro }-\boldsymbol{R} &=\frac{1}{n} \sum \limits _{i=1}^{n} R_{i} \\\text { macro }-\boldsymbol{F} \mathbf{1} &=\frac{2 \times \text { macro }-P \times \text { macro }-R}{\text { macro }-P+\text { macro }-R}\end{aligned}$
- l Macro-averaged gives equal weight to each class
- l Micro-averaged gives equal weight to each per-instance classification decision
- l Macro-averaging is a good choice when you get a sense of effectiveness on small classes
- l Micro-averaging is a good choice on the large classes because large classes dominate small classes in micro-averaging
- l Macro-averaging evaluates the system performance overall across the sets of data, can not get any specific decision with it
- l Micro-average can be a useful measure when the dataset varies in size
真正率 (TPR ) = 灵敏度/召回率 = $\mathrm{TP} /(\mathrm{TP}+\mathrm{FN}) $ 正例中有多少样本被检测出
假正率 (FPR ) = 1- 特异度 = $\mathrm{FP} /(\mathrm{FP}+\mathrm{TN}) $ 负例中有多少样本被错误覆盖


假设ROC曲线由 $\left\{\left(x_{i}, y_{i}\right)\right\}_{i=1}^{m}$ 的点按序连接而 形成 $\left(x_{1}=0, x_{m}=1\right)$ 则 $A \cup C$ 可估算为 :
$\mathrm{AUC}=\frac{1}{2} \sum_{i=1}^{m-1}\left(x_{i+1}-x_{i}\right) \cdot\left(y_{i}+y_{i+1}\right)$
AUC衡量了样本预测的排序质量。

在非均等代价下,不再最小化错误次数,而是最小化“总体代价”,则“代价敏感”错误率相应的为:
$P(+) \operatorname{cost}=\frac{p \times \cos t_{01}}{p \times \operatorname{cost}_{01}+(1-p) \times \operatorname{cost}_{10}}$
纵轴是取值为 $[0,1] $ 的归一化代价
$\operatorname{cost}_{n o r m}=\frac{\text { FNR } \times p \times \operatorname{cost}_{01}+\text { FPR } \times(1-p) \times \operatorname{cost}_{10}}{p \times \operatorname{cost}_{01}+(1-p) \times \operatorname{cost}_{10}}$

