当前位置:网站首页>Successfully solved (machine learning data segmentation problem): modulenotfounderror: no module named 'sklearn cross_ validation‘
Successfully solved (machine learning data segmentation problem): modulenotfounderror: no module named 'sklearn cross_ validation‘
2022-06-29 00:46:00 【No envy】
Successfully solved ( Machine learning data segmentation problem ):ModuleNotFoundError: No module named ‘sklearn.cross_validation’
List of articles
Error code
In machine learning , Divide the original data into “ Test set ” and “ Training set ”, Regular use sklearn.cross_validation Inside train_test_split Modules are used to split data .
My code :
from sklearn.cross_validation import train_test_split
from sklearn.datasets import load_iris
iris = load_iris()
x_train, x_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.25, random_state=42)
print(" The eigenvalues of the training set :", x_train)
print(" The eigenvalues of the test set :", x_test)
print(" The target value of the training set :", y_train)
print(" The target value of the test set :", y_test)
print(" Target value shape of training set :", y_train.shape)
print(" The target value shape of the test set :", y_test.shape)
Report the wrong result :
from sklearn.cross_validation import train_test_split
ModuleNotFoundError: No module named 'sklearn.cross_validation'

Solutions
Translation of error reporting content :ModuleNotFoundError: There is no name “sklearn” Module .cross\u verification ’
Error reason : newest sklearn Module , at present train_test_split No more cross_validation 了
resolvent
The guide package code can be changed as follows :
from sklearn.model_selection import train_test_split
边栏推荐
- Basic use of Chrome browser
- Go1.18 new feature: discard strings Title Method, a new pit!
- 启牛学堂帮忙开证券账户是安全靠谱的吗?个人如何开
- [MCU club] design of GSM version of range hood based on MCU [simulation design]
- Es6:let, const, arrow functions
- 卷绕工艺与叠片工艺的对比
- 深度优先搜索实现抓牛问题
- 光纤滑环价格过高的原因
- Introduction to four MySQL engines
- Browser cache library design summary (localstorage/indexeddb)
猜你喜欢
![[image registration] improved SAR image registration based on sar-sift with matlab code](/img/69/4e78c6cef45b2e4d133222a4372e43.jpg)
[image registration] improved SAR image registration based on sar-sift with matlab code

Analysis of basic structure and working principle of slip ring
![[200 opencv routines] 101 adaptive median filter](/img/89/9e9b667dd28cb25af005b6028ef26c.jpg)
[200 opencv routines] 101 adaptive median filter

戴口罩人脸数据集和戴口罩人脸生成方法

旋轉接頭安裝使用注意事項

10. Yolo series

使用.Net驱动Jetson Nano的OLED显示屏
![用户登录(记住用户)&用户注册(验证码) [运用Cookie Session技术]](/img/31/c84c1e15aa1c73814c4ad643e3dd36.png)
用户登录(记住用户)&用户注册(验证码) [运用Cookie Session技术]

Comics | goodbye, postman! One stop collaboration makes apipost more fragrant!
![[MCU club] design of GSM version of range hood based on MCU [simulation design]](/img/8c/933ebfaeec63c0d1ffe361cb2bb91a.jpg)
[MCU club] design of GSM version of range hood based on MCU [simulation design]
随机推荐
【leetcode】153. Find the lowest value in the rotation sort array
【SV 基础】queue 的一些用法
旋转接头安装使用注意事项
使用.Net驱动Jetson Nano的OLED显示屏
12. Détection d'objets Mask rcnn
成功解决(机器学习分割数据问题):ModuleNotFoundError: No module named ‘sklearn.cross_validation‘
矩 阵 压 缩
Daily practice: delete duplicates in the ordered array
滑环电机是如何工作的
Chrome浏览器的基本使用
[leetcode] 522. Longest special sequence II violence + double pointer
[leetcode] 522. 最长特殊序列 II 暴力 + 双指针
卷绕工艺与叠片工艺的对比
浏览器缓存库设计总结(localStorage/indexedDB)
Is the fund reliable and safe
Is l1-031 too fat (10 points)
WPF 实现心电图曲线绘制
Document management.
旋轉接頭安裝使用注意事項
[image registration] SAR image registration based on particle swarm optimization Improved SIFT with matlab code