当前位置:网站首页>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
边栏推荐
- 启牛学堂帮忙开证券账户是安全靠谱的吗?个人如何开
- JVM工作原理介绍
- 畢業三年的25歲碼農總結
- Report on the convenient bee Lantern Festival: the first peak sales of pasta products this year; prefabricated wine dumplings became the winners
- var、let、const 三者的区别
- Reasons for high price of optical fiber slip ring
- Browser cache library design summary (localstorage/indexeddb)
- JDBC连接、断开数据库的封装
- Xuetong denies that the theft of QQ number is related to it: it has been reported; IPhone 14 is ready for mass production: four models are launched simultaneously; Simple and elegant software has long
- 请问基金是否靠谱,安全吗
猜你喜欢

Baidu online disk login verification prompt: unable to access this page, or the QR code display fails, the pop-up window shows: unable to access this page, ensure the web address....

Redis是什么

Difference between applying for trademark in the name of individual and company

How the slip ring motor works

Two fresh students: one is practical and likes to work overtime, and the other is skilled. How to choose??

旋转接头安装使用注意事项
How does the JVM bottom layer implement synchronized
![[staff] pedal mark (step on pedal ped mark | release pedal * mark | corresponding pedal command in MIDI | continuous control signal | switch control signal)](/img/2b/e358b22d62ce6d683ed93418ff39fe.jpg)
[staff] pedal mark (step on pedal ped mark | release pedal * mark | corresponding pedal command in MIDI | continuous control signal | switch control signal)

pinhole camera model

Analysis of basic structure and working principle of slip ring
随机推荐
10. Yolo series
Sampling with VerilogA module
HandlerThread使用及原理
大型网站架构基础之笔记
Is pension insurance a financial product? Where is the expected return?
【UVM】我的 main_phase 都跑完了,为啥 case 无法退出?太不讲道理!
运营级智慧校园系统源码 智慧校园小程序源码+电子班牌+人脸识别系统
Use and principle of handlerthread
How to handle a SIGTERM - how to handle a SIGTERM
[agile 5.1] core of planning: user stories
JVM工作原理介绍
Redis常用命令手册
12.物體檢測Mask-Rcnn
FSS object storage how to access the Intranet
【leetcode】153. Find the lowest value in the rotation sort array
Notes on the infrastructure of large websites
[MCU club] design of classroom number detection based on MCU [simulation design]
旋轉接頭安裝使用注意事項
[communication] wide band source DOA estimation method based on incoherent signal subspace (ISM)
Nodejs installation and download