sklearn datasets数据集
实用例子
from sklearn import datasets import matplotlib.pyplot as plt # # 簇 # x, y = datasets.make_blobs(n_samples=1000, n_features=4, centers=4, cluster_std=0.8) # plt.scatter(x[:, 0], x[:, 1], s=8, c=y) # plt.show() # 同心园 # x, y = datasets.make_circles(n_samples=5000, noise=0.04, factor=0.4) # plt.scatter(x[:, 0], x[:, 1], s=8, c=y) # plt.show() # 月牙 x, y = datasets.make_moons(n_samples=10000, noise=0.01) plt.scatter(x[:, 0], x[:, 1], s=8, c=y) plt.show()