June 2015
Beginner
348 pages
8h 44m
English
We will generate some random points and cluster them, which means that the points that are close to each other are put into the same cluster. This is just one of the many techniques that you can apply with scikit-learn. Clustering
is a type of machine learning algorithm, which aims to group items based on similarities. Next, we will calculate a square affinity matrix. An affinity matrix is a matrix containing affinity values: for instance, the distances between points. Finally, we will cluster the points with the AffinityPropagation class from scikit-learn.
positions = np.random.randint(0, 400, size=(30, 2))
Read now
Unlock full access