How many clusters?
You are given an array points of size 300x2, where each row gives the (x, y) co-ordinates of a point on a map. Make a scatter plot of these points, and use the scatter plot to guess how many clusters there are.
matplotlib.pyplot has already been imported as plt.
- Create an array called
xsthat contains the values ofpoints[:,0]- that is, column0ofpoints. - Create an array called
ysthat contains the values ofpoints[:,1]- that is, column1ofpoints. - Make a scatter plot by passing
xsandysto theplt.scatter()function. - Call the
plt.show()function to show your plot.
How many clusters do you see?
Deze oefening maakt deel uit van de cursus
Unsupervised Learning in Python
Praktische interactieve oefening
Zet theorie om in actie met een van onze interactieve oefeningen.
Begin met trainen