May 2018
Beginner
490 pages
13h 16m
English
To make sense to a team or management, the program now prepares to display the results as data points and clusters. The data will be represented as coordinates and the clusters as colors with a geometric center or centroid, as implemented in this code:
#V.Displaying the results : datapoints and clustersy = 0for x in labels:plt.scatter(dataset.iloc[y,0], dataset.iloc[y,1],color=colors[x])y+=1 for x in range(k):lines = plt.plot(gcenters[x,0],gcenters[x,1],'kx')title = ('No of clusters (k) = {}').format(k)plt.title(title)plt.xlabel('Distance')plt.ylabel('Location')plt.show()
The dataset is now ready to be analyzed. The data has been transformed into data points (Cartesian points) and clusters ...
Read now
Unlock full access