
上QQ阅读APP看书,第一时间看更新
Creating a dataset for clustering
Clusters will also be covered. There are actually several functions to create datasets that can be modeled by different cluster algorithms.
- For example, blobs are very easy to create and can be modeled by k-means:
blobs_data, blobs_target = d.make_blobs()
- This will look like the following:
import matplotlib.pyplot as plt
%matplotlib inline
#Within an Ipython notebook
plt.scatter(blobs_data[:,0],blobs_data[:,1],c = blobs_target)
