实验 4 聚类分析
1 实验目标
(1)了解 Python 数据处理中的应用;
(2)了解机器学习库 sklearn
(2)掌握聚类分析基本方法。
2 实验内容
2.1 环境要求
Python 版本<3.9,sklearn 不支持 3.9 以上版本,之前的教程教大家装了 3.10,可以卸掉(卸载后重启电
脑),装 3.8 或 3.7😂😂😂(这是 2021 年的老黄历,新版本支持 3.10,但会带来一些额外的问题。本实验
指导所列代码在 Python3.10 环境中测试无误。Scikit-learn 1.0 supported Python 3.7-3.10. Scikit-learn 1.1
and later requires Python 3.8 or newer.)
或者了解一下怎么使用虚拟环境,随时切换版本。
使用清华源:pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
安装 pandas:pip install pandas
安装 sklearn:pip install -U scikit-learn
2.2 认识聚类
简单的数据聚类:
结果(截图):
评论0
最新资源