Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzziness argument in fuzzy_control function #79

Open
lucapizzimbone opened this issue Nov 20, 2024 · 5 comments
Open

fuzziness argument in fuzzy_control function #79

lucapizzimbone opened this issue Nov 20, 2024 · 5 comments

Comments

@lucapizzimbone
Copy link

Hi,
I would like to highlight that using the tsclust function with the following configuration:

tsclust(data, k = 3,
distance = "dtw",
seed = 123,
type = "fuzzy",
centroid = "fcmdd",
contol = fuzzy_control(
fuzziness = 2,
iter.max = 100L
))

when changing the fuzziness parameter, there is no change in the membership degrees of the data. In particular, for a fuzziness = 1.000001, I would expect having for each data row one membership degree close to 1 and the others close to zero. However, any value of fuzziness > 1 provide the same results in the membership degrees.

Thank you in advance for the attention..
Grateful,
Luca

@asardaes
Copy link
Owner

Hello, can you elaborate on why you have that expectation? For example, if we assume that the truth is that there's only 1 cluster for the whole data set, trying to attempt fuzzy clustering with k > 1 would likely yield a membership degree of 1 / k for each entity in the data regardless of the other parameters, no?

@lucapizzimbone
Copy link
Author

lucapizzimbone commented Nov 22, 2024 via email

@asardaes
Copy link
Owner

Hi Luca, github didn't render your email correctly, so I'm not sure which statement you were referring to, but if it's from the example, I don't think that's generalizable, that example concretely has most values closer to the extremes, and even then they're "massaging" the membership matrix into a single dimension in a way that could be confusing when compared to other cases.

@lucapizzimbone
Copy link
Author

lucapizzimbone commented Nov 23, 2024 via email

@asardaes
Copy link
Owner

The logic for partitional and fuzzy clustering is more or less shared, the calculation you care about should happen here:

cluster <- family@cluster(distmat = distmat, m = control$fuzziness)

You should be able to debug the code and see the values at each step with:

debug(dtwclust:::pfclust)
# your tsclust call here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants