Fuzzyfication of an excel file using ranges from a txt with simpful

32 Views Asked by At

I want to fuzzyficate this excel file using simpful: enter image description here

with these fuzzy rules:

enter image description here

In this case, for example, I'd need the excel to be 'FIFTIES' if the age is between 50 and 59 and EVOL to be '10to15' if EVOL is between 10 and 15 and so on. Like this: enter image description here

Only the Numerical variables need to change, the categorical ones always stay the same.

I'm pretty new with the simpful library so any help is welcome, many thanks :)

1

There are 1 best solutions below

0
Marco S. Nobile On

I'm Marco Nobile, one of Simpful's developers. Sorry for the late reply, I'm afraid we missed this post.

It is not entirely clear to me what you wish to implement. If you want to create linguistic variables and some specific fuzzy sets, you can use something along these lines:

from simpful import *
FR = FuzzySystem()
fuzzy_set_twenties = TriangleFuzzySet(28,28,32, term="twenties")
fuzzy_set_thirties = TrapezoidFuzzySet(28,32,38,42, term="thirties") 
age = LinguisticVariable([fuzzy_set_twenties, fuzzy_set_thirties], universe_of_discourse=[25,90])
FR.add_linguistic_variable("Age", age)
FR.produce_figure()

which should give you this

enter image description here

I hope this helps! Else, feel free to send me an e-mail.