Perhaps I'm wrong but shouldn't a distance matrix used for clustering have small values if the samples are close and large values when they are very different? With the current implementation of the cosine similarity, we obtain +1 for the same samples and -1 for very different samples. So I think we want to change the following
Hi @nicrie You are right. I fixed this issue and released it in the new version. Thank you very much for the information. Please update the package to see the changes.
Perhaps I'm wrong but shouldn't a distance matrix used for clustering have small values if the samples are close and large values when they are very different? With the current implementation of the cosine similarity, we obtain +1 for the same samples and -1 for very different samples. So I think we want to change the following
https://github.com/omadson/fuzzy-c-means/blob/3e57aa2386908bef413525c28eaa88dde47d132e/fcmeans/main.py#L146-L150
to something like
and then use use
_cosine
instead of_cosine_similarity
for computing the distance matrix.PS: I can open a PR if required