本文整理汇总了Python中sklearn.metrics.SCORERS.update方法的典型用法代码示例。如果您正苦于以下问题:Python SCORERS.update方法的具体用法?Python SCORERS.update怎么用?Python SCORERS.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sklearn.metrics.SCORERS
的用法示例。
在下文中一共展示了SCORERS.update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_scorer
# 需要导入模块: from sklearn.metrics import SCORERS [as 别名]
# 或者: from sklearn.metrics.SCORERS import update [as 别名]
from .version import __version__, VERSION
__all__ = ['Learner', 'load_examples', 'kappa', 'kendall_tau', 'spearman',
'pearson', 'f1_score_least_frequent', 'run_configuration',
'run_ablation', 'write_feature_file', 'convert_examples']
# Add our scorers to the sklearn dictionary here so that they will always be
# available if you import anything from skll
_scorers = {'f1_score_micro': make_scorer(f1_score, average='micro',
pos_label=None),
'f1_score_macro': make_scorer(f1_score, average='macro',
pos_label=None),
'f1_score_weighted': make_scorer(f1_score, average='weighted',
pos_label=None),
'f1_score_least_frequent': make_scorer(f1_score_least_frequent),
'pearson': make_scorer(pearson),
'spearman': make_scorer(spearman),
'kendall_tau': make_scorer(kendall_tau),
'unweighted_kappa': make_scorer(kappa),
'quadratic_weighted_kappa': make_scorer(kappa,
weights='quadratic'),
'linear_weighted_kappa': make_scorer(kappa, weights='linear'),
'qwk_off_by_one': make_scorer(kappa, weights='quadratic',
allow_off_by_one=True),
'lwk_off_by_one': make_scorer(kappa, weights='linear',
allow_off_by_one=True),
'uwk_off_by_one': make_scorer(kappa, allow_off_by_one=True)}
SCORERS.update(_scorers)