I have a normally distributed 2D dataset, and I am using the fcmeans library to perform fuzzy c-means clustering. I am able to plot the clusters with the red point indicating the cluster center. However, I need to show a gradient where the fuzziness occurs. I am not sure how to implement this in Python and I haven't been able to find anything like it online.
from fcmeans import FCM
data = pd.read_csv("my_data.csv")
model = FCM(n_clusters=2)
model.fit(data)
cntrs = my_model.centers
hard_prediction_labels = my_model.predict(data)
soft_prediction_labels = my_model.soft_predict(data)
plt.scatter(data[:, 0], data[:, 1], c=hard_prediction_labels, s=30);
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. I am able to obtain the probabilities from the soft prediction (as to the probability of the data point belonging to each cluster) using the soft_predict() function, but I am unsure of how to create a color gradient with it.