http://scikit-learn.org/stable/modules/model_evaluation.html

3.3.1. The scoring parameter: defining model evaluation rules

Model selection and evaluation using tools, such as model_selection.GridSearchCV and model_selection.cross_val_score, take a scoring parameter that controls what metric they apply to the estimators evaluated.

3.3.1.1. Common cases: predefined values

For the most common use cases, you can designate a scorer object with the scoring parameter; the table below shows all possible values. All scorer objects follow the convention that higher return values are better than lower return values. Thus metrics which measure the distance between the model and the data, like metrics.mean_squared_error, are available as neg_mean_squared_error which return the negated value of the metric.

Scoring Function Comment
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  

Usage examples:

python gridsearchcv 里的评价准则的更多相关文章

  1. Python程序里的注释和#号

    Python程序里的注释是很重要的.它们可以用自然语言告诉你某段代码的功能是什么.在你想要临时移除一段代码时,你还可以用注解的方式将这段代码临时禁用.接下来的练习将让你学会注释 : # A comme ...

  2. Python正则表达式里的单行re.S和多行re.M模式

    Python正则表达式里的单行re.S和多行re.M模式 Python 的re模块内置函数几乎都有一个flags参数,以位运算的方式将多个标志位相加.其中有两个模式:单行(re.DOTALL, 或者r ...

  3. python世界里的局部变量和全局变量: 潜规则太重要了!!!

    python世界里的局部变量和全局变量: 潜规则太重要了!!! 先上代码: def fun(): def test_global(): ''' 内层和外层都需要声明为global, 才能彻底打通变量名 ...

  4. Python 3里,reduce()函数已经被从全局名字空间里移除了,它现在被放置在fucntools模块里

    reduce函数:在Python 3里,reduce()函数已经被从全局名字空间里移除了,它现在被放置在fucntools模块里 用的话要 先引入:>>> from functool ...

  5. ORM基础3 在python脚本里调用Django环境

    1.查询 1.# all获取所有的object,结果QuerySet,列表 print('all'.center(80, '=')) ret = models.Person.objects.all() ...

  6. Python 3. 里filter与generator expression的区别

    # -*- coding: utf-8 -*- """ A test to show the difference between filter and genrator ...

  7. python命令里运行正确但是pycharm里面运行就是报错的问题

    这两天在学习爬虫,第一步就是 import scrapy class StackOverflowSpider(scrapy.Spider): 结果一直报错,说是scrapy没有spider这个方法,各 ...

  8. python+appium里的等待时间

    为什么要用等待时间: 今天在写App的自动化的脚本时发现一个元素,时而能点击,时而又不能点击到,很是心塞,原因是:因为元素还没有被加载出来,查找的代码就已经被执行了,自然就找不到元素了.解决方式:可以 ...

  9. 理解Python语言里的异常(Exception)

    Exception is as a sort of structured "super go to".异常是一种结构化的"超级goto". 作为一个数十年如一日 ...

随机推荐

  1. Jar包进行反编译,修改后重新打包

    在学习和开发JAVA项目中,我们经常会用到第三方提供的一些jar.使用这些第三方工具包,可以提高我们开发的效率,缩短开发的时间.有的第三方工具,提供具体的使用说明和源代码,有时有的却不提供源代码,使用 ...

  2. SqlServer 临时表

    SqlServer中临时表分为两种:一种是局部(本地)临时表,用#TableName表示.一种是全局(服务器)临时表,用##TableName表示. 创建临时表: 1. create table #T ...

  3. GIT多人合作开发

    . 建立代码仓库(专门用于团队开发的代码仓库) ============================================================================ ...

  4. #503. 「LibreOJ β Round」ZQC 的课堂 容斥原理+Treap

    题目: 题解: 比较容易发现 : \(x,y\) 的贡献是独立的. 所以可以分开考虑. 假设我们考虑 \(x\).向量在 \(x\) 方向的投影依次是 : \(\{a_1,a_2, ... ,a_n\ ...

  5. 洛谷 P2920 [USACO08NOV]时间管理Time Management

    传送门 题目大意: 每个工作有截至时间和耗费时间,n个工作求最小开始时间. 题解: 贪心 从n-1安排,让结束时间尽量的晚. 注意:优先级 cout<<st<0?-1:st;  (X ...

  6. 洛谷P3111 [USACO14DEC]牛慢跑Cow Jog_Sliver

    传送门 题目大意:n头牛在单行道n个位置,开始用不同的速度跑步. 当后面的牛追上前面的牛,后面的牛会和前面的牛以一样的速度 跑,称为一个小团体.问:ts后有多少个小团体. 题解:模拟 倒着扫一遍,因为 ...

  7. 为加载......符号 vs2012调试缓慢解决方案

    调试C#网站时vs2012一直 为xxx加载符号 本机上的2010 2017 没有此毛病 没一步都要等待好几秒,百度狗狗(大概花了半天时间)后的方法无果 最后在vs官方论坛 好多老外说删除全部断点就行 ...

  8. Jvm垃圾回收器详细

    1, 串行回收器 1.1, 新生代串行回收器 (1)特点:  –它仅仅使用单线程进行垃圾回收  –它是独占式的垃圾回收  –进行垃圾回收时, Java应用程序中的线程都需要暂停(Stop-The-Wo ...

  9. Voting and Shuffling to Optimize Atomic Operations

    2iSome years ago I started work on my first CUDA implementation of the Multiparticle Collision Dynam ...

  10. linux解压缩基本命令使用

    解压缩命令1.gzip 只能压缩文件,不可压缩目录,压缩后不保留原文件gzip a.txt会删除原文件 生成.gz后缀的文件 a.txt.gz2.gunzip解压.gz的文件gzip -d a.txt ...