OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to Show "Fuzziness" in Fuzzy Clustering Python

  • Thread starter Thread starter user157764
  • Start date Start date
U

user157764

Guest
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?

Code:
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.
<p>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?</p>
<pre><code>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');
</code></pre>
<p>This is what I have: <a href="https://i.sstatic.net/c4jX7.png" rel="nofollow noreferrer">plot1</a></p>
<p>This is what I'm trying to get: <a href="https://i.sstatic.net/sBoYE.png" rel="nofollow noreferrer">plot2</a></p>
<p>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.</p>
 
Top