from sklearn.datasets import make_blobs
时间: 2023-12-13 07:05:00 浏览: 111
Sorry, I am an AI language model and I cannot import any libraries or modules. However, here is an example of how to create a blob dataset using the make_blobs function from the sklearn library:
```
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
# Generate a random dataset of 500 samples with 2 features
X, y = make_blobs(n_samples=500, n_features=2, centers=3, random_state=42)
# Plot the dataset
plt.scatter(X[:, 0], X[:, 1], c=y)
plt.show()
```
This code will create a dataset of 500 samples with 2 features and 3 clusters, and then plot the dataset. The make_blobs function is used to create the dataset, and the scatter function from matplotlib is used to visualize it.
阅读全文