aresio / simpful

A friendly python library for fuzzy logic reasoning
Academic Free License v3.0
129 stars 33 forks source link

About Fuzzy inferred membership values for input variables at each run #15

Open tawdes opened 2 years ago

tawdes commented 2 years ago

Hi Could you please tell me where I can get fuzzy inputs membership values assigned at every run of Fuzzy inference to calculate Fuzzy score.

Thank you.

aresio commented 11 months ago

Dear Tawdes,

we did not create a specific interface for that. One option would be to iterate over the dictionary of linguistic variables and, for each one, iterate over the list of fuzzy sets it contains. You can get the membership values by passing the current state of the linguistic variable. Something like this:

for ling_variable, val in FS._lvs.items():
    print(ling_variable)
    for fuzzy_set in val._FSlist:
      print(fuzzy_set, fuzzy_set.get_value(FS._variables[ling_variable]))

we are considering to implement a simpler and more straightforward interface for this. If you need it urgently, we can prioritize this feature. Let me know!

All the best,

Marco