scikit-learn 0.18中的cross_validation模块被移除
环境:scikit-learn 0.18 , python3
from sklearn.cross_validation import train_test_split
from sklearn.grid_search import GridSearchCV
报出如下警告:
from sklearn.grid_search import GridSearchCV
/usr/lib/python3.4/site-packages/sklearn/cross_validation.py:44:
DeprecationWarning: This module was deprecated in version 0.18 in
favor of the model_selection module into which all the refactored
classes and functions are moved. Also note that the interface of the
new CV iterators are different from that of this module. This module
will be removed in 0.20. “This module will be removed in 0.20.”,
DeprecationWarning)
/usr/lib/python3.4/site-packages/sklearn/grid_search.py:43:
DeprecationWarning: This module was deprecated in version 0.18 in
favor of the model_selection module into which all the refactored
classes and functions are moved. This module will be removed in 0.20.
DeprecationWarning) from sklearn.cross_validation import
train_test_split
/usr/lib/python3.4/site-packages/sklearn/cross_validation.py:44:
DeprecationWarning: This module was deprecated in version 0.18 in
favor of the model_selection module into which all the refactored
classes and functions are moved. Also note that the interface of the
new CV iterators are different from that of this module. This module
will be removed in 0.20. “This module will be removed in 0.20.”,
DeprecationWarning)
解决方法:
该模块在0.18版本中被弃用,支持所有重构的类和函数都被移动到的model_selection模块
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import train_test_split
警告
DeprecationWarning)
/usr/lib/python3.4/site-packages/sklearn/utils/validation.py:395:
DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17
and will raise ValueError in 0.19. Reshape your data either using
X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1)
if it contains a single sample.
解决方法
clf.predict([]) 规范输入
scikit-learn 0.18中的cross_validation模块被移除的更多相关文章
- Scikit Learn: 在python中机器学习
转自:http://my.oschina.net/u/175377/blog/84420#OSC_h2_23 Scikit Learn: 在python中机器学习 Warning 警告:有些没能理解的 ...
- 【numpy】新版本中numpy(numpy>1.17.0)中的random模块
numpy是Python中经常要使用的一个库,而其中的random模块经常用来生成一些数组,本文接下来将介绍numpy中random模块的一些使用方法. 首先查看numpy的版本: import nu ...
- 三分钟快速上手TensorFlow 2.0 (中)——常用模块和模型的部署
本文学习笔记参照来源:https://tf.wiki/zh/basic/basic.html 前文:三分钟快速上手TensorFlow 2.0 (上)——前置基础.模型建立与可视化 tf.train. ...
- scikit learn 模块 调参 pipeline+girdsearch 数据举例:文档分类 (python代码)
scikit learn 模块 调参 pipeline+girdsearch 数据举例:文档分类数据集 fetch_20newsgroups #-*- coding: UTF-8 -*- import ...
- sklearn.cross_validation 0.18版本废弃警告及解决方法
转载:cheneyshark 机器环境: scikit-learn==0.19.1 Python 2.7.13 train_test_split基本用法 在机器学习中,我们通常将原始数据按照比例分割为 ...
- 在阿里云Centos7.6中部署nginx1.16+uwsgi2.0.18+Django2.0.4
上次在网上找了一个在阿里云Centos7.6中部署nginx1.16+uwsgi2.0.18+Django2.0.4的文档,可能是这个文档不是最新版的,安装的时候遇到了很多问题, 最后跟一个大神要了一 ...
- (原创)(四)机器学习笔记之Scikit Learn的Logistic回归初探
目录 5.3 使用LogisticRegressionCV进行正则化的 Logistic Regression 参数调优 一.Scikit Learn中有关logistics回归函数的介绍 1. 交叉 ...
- (原创)(三)机器学习笔记之Scikit Learn的线性回归模型初探
一.Scikit Learn中使用estimator三部曲 1. 构造estimator 2. 训练模型:fit 3. 利用模型进行预测:predict 二.模型评价 模型训练好后,度量模型拟合效果的 ...
- Python中的random模块,来自于Capricorn的实验室
Python中的random模块用于生成随机数.下面介绍一下random模块中最常用的几个函数. random.random random.random()用于生成一个0到1的随机符点数: 0 < ...
随机推荐
- 书单list
2018年对我来说是个踩到狗屎的一年,不能说运气差,只能说过去所有的不良决策后果都集中到2018年爆发了,希望新的一年,都好起来.书单很短,买的确实很多,真的惭愧. 昨日世界 南渡北归 上学记 回忆录 ...
- JNDI数据源(在Tomcat下配置JNDI多数据源实例)
一,添加数据库驱动包加入classpath. 这里我用到了oracle和mysql.所以由两个jar包:ojdbc14.jar和mysql-connector-java-5.1.13-bin.jar. ...
- Ext JS 6和Sencha CMD 6 快速入门
Ext JS 6和Sencha CMD 6的入门很简单.一个命令,即可生成一个功能完整的“通用”应用程序,可以运行在本地服务器上. 这个“通用”的应用程序包含一组核心的stores,模型(models ...
- Tomcat 或JBOSS java.lang.ArrayIndexOutOfBoundsException: 8192原因及其解决方法
2018-04-02 09:24:55 org.apache.catalina.connector.CoyoteAdapter service 严重: An exception or error oc ...
- css布局-内容自适应屏幕
css页面布局,实现内容部分自适应屏幕,当内容高度小于浏览器窗口高度时,页脚在浏览器窗口底部:当内容高度高于浏览器窗口高度时,页脚自动被撑到页面底部. <style type="tex ...
- js(jQuery)tips
一:页面加上$(function(){***内容***})与不加的区别 1.这个是DOM加载完之后再加载JS代码,你的JS如果放在文档后面可能一样,但是如果你要是把JS放在head里面就有差别了(放在 ...
- Hadoop系列-HDFS基础
基本原理 HDFS(Hadoop Distributed File System)是Hadoop的一个基础的分布式文件系统,这个分布式的概念主要体现在两个地方: 数据分块存储在多台主机 数据块采取冗余 ...
- 嵌入式C语言自我修养 09:链接过程中的强符号和弱符号
9.1 属性声明:weak GNU C 通过 __atttribute__ 声明weak属性,可以将一个强符号转换为弱符号. 使用方法如下. void __attribute__((weak)) fu ...
- Postgresql HStore 插件试用小结
一, 安装 环境介绍:官方说postgresql 9.3 版本之后支持HStore 插件,目前最新版本10.3 本次测试版本:10.1 或 9.6.2 进入psql 运行环境,使用管理员(高级 ...
- 20155207王雪纯 《Java程序设计》实验一报告
20155207王雪纯 <Java程序设计>实验一报告 课程:Java程序设计 班级:1552 指导教师:娄嘉鹏 实验日期:2017.04.07 实验名称:Java开发环境的熟悉(Linu ...