当前位置:网站首页>Resolved (error in viewing data information in machine learning) attributeerror: target_ names
Resolved (error in viewing data information in machine learning) attributeerror: target_ names
2022-07-03 13:18:00 【No envy】
Successfully solved ( Error in viewing data information in machine learning ):AttributeError: target_names
List of articles
Error code
My code :
from sklearn import datasets
diabetes = datasets.load_diabetes(return_X_y=False, as_frame=True)
print(diabetes.target_names)
Wrong content :
Traceback (most recent call last):
File "D:\Python3.8\lib\site-packages\sklearn\utils\__init__.py", line 117, in __getattr__
return self[key]
KeyError: 'target_names'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:/Python/1.py", line 6, in <module>
print(diabetes.target_names)
File "D:\Python3.8\lib\site-packages\sklearn\utils\__init__.py", line 119, in __getattr__
raise AttributeError(key)
AttributeError: target_names
Error reason
target_names It's the tag name ,sciket-learn Data sets API in , The regression dataset has no tag name , Only other data sets
resolvent
View other contents such as : Characteristic name 、 News data 、 Handwritten numerals
from sklearn import datasets
diabetes = datasets.load_diabetes(return_X_y=False, as_frame=True)
print(diabetes.feature_names)
Running results :
['age', 'sex', 'bmi', 'bp', 's1', 's2', 's3', 's4', 's5', 's6']
边栏推荐
- json序列化时案例总结
- Logseq evaluation: advantages, disadvantages, evaluation, learning tutorial
- Logseq 评测:优点、缺点、评价、学习教程
- 正则表达式
- Flink SQL knows why (7): haven't you even seen the ETL and group AGG scenarios that are most suitable for Flink SQL?
- Sword finger offer 16 Integer power of numeric value
- Solve system has not been booted with SYSTEMd as init system (PID 1) Can‘t operate.
- [Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter 6 exercises]
- [Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter 7 exercises]
- [Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter V exercises]
猜你喜欢
双链笔记 RemNote 综合评测:快速输入、PDF 阅读、间隔重复/记忆
Detailed explanation of multithreading
Image component in ETS development mode of openharmony application development
File uploading and email sending
The 35 required questions in MySQL interview are illustrated, which is too easy to understand
Today's sleep quality record 77 points
[colab] [7 methods of using external data]
When we are doing flow batch integration, what are we doing?
[data mining review questions]
Mysql database basic operation - regular expression
随机推荐
In the promotion season, how to reduce the preparation time of defense materials by 50% and adjust the mentality (personal experience summary)
Fabric.js 更换图片的3种方法(包括更换分组内的图片,以及存在缓存的情况)
Loan calculator my pressure is high
[colab] [7 methods of using external data]
Cadre de logback
R语言gt包和gtExtras包优雅地、漂亮地显示表格数据:nflreadr包以及gtExtras包的gt_plt_winloss函数可视化多个分组的输赢值以及内联图(inline plot)
C graphical tutorial (Fourth Edition)_ Chapter 13 entrustment: what is entrustment? P238
【R】 [density clustering, hierarchical clustering, expectation maximization clustering]
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [sqlserver2012 comprehensive exercise]
【習題五】【數據庫原理】
Mysql database basic operation - regular expression
SSH登录服务器发送提醒
2022-02-11 heap sorting and recursion
Flink SQL knows why (XV): changed the source code and realized a batch lookup join (with source code attached)
Tutoriel PowerPoint, comment enregistrer une présentation sous forme de vidéo dans Powerpoint?
Task6: using transformer for emotion analysis
双链笔记 RemNote 综合评测:快速输入、PDF 阅读、间隔重复/记忆
剑指 Offer 12. 矩阵中的路径
Idea full text search shortcut ctr+shift+f failure problem
【Colab】【使用外部数据的7种方法】