Pycharm中如何查看一些报错内容

遇到的问题

在使用learning_curve时,scoring选用’mean_squared_error’报错,错误为ValueError: ‘mean_squared_error’ is not a valid scoring value. Use sorted(sklearn.metrics.SCORERS.keys()) to get valid options.

翻译过来意思就是这玩意儿不存在,你自己去包里查查看哪些是存在的,才能用。

此时可以在pycharm中运行即可:

import sklearn
sorted(sklearn.metrics.SCORERS.keys())

结果如下:

['accuracy',
 'adjusted_mutual_info_score',
 'adjusted_rand_score',
 'average_precision',
 'balanced_accuracy',
 'brier_score_loss',
 'completeness_score',
 'explained_variance',
 'f1',
 'f1_macro',
 'f1_micro',
 'f1_samples',
 'f1_weighted',
 'fowlkes_mallows_score',
 'homogeneity_score',
 'jaccard',
 'jaccard_macro',
 'jaccard_micro',
 'jaccard_samples',
 'jaccard_weighted',
 'max_error',
 'mutual_info_score',
 'neg_log_loss',
 'neg_mean_absolute_error',
 'neg_mean_squared_error',
 'neg_mean_squared_log_error',
 'neg_median_absolute_error',
 'normalized_mutual_info_score',
 'precision',
 'precision_macro',
 'precision_micro',
 'precision_samples',
 'precision_weighted',
 'r2',
 'recall',
 'recall_macro',
 'recall_micro',
 'recall_samples',
 'recall_weighted',
 'roc_auc',
 'v_measure_score']

这里可以用下面这个来表示MSE

'neg_mean_squared_error'

你可能感兴趣的:(Pycharm中如何查看一些报错内容)