主要內容:
- 準確度評判標準的缺陷
- The Confusion Matrix
- 非均衡類別的問題
- Data-Analytic Thinking
- 分析框架:期望值
- 模型評判的基準(Baseline)
———————————————————————————————————————————————
(一)準確度評判標準的缺陷
- 需要肯定的是準確度(plain accuracy)評判標準比較流行且計算方便
- 在一些實際的案例中,準確度評判的效果強差人意(過於簡單)
- 容易受到非均衡類別的影響
- 均衡地對待 false Positives 和 false Negatives 【定義見(二)】 —> 涉及到Cost的問題
(二)The Confusion Matrix
- 定義:Confusion Matrix 是一個NxN的矩陣,矩陣的列標題是實際的類別,矩陣的行標題是預測的類別
|
|
|
|
|
|
|
|
|
在Confusion Matrix 中,對角線爲正確預測的案例,非對角線則爲預測錯誤
其中False positives 爲 將 negative 的案例錯誤地歸結爲positives
其中False negatives 爲 將 positives 的案例錯誤地歸結爲negatives
(三)非均衡類別問題
假設有模型A、B,作用於同一均衡類別的數據後得到如下結果
|
|
||||||||||||||||||
|
|
兩個模型均正確分類了80%的數據,但是他們的表現卻截然不同,A模型偏向於將 False churn 、B模型偏向於False not churn
假如這兩個模型應用於非均衡類別樣本那麼他們的模型之間的準確率變化將非常大,如下圖所示
(四)Data-Analytic Thinking
例如下面的對話:
Analyst : Our model is good based on the mean-squared error
Boss : mean-squared error of what?
Analyst: the value of the target variable, which is the number of stars that a user would give as a rating for the movie
Boss : Why is the mean-squared-error on the predicted number of stars an appropriate metric for our recommendation problem?
Boss : Is it meaningful ?
Boss : Is there a better metric ?
在實際工作中,很多分析人士只會使用那些在學校課堂中學習到的度量方式,而沒有自己的思考,這點相當可悲。
(五)分析框架:期望值
對每個客戶個體而言,他們對於刺激的反饋概率往往很低,一般1%或2%左右,如果我們選取50%爲決策閾值,那麼我們將會得到結論“沒有人會對刺激有反應”
據此我們能做出較好的決策
二維情況下
利用條件概率
得到計算公式
注:
例子:
Confusion Matrix、
|
|
|
|
|
|
|
|
|
Cost-Benefit Matrix
計算過程:
|
|
|
|
|
|
|
|
|
|
、
PS: 其他一些度量標準
- The metrics Precision and Recall are often used, especially in text classification and information retrieval. Recall is the same as true positive rate, while precision is TP/(TP + FP), which is the accuracy over the cases predicted to be positive.
(六)模型評判的基準(Baseline)
- 最大化預測準確率往往不是一個合適的目標
- Classification 的 baseline 可以是 Majority Classifier
- 在較多的機器學習研究中決策樹樁(Decision Stump)往往是較好的基準
- 有的時候我們能利用領域知識在預測作爲基準
注:Decision Stump: a decision tree with only one internal node, the root node(mostinformativefeature)
In real-world domains simplistic measures rarely capture what is actually important for the problem at hand, and often mislead. Instead, the data scientist should give careful thought to how the model will be used in practice and devise an appropriate metric.