当前位置:网站首页>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']
边栏推荐
- MySQL constraints
- stm32和电机开发(从mcu到架构设计)
- 我的创作纪念日:五周年
- Sword finger offer 15 Number of 1 in binary
- Servlet
- Sword finger offer 14- I. cut rope
- C graphical tutorial (Fourth Edition)_ Chapter 20 asynchronous programming: examples - using asynchronous
- 【数据库原理及应用教程(第4版|微课版)陈志泊】【第四章习题】
- Task6: using transformer for emotion analysis
- 2022-02-14 incluxdb cluster write data writetoshard parsing
猜你喜欢

已解决(机器学习中查看数据信息报错)AttributeError: target_names

Some thoughts on business

18W word Flink SQL God Road manual, born in the sky

Elk note 24 -- replace logstash consumption log with gohangout

sitesCMS v3.1.0发布,上线微信小程序

JSP and filter

Typeerror resolved: argument 'parser' has incorrect type (expected lxml.etree.\u baseparser, got type)

Flink SQL knows why (12): is it difficult to join streams? (top)

Solve system has not been booted with SYSTEMd as init system (PID 1) Can‘t operate.

DQL basic query
随机推荐
Solve system has not been booted with SYSTEMd as init system (PID 1) Can‘t operate.
【数据库原理及应用教程(第4版|微课版)陈志泊】【第六章习题】
CVPR 2022 图像恢复论文
The difference between session and cookie
Server coding bug
Will Huawei be the next one to fall
Useful blog links
When the R language output rmarkdown is in other formats (such as PDF), an error is reported, latex failed to compile stocks Tex. solution
Fabric. JS three methods of changing pictures (including changing pictures in the group and caching)
(first) the most complete way to become God of Flink SQL in history (full text 180000 words, 138 cases, 42 pictures)
Reptile
C graphical tutorial (Fourth Edition)_ Chapter 20 asynchronous programming: examples - using asynchronous
Kotlin - 改良装饰者模式
php:&nbsp; The document cannot be displayed in Chinese
关于CPU缓冲行的理解
Flink SQL knows why (7): haven't you even seen the ETL and group AGG scenarios that are most suitable for Flink SQL?
[Exercice 5] [principe de la base de données]
2022-02-10 introduction to the design of incluxdb storage engine TSM
用户和组命令练习
解决 System has not been booted with systemd as init system (PID 1). Can‘t operate.