iT邦幫忙

第 11 屆 iThome 鐵人賽

DAY 15
0
AI & Data

跟top kaggler學習如何贏得資料分析競賽 系列 第 15

[Day 15] Metrics / 評估指標 - Regression metrics

其實應該先解釋 confusion matrix, 但是這是速成班, 下週再找日期來補.

從線性迴歸跟類別型兩大類來看Metrics / 評估指標.

Regression metrics

MSE, RMSE, R-squared
MAE
(R)MSPE, MAPE
(R)MSLE

Calssification

Accuracy, LogLoss, AUC
Cohen's (Quadratic weighted) Kappa


MSE : Mean Square Error / 均方誤差

optimal constant : target mean
均方誤差 (MSE) 是最常用的回歸損失函數,計算方法是求預測值與真實值之間距離的平方和. 由於有平方, 懲罰偏離真實比較重, 因此適合梯度計算. 在數學又稱 L2 損失, MSE 可以評價資料的變化程度,MSE 的值越小,說明預測模型描述實驗資料具有更好的精確度。

https://ithelp.ithome.com.tw/upload/images/20190916/201087199U6TVqqIkm.png

RMSE : Root Mean Square Error / 均方根誤差

因為 MSE 跟 RMSE 方向一致, MSE(A) > MSE (B)則 RMSE(A) > RMSE (B), 因此若比賽是要用 RMSE 做評估指標, 那 model 就可用比較容易的 MSE, 效果一樣

https://ithelp.ithome.com.tw/upload/images/20190916/20108719m8H9yd7awi.png

R-squared :

就是我們統計上在用的 R-squared
https://ithelp.ithome.com.tw/upload/images/20190916/20108719q9YS9eiXnq.png

MAE : Mean Absolute Error / 平均絕對誤差

常用在財務方面, 在數學又稱 L1 損失, MAE 就是將每次測量的絕對誤差取絕對值後求的平均值, 用來觀察預測值誤差的測量是否要調整。
optimal constant : target median
https://ithelp.ithome.com.tw/upload/images/20190916/20108719uS4PcXZZL7.png

MSE -> MSPE, MAE -> MAPE

MSPE best constant : weighted target mean
MAPE best constant : weighted target median

https://ithelp.ithome.com.tw/upload/images/20190916/20108719GwjF7DDxzq.png

RMSLE : Root Mean Square Logarithmic Error

Best constant : mean target value
https://ithelp.ithome.com.tw/upload/images/20190916/20108719FdTlsref9X.png


tips

  1. 若想要知道資料中有沒有 outliers --> MAE
  2. 想要確定某些是否 outliers --> MAE
  3. 若只是沒想到的數值但其實我們要留意時 --> MSE

上一篇
[Day 14] 以 Springleaf competition 實作 EDA
下一篇
[Day 16] Metrics / 評估指標 - Calssification
系列文
跟top kaggler學習如何贏得資料分析競賽 30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言