IniziaInizia gratis

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 xs that contains the values of points[:,0] - that is, column 0 of points.
  • Create an array called ys that contains the values of points[:,1] - that is, column 1 of points.
  • Make a scatter plot by passing xs and ys to the plt.scatter() function.
  • Call the plt.show() function to show your plot.

How many clusters do you see?

Questo esercizio fa parte del corso

Unsupervised Learning in Python

Visualizza il corso

Esercizio pratico interattivo

Passa dalla teoria alla pratica con uno dei nostri esercizi interattivi

Inizia esercizio