Numerical Evaluation
用数值评价指标来估计算法的执行结果 可以看出学习算法的效果。
在自然语言处理中,可用stemming software(词干提取软件)实现;在搜索引擎中搜Porter Stemmer这种软件进行词干提取。但它们都只处理单词的前几个字母。可以使用交叉验证(not error analysis)在使用词干提取和不使用词干提取条件下分别看看其结果。
Need numerical evaluation(e.g.,cross validation error) of algorithm’s performance with and without stemming.
Without stemming:5% error
With stemming:3% error
⟹ \implies ⟹ using stemming
对于特定的问题,采用单一规则的数值评价指标——the cross validation error.
注:要在交叉验证集上做。
other examples:
是否区分大小写1,e.g.
Distinguish upper vs. lower case (Mom/mom):3.2%
⟹ \implies ⟹ 不区分
1.形成一个简单算法
2.查看错误,通过误差分析看它出现了什么失误,以此决定之后的优化方法
3.有了算法和数值评价指标后,有助于实验新的想法并验证该想法,决定自己该放弃些什么
the reversed example
For skewed class,需采用其它 Evaluation metric。
Case:Cancer classification
Model: h θ ( x ) { y = 1 if c a n c e r y = 0 otherwise h_\theta(x)\begin{dcases} y = 1 &\text{if } cancer \\ y = 0 &\text{otherwise} \end{dcases} hθ(x){
y=1y=0if cancerotherwise
Evaluation metric:分类误差/分类精确度
测试集只有1%的误差,而0.50%的病人have cancer。
function y = predictCancer(x)
y = 0; %ignore x!
return
利用上面非机器学习的算法,误差只有0.50%
⟹ \Longrightarrow ⟹显然误差降低了,but 并未真正提升分类模型的质量
Precision/Recall
在上述例子中, y = 1 y = 1 y=1 in presence of rare class that we want to detect.
Predicted class |
Actual class | |
---|---|---|
1 | 0 | |
1 | True Positive(真阳性) | False Negative(假阴性) |
0 | False Positive(假阳性) | True Negative(真阴性) |
Precision
(Of all patients where we predicted y = 1 y = 1 y