【发布时间】:2022-08-10 05:11:45
【问题描述】:
我正在处理来自不同方向的加速度计的数据。数据位于球体表面。我希望使用球形 k 均值聚类来识别表面上的聚类。
我从 Jason Laska 安装了包 spherecluster。我能够在我的 Anaconda 环境(基础和虚拟环境)中安装该软件包而没有任何问题。但是在尝试导入 spherecluster 模块时,出现以下错误。
(base) ➜ unsupervised_learning: python
Python 3.9.12 (main, Apr 5 2022, 01:52:34)
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.
>>> import spherecluster
Traceback (most recent call last):
File \"<stdin>\", line 1, in <module>
File \"/Users/username/anaconda3/lib/python3.9/site-packages/spherecluster/__init__.py\", line 2, in <module>
from .spherical_kmeans import SphericalKMeans
File \"/Users/username/anaconda3/lib/python3.9/site-packages/spherecluster/spherical_kmeans.py\", line 7, in <module>
from sklearn.cluster.k_means_ import (
ModuleNotFoundError: No module named \'sklearn.cluster.k_means_\'
>>>
我根据模块的要求安装了 numpy 和 scipy。我找不到 sklearn.cluster.k_means_ 以下是我的 numpy、scipy 和 scikit-learn 版本
numpy 1.21.5 py39h25ab29e_1
numpy-base 1.21.5 py39h974a1f5_1
scikit-learn 1.0.2 py39h9197a36_1
scipy 1.7.3 py39h2f0f56f_0
我究竟做错了什么?
标签: python machine-learning scikit-learn unsupervised-learning