尝试创建 4 个随机数据集群时,我收到以下错误消息:
# Generate 4 clusters of random data.
from sklearn.datasets.samples_generator import make_blobs
data, _ = make_blobs(n_samples=300, centers=4,
cluster_std=0.60, random_state=0)
Run Code Online (Sandbox Code Playgroud)
错误:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-f93335003f84> in <module>
1 # Generate 4 clusters of random data.
----> 2 from sklearn.datasets.samples_generator import make_blobs
3
4 data, _ = make_blobs(n_samples=300, centers=4,
5 cluster_std=0.60, random_state=0)
ModuleNotFoundError: No module named 'sklearn.datasets.samples_generator'
Run Code Online (Sandbox Code Playgroud)
我试过:pip install sckit-learn和pip install sckit-datasets
我在 Windows 上的 Git Bash 上有 Anaconda 3、python 3.6 和 PythonAdv 环境。