实用例子

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()

 

相关文章:

  • 2021-05-16
  • 2021-07-04
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2022-03-08
猜你喜欢
  • 2021-10-13
  • 2021-09-15
  • 2022-12-23
  • 2021-06-23
  • 2021-10-17
  • 2022-12-23
相关资源
相似解决方案