omadson / fuzzy-c-means

A simple python implementation of Fuzzy C-means algorithm.
https://fuzzy-c-means.rtfd.io
MIT License
175 stars 43 forks source link

'FCM' object has no attribute 'partition_coefficient' #19

Closed saramasarone closed 3 years ago

saramasarone commented 3 years ago

Hi 👋🏻,

I am trying to reproduce the example "02 Validation". However, when I get to the point saying:

`for n_clusters, model, axe in zip(n_clusters_list, models, axes.ravel()):

# get validation metrics
pc = model.partition_coefficient
pec = model.partition_entropy_coefficient` 

I get an error saying: 'FCM' object has no attribute 'partition_coefficient'

Do I need to import something else in addition the usual packages? It seems like it doesn't recognise the attribute partition.coefficient.

(the data X_embedded is the tSNE output as (415, 2))

Screenshot 2020-12-14 at 19 22 48 (2)

omadson commented 3 years ago

Hi, @saramasarone. Thanks for your interest in this package.

Do you use Linux or Windows? I guess that your installed package is the old version because now I use jax as main dependencies and the jax package just works on Linux. If you use Windows, don't worry, I will change to use numpy in this new version.

Another issue is about your python version. The new version of fuzzy-c-means just works on python >=3.8.

saramasarone commented 3 years ago

Thanks for the prompt reply @omadson, I am actually on Mac, I downloaded this package yesterday (yes, I have the 3.7.5 because some of the packages I work with are breaking with latest versions - unfortunately)

omadson commented 3 years ago

So, @saramasarone... I changed the python dependency to >=3.6 and create a new release of the package (PR #20). Please try to install again now using:

pip install -U fuzzy-c-means

and run the sample code again.

saramasarone commented 3 years ago

Thank you!