28
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

交差検定の評価指標の設定(メモ、scikit-learn, cross_validation.cross_val_score)

Last updated at Posted at 2016-10-08

##cross_validation.cross_val_scoreのケース

このscoringの値の指定!!

scores = cross_validation.cross_val_score(clf, X_digits, y_digits, cv=k_fold, ... scoring='precision_macro')

学会発表聞いてても交差検定の評価指標が謎なことが多かった。
対象によっては一意に決まるのかと思ったりもしていた(昔)。
目的次第でちゃんと選択するんだよね^^;

一覧リスト、詳細はリンク先からさらに飛べる
http://scikit-learn.org/stable/modules/model_evaluation.html#scoring-parameter

['accuracy', 'adjusted_rand_score', 'average_precision', 'f1', 'f1_macro', 
'f1_micro', 'f1_samples', 'f1_weighted', 'log_loss', 'mean_absolute_error', 
'mean_squared_error', 'median_absolute_error', 'precision',
'precision_macro', 'precision_micro', 'precision_samples', 
'precision_weighted', 'r2', 'recall', 'recall_macro', 'recall_micro', 
'recall_samples', 'recall_weighted', 'roc_auc']

 
'accuracy' accuracy_score 
二値分類では多くのサンプルがそうなってるが、これがデフォルト?かな上位だし。
式的にはこうなんだ。
alt

回帰の時は、大仏さんが書いてた。
表にはneg_が付いているが、リストでは"mean_squared_error"の表記だな。
負の値が帰ってくるとかあるからその絡みか...
http://d.hatena.ne.jp/teramonagi/20130825/1377434479#20130825f2

説明を抜粋(クオーテーションがパラメータの値)
表記がリストと完全に一致... していないのは謎w

Classification
‘accuracy’ metrics.accuracy_score
‘average_precision’ metrics.average_precision_score
‘f1’ metrics.f1_score for binary targets
‘f1_micro’ metrics.f1_score micro-averaged
‘f1_macro’ metrics.f1_score macro-averaged
‘f1_weighted’ metrics.f1_score weighted average
‘f1_samples’ metrics.f1_score by multilabel sample
‘neg_log_loss’ metrics.log_loss requires predict_proba support
‘precision’ etc. metrics.precision_score suffixes apply as with ‘f1’
‘recall’ etc. metrics.recall_score suffixes apply as with ‘f1’
‘roc_auc’ metrics.roc_auc_score
Clustering
‘adjusted_rand_score’ metrics.adjusted_rand_score
Regression
‘neg_mean_absolute_error’ metrics.mean_absolute_error
‘neg_mean_squared_error’ metrics.mean_squared_error
‘neg_median_absolute_error’ metrics.median_absolute_error
‘r2’ metrics.r2_score

28
24
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?