I have a normally distributed 2D dataset, and I am using the GMM library. I am able to plot the clusters with the red point indicated the cluster center. However, I need to show a gradient similar to the second picture where the clusters touch. I am not sure how to implement this in Python and I have been able to find anything like it online. Any suggestions?
labels1 = gmm1.predict(data1)
plt.scatter(data1[:, 0], data1[:, 1], c=labels1, s=40, cmap='viridis');
plt.scatter(data_gmm1.means_[:, 0], data_gmm1.means_[:, 1], s=100, c='red', cmap='blue', label = 'Centroids');
This is what I have: plot1
This is what I’m trying to get: plot2
I believe that my mistake is coming from the fact that my labels are 1 or 0; however, I’m not sure how to define it in a way that would allow me to determine which points are borderline.