機械学習の一般的なパフォーマンス指標

1 はじめに

この記事は、「欠陥予測モデルに対する自動パラメータ最適化の影響」という論文に含まれるパフォーマンス メトリクスをまとめたものです。

初めてこの論文を読んだとき、私は長い間衝撃を受けました。101 のデータセットから、複数の言語と分野を含む 18 のデータセットが選択され、12 のパフォーマンス指標を使用して、既存の一般的な機械学習分類子 (モデル) パラメーター最適化のパフォーマンス向上効果が議論されました。実験プロセス全体は厳密であり、この衝撃的な効果は、2017 年にこの研究室が発表した論文「欠陥予測モデルのモデル検証手法の経験的比較」を読むまで弱まることはありませんでした。使用される手法は同じであり、設定も同じです。比較実験も同様で、まるで組み立てライン製品のようで、羨望の涙を誘います(この種のレビュー論文は、その分野の専門家のみが発表できます)。

2. パフォーマンス指標の概要

これら 2 つのブログを一緒に読むことができます:
sklearn—総合評価指標
機械学習パフォーマンス評価指標

多くの指標は、2 つの分類の混同行列に基づいています。混同行列の例:
ここに画像の説明を挿入

インジケーター名 計算式 意味 参考文献
精度(精度) P = TPTP + FPP=\frac{TP}{TP+FP}P=TP _+F PTP _ [ 3 ] [3][ 3 ]
再現率(再現率 Recall) TPR R = TPTP + FNR=\frac{TP}{TP+FN}R=TP _+FN _TP _ 正しく分類された陽性クラス (欠陥モジュール) の割合 [ 3 ] [3][ 3 ]
F 測定 F_{測定}F確実_ _ _ _ _( F 1 F_{1}F1) F = 2 × P × RP + RF=2 \times \frac{P \times R}{P+R}F=2×P+RP×R 適合率と再現率の調和平均 [ 3 ] [3][ 3 ]
特異性 (指定) TNR S = TNTN + FPS=\frac{TN}{TN+FP}S=TN _+F PTN _ 正しく分類されたネガティブ クラス (欠陥のないモジュール) の割合
誤検知率 FPR FPR = FPTN + FP FPR=\frac{FP}{TN+FP}FPR _ _=TN _+F PFP _ 誤って分類されたネガティブ クラス (欠陥のないブロック) の割合 [ 4 ] [4][ 4 ]
G 平均 G_{平均}G_ _ G − 平均 = R × S G 平均 =\sqrt{R \times S}G_ _=R×S RとSの幾何平均
G メジャー G_{メジャー}G確実_ _ _ _ _ G 測定値 = 2 × pd × ( 1 − pf ) pd + ( 1 − pf ) G_{測定値}=\frac{2 \times pd \times(1-pf)}{pd+(1-pf)}G確実_ _ _ _ _=p d+( 1pf ) _2×p d×( 1pf ) _ TPR と FPR の調和平均、pd=TPR、pf=FPR
バランス バランスバランス_ _ _ _ _ _ 1 − ( 0 − pf ) 2 + ( 1 + pd ) 2 ) 2 1-\sqrt{\frac{\left.(0-pf)^{2}+(1+pd)^{2}\right) {2}}12( 0pf ) _2+( 1+p d )2 ) 誤って分類された負のクラスの割合 (pd=TPR、pf=FPR) [ 5 ] [5][ 5 ][ 6 ] [6][ 6 ]
マシューズ相関係数 (MCC) MCC = TP × TN − FP × FN ( TP + FP ) ( TP + FN ) ( TN + FP ) ( TN + FN ) MCC=\frac{TP \times TN-FP \times FN}{\sqrt{(TP +FP)(TP+FN)(TN+FP)(TN+FN)}}エムシーシー_=( TP _+F P ) ( T P+F N ) ( T N+F P ) ( T N+FN _ TP _×TN _F P×FN _ 実際の分類と予測された分類の間の相関係数 [ 7 ] [7][ 7 ]
AUC ROC 曲線下の面積 [ 8 ] [8][ 8 ][ 9 ] [9][9] [ 10 ] [10] [10] [ 11 ] [11] [11] [ 12 ] [12] [12] [ 13 ] [13] [13]
Brier 1 N ∑ i = 1 N ( p i − y i ) 2 \frac{1}{N} \sum_{i=1}^{N}\left(p_{i}-y_{i}\right)^{2} N1i=1N(piyi)2 预测概率和结果之间的差距 [ 14 ] [14] [14] [ 15 ] [15] [15]
LogLoss l o g l o s s = − 1 N ∑ i = 1 N ( y i log ⁡ ( p i ) + ( 1 − y i ) log ⁡ ( 1 − p i ) ) logloss=-\frac{1}{N} \sum_{i=1}^{N}\left(y_{i} \log \left(p_{i}\right)+\left(1-y_{i}\right) \log \left(1-p_{i}\right)\right) logloss=N1i=1N(yilog(pi)+(1yi)log(1pi)) 分类损失函数

补充:

  • MCC:MCC本质上是一个描述实际分类与预测分类之间的相关系数,它的取值范围为[-1,1],取值为1时表示对受试对象的完美预测,取值为0时表示预测的结果还不如随机预测的结果,-1是指预测分类和实际分类完全不一致;
  • Brier score: p i p_{i} pi是预测概率, y i y_{i} yi是真实的标签(0或者1),取值范围是[0, 1],0代表性能最好,1代表性能最差,0.25表示随机分类;
  • LogLoss: p i p_{i} pi是预测概率, y i y_{i} yi是真实的标签(0或者1),Kaggle比赛的标准性能度量;

3、参考文献

[ 1 ] [1] [1]C. Tantithamthavorn, S. McIntosh, A. E. Hassan, and K. Matsumoto, “The Impact of Automated Parameter Optimization on Defect Prediction Models,” IEEE Trans. Softw. Eng., vol. 45, no. 7, pp. 683–711, Jul. 2019, doi: 10.1109/TSE.2018.2794977
[ 2 ] [2] [2]C. Tantithamthavorn, S. McIntosh, A. E. Hassan, and K. Matsumoto, “An Empirical Comparison of Model Validation Techniques for Defect Prediction Models,” IEEE Trans. Softw. Eng., vol. 43, no. 1, pp. 1–18, Jan. 2017, doi: 10.1109/TSE.2016.2584050.
[ 3 ] [3] [3]W. Fu, T. Menzies, and X. Shen, “Tuning for software analytics: is it really necessary?” Information and Software Technology, vol. 76, pp. 135–146.
[ 4 ] [4] [4]T. Menzies, J. Greenwald, and A. Frank, “Data Mining Static Code Attributes to Learn Defect Predictors,” IEEE Transactions on Software Engineering (TSE), vol. 33, no. 1, pp. 2–13, 2007.
[ 5 ] [5] [5]H. Zhang and X. Zhang, “Comments on “Data Min- ing Static Code Attributes to Learn Defect Predic- tors”,” IEEE Transactions on Software Engineering (TSE), vol. 33, no. 9, pp. 635–636, 2007.
[ 6 ] [6] [6]A. Tosun, “Ensemble of Software Defect Predictors: A Case Study,” in Proceedings of the International Sympo- sium on Empirical Software Engineering and Measurement (ESEM), 2008, pp. 318–320.
[ 7 ] [7] [7]M. Shepperd, D. Bowes, and T. Hall, “Researcher Bias: The Use of Machine Learning in Software Defect Prediction,” IEEE Transactions on Software Engineering (TSE), vol. 40, no. 6, pp. 603–616, 2014.
[ 8 ] [8] [8]S. den Boer, N. F. de Keizer, and E. de Jonge, “Performance of prognostic models in critically ill cancer patients - a review.” Critical care, vol. 9, no. 4, pp. R458–R463, 2005.
[ 9 ] [9] [9]F. E. Harrell Jr., Regression Modeling Strategies, 1st ed. Springer, 2002.
[ 10 ] [10] [10]J. Huang and C. X. Ling, “Using AUC and accuracy
in evaluating learning algorithms,” Transactions on Knowledge and Data Engineering, vol. 17, no. 3, pp. 299– 310, 2005.
[ 11 ] [11] [11]S. Lessmann, S. Member, B. Baesens, C. Mues, and S. Pietsch, “Benchmarking Classification Models for Software Defect Prediction: A Proposed Framework and Novel Findings,” IEEE Transactions on Software Engineering (TSE), vol. 34, no. 4, pp. 485–496, 2008.
[ 12 ] [12] [12]E. W. Steyerberg, Clinical prediction models: a practi- cal approach to development, validation, and updating. Springer Science & Business Media, 2008.
[ 13 ] [13] [ 1 3 ] EW Steyerberg、AJ Vickers、NR Cook、T. Gerds、N. Obuchowski、MJ Pencina、および MW Kattan、「予測モデルのパフォーマンスの評価: いくつかの伝統的および新規の測定のフレームワーク」、Epidemiology、vol. 21、いいえ。1、128–138ページ、2010年。
[14] [14][ 1 4 ] GW Brier、「確率の観点から表現された予報の検証」、月刊ウェザーレビュー、vol. 78、いいえ。1、25-27ページ、1950年。
[15] [15][ 1 5 ] K. Rufibach、「バイナリ予測を評価するための Brier スコアの使用」、Journal of Clinical Epidemiology、vol. 63、いいえ。8、938–939ページ、2010年。

おすすめ

転載: blog.csdn.net/u012949658/article/details/110895485