Machine Learning, Clustering, Affinity Propagation, Python, Unsupervised Learning.
plt.scatter(X[:, 0], X[:, 1], c=labels_true, edgecolors='k', cmap=plt.cm.viridis) plt.title('Generated Sample Data') plt.xlabel('Feature 1') plt.ylabel('Feature 2') plt.grid(True) plt.show() Generated data. Image by the author. Let’s use AffinityPropagation now. af = AffinityPropagation().fit(X)