scikit-fuzzy / scikit-fuzzy

Fuzzy Logic SciKit (Toolkit for SciPy)
Other
799 stars 270 forks source link

Getting fuzzification membership from fuzz.interp_membership() #235

Open vishma opened 4 years ago

vishma commented 4 years ago

I have successfully completed tipping example in the tutorial. As a final result I was able to get a crisp value for the tip.

What if I need the fuzzy membership of the tip? (i.e. whether tip is low/medium or high)

I used the python API and this is what my final results as of the example.

image

How can I use fuzz.interp_membership() function or any other function to obtain the most suitable fuzzy set for current observation?

Since I used the automf to generate membership functions I cannot access the ' Fuzzy membership function' from the interp_membership() function as it only returns a 'term' when I access it like tip['high'].

Thanks in advance.

LGuilhermeRodrigues commented 3 years ago

I have the same question

AlisonPanisson commented 3 years ago

Hey guys,

You just need to use .mf in the fuzz.interp_membership

In your example, you might need something like this:

RESULT= tipping.output['tip']
print("Pertinence tip LOW: \t" + str(fuzz.interp_membership(tip.universe, tip['low'].mf, RESULT)))
print("Pertinence tip MEDIUM: \t" + str(fuzz.interp_membership(tip.universe, tip['medium'].mf, RESULT)))
print("Pertinence tip HIGH: \t" + str(fuzz.interp_membership(tip.universe, tip['high'].mf, RESULT)))

I hope this help! Best!

Umarkhan40 commented 2 weeks ago

I am working on my Master thesis and i don't know coding. can you please help me in my setting up ANFIS model using google colab python3. here is the code below need your assistance plz, also can you share code snippets of tipping membership function https://colab.research.google.com/drive/1vWkSQOY8XVIiS8KiR5pRMU0y2dpKXVvQ?userstoinvite=es.soror91%40gmail.com&sharingaction=manageaccess&role=writer#scrollTo=pLydPM5Xunfq