1# sklearn cross_val_score scoring options
2
3# For Regression
4'explained_variance'
5'max_error'
6'neg_mean_absolute_error'
7'neg_mean_squared_error'
8'neg_root_mean_squared_error'
9'neg_mean_squared_log_error'
10'neg_median_absolute_error'
11'r2'
12'neg_mean_poisson_deviance'
13'neg_mean_gamma_deviance'
14'neg_mean_absolute_percentage_error'
15
16# For Classification
17'accuracy'
18'balanced_accuracy'
19'top_k_accuracy'
20'average_precision'
21'neg_brier_score'
22'f1'
23'f1_micro'
24'f1_macro'
25'f1_weighted'
26'f1_samples'
27'neg_log_loss'
28'precision'
29'recall'
30'jaccard'
31'roc_auc'
32'roc_auc_ovr'
33'roc_auc_ovo'
34'roc_auc_ovr_weighted'
35'roc_auc_ovo_weighted'
36
37# For Clustering
38'adjusted_mutual info score'
39'adjusted_rand_score'
40'completeness_score'
41'fowlkes_mallows_score'
42'homogeneity_score'
43'mutual_info_score'
44'normalized_mutual_info_score'
45'rand_score'
46'v_measure_score'
1>>> from sklearn import svm, cross_validation, datasets
2>>> iris = datasets.load_iris()
3>>> X, y = iris.data, iris.target
4>>> model = svm.SVC()
5>>> cross_validation.cross_val_score(model, X, y, scoring='wrong_choice')
6Traceback (most recent call last):
7ValueError: 'wrong_choice' is not a valid scoring value. Valid options are ['accuracy', 'adjusted_rand_score', 'average_precision', 'f1', 'log_loss', 'mean_absolute_error', 'mean_squared_error', 'precision', 'r2', 'recall', 'roc_auc']
8