1. sklearn-learn数据集:API Reference — scikit-learn 1.2.2 documentation

2. 算法学习资料:ShowMeAI知识社区

3. 深度学习框架:2.1. 数据操作 — 动手学深度学习 2.0.0 documentation

4. sklearn-learn 数据集获取步骤

数据集:fetch_california_housing

4.1 离线下载cal_housing.tgz 压缩包

from sklearn.datasets import fetch_california_housing, get_data_home
# 将复制下载后的cal_housing.tgz 放到此路径下面
print(get_data_home())    #输出的是路径如:/Users/jiangting/scikit_learn_data 

4.2 查找sklearn的地址

通过 pip show sklearn 获取sklearn的安装地址如:         /Users/jiangting/opt/anaconda3/lib/python3.9/site-packages

4.3 打开文件_california_housing.py

将138行的archive_path修改成如下:

     # archive_path = _fetch_remote(ARCHIVE, dirname=data_home)
     import os
     archive_path = os.path.join(data_home, 'cal_housing.tgz')

4.4 python读取数据

from sklearn.datasets import fetch_california_housing

data = fetch_california_housing() 
04-26 19:40