如运行以下代码:

from sklearn.linear_model import LinearRegression
from skelarn.preprocessing import StandardScaler
from sklearn.pipeline import Pipelineimport pandas as pddf = pd.read_csv("dataset.csv")num_pipe = Pipeline([("scaler", StandardScaler()),("lin_reg", LinearRegression())
])df_model = num_pipe.fit(df)df_model.coef_
AttributeError: 'Pipeline' object has no attribute 'coef_'

解决方法:

df_model.name_steps['lin_reg'].coef_

named_steps : dict

Read-only attribute to access any step parameter by user given name. Keys are step names and values are steps parameters.

具体参考:
sklearn.pipeline.Pipeline 官方文档

解决方式 | AttributeError: ‘Pipeline‘ object has no attribute ‘coef_‘相关推荐

  1. 报错解决:AttributeError: ‘Word2VecKeyedVectors‘ object has no attribute ‘save_Word2Vec_format‘

    报错解决:AttributeError: 'Word2VecKeyedVectors' object has no attribute 'save_Word2Vec_format' 不知道按网上自己学 ...

  2. 解决:AttributeError: ‘Graph‘ object has no attribute ‘number_of_selfloops‘

    解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops' 目录 解决:AttributeError: 'Grap ...

  3. 成功解决 class 'AttributeError' : 'Editor' object has no attribute '_Editor__markerMap'

    成功解决 class 'AttributeError' : 'Editor' object has no attribute '_Editor__markerMap' 解决问题 An error lo ...

  4. Python 报错解决:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

    早上升级完pip,后报错如下: -> # pip install --upgrade pwntools /usr/local/lib/python2.7/dist-packages/pip/_v ...

  5. python编程 报错解决:“AttributeError: ‘str‘ object has no attribute ‘decode‘”

    简介 在做django项目遇到了如题的报错,通过搜索分析是encode/decode的问题,我的decode/encode并没有出现在我编写的代码中,而是在D:\python\Lib\site-pac ...

  6. ckpt转bin模型报错解决:AttributeError: ‘BertForPreTraining‘ object has no attribute ‘shape‘ #393

    首先修改modeling_bert.by中的load_tf_weights_in_bert为: def load_tf_weights_in_bert(model, config, tf_checkp ...

  7. AttributeError: ‘HTMLParser‘ object has no attribute ‘unescape‘解决方案

      大家好,我是爱编程的喵喵.双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中.从事机器学习以及相关的前后端开发工作.曾在阿里云.科大讯飞.CCF等比赛获得多次Top名次.喜 ...

  8. 报错与解决 | AttributeError: ‘Series‘ object has no attribute ‘set_value‘

    文章目录 代码简要介绍 报错 修改方法 太不容易了!不断debug,终于调通了!分享一下解决这个问题的办法. 代码简要介绍 # 创建Series() songname_vector = pd.Seri ...

  9. Keras问题“AttributeError: 'NoneType' object has no attribute 'update”解决

    BUG 在使用Keras训练模型时,在每个epoch完成后save_model时会报错 "AttributeError: 'NoneType' object has no attribute ...

最新文章

  1. php-fpm开启报错-ERROR: An another FPM instance seems to already listen on /tmp/php-cgi.sock
  2. html css鼠标手型效果
  3. python day-15 匿名函数 sorted ()函数 filter()函数 map()函数 递归 二分法...
  4. 江湖救急,换对姿势比《颈椎病康复指南》更有效丨极客官舍
  5. Windows下MySql安装【图文】
  6. shiro缓存管理时报错java.lang.ClassCastException: com.xxx.User cannot be cast to com.xxx.User
  7. linux运行python乱码_linux下python中文乱码解决方案详解
  8. 计算机基本运行方式,我今天才知道的电脑运行方式,你知道吗?
  9. 如何将html转为report,如何使用XtraReport将报表导出为HTML
  10. 飞凌单片机解密_[资料] 常见的IC芯片解密方法与原理解析!
  11. 卸载北信源内网桌面监控的完全攻略
  12. 国考计算机怎么评分标准,国考行测的评分标准
  13. 计算机cpu结构实物图片,cpu内部结构显微图/cpu内部结构放大图
  14. VS2019 +easyx 实现闪烁的星空(夜景)
  15. 微信的自动回复接入聊天机器人
  16. 在我附近的网吧的代理服务器iptables脚本
  17. 百词斩英语单词小助手(主要实现英语单词学习的功能。用户可对词典文件中的单词进行预览,增删改查。同时还可进行中英、英中测试。本系统还提供了测试成绩的显示功能。)
  18. 信道编解码(2)LDPC编码_译码
  19. 韩剧TV APP案例分析
  20. 测试中文编码_如何通过带回家的编码测试

热门文章

  1. win10录制视频+音频
  2. PHP生肖查询顺序错了怎么改,十二生肖的顺序是怎样的?
  3. 初学者之路—————水下目标检测问题
  4. 微信小程序真的来临了?Yes Or NO?
  5. 高德/百度经纬度转换
  6. g_signal_connect 与 g_signal_connect_swapped
  7. 软件工程(SE)相关问题
  8. 这一届程序媛的薪资比男生还高!程序媛时代已来?
  9. 端游、手游服务端常用的架构
  10. JQUERY阻止点击事件冒泡