-
Notifications
You must be signed in to change notification settings - Fork 266
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
Discussion/RFC: Add Takagi-Sugeno-Kang (TSK, Sugeno) fuzzy systems #95
Comments
Hi, In my opinion, one way to do that could be:
One example of Fuzzy System of TSK rules would be: quality = fuzz.Antecedent(np.arange(0, 11, 1), 'quality')
service = fuzz.Antecedent(np.arange(0, 11, 1), 'service')
tip = fuzz.Consequent(np.arange(0, 26, 1), 'tip')
quality.automf(3)
service.automf(3)
rule1 = fuzz.Rule(quality['poor'] | service['poor'], tip[fuzz.fuzzymath.polynomial(coefficients=(5,1,1), exponents=(1,1))])
rule2 = fuzz.Rule(service['average'], tip[fuzz.fuzzymath.polynomial(coefficients=(2,1,2), exponents=(1,1))])
rule3 = fuzz.Rule(service['good'] | quality['good'], tip[fuzz.fuzzymath.polynomial(coefficients=(5,2,3), exponents=(1,1))])
tipping_ctrl = fuzz.ControlSystem([rule1, rule2, rule3])
tipping = fuzz.ControlSystemSimulation(tipping_ctrl)
tipping.input['quality'] = 6.5
tipping.input['service'] = 9.8
tipping.compute() Doing it in this way, there is not a big change in the API and it could work (the main trick would be in the |
Thanks for the detailed input, @jcozar87 - definitely what I was looking for. I don't routinely use TSK systems so I really appreciate your thoughts. From what I read, I hoped it was just the Your way is probably the most transparent method to enable this. I do wonder if it's almost too transparent - we do want people to be able to find this intuitively. The main new object is the We can make this a little clearer via documentation and examples in the docstrings and online gallery. |
Can you give any more details about what ideally the My main concern is cross terms or more than one use of a given Antecedent in the polynomial. Something like |
I agree that it may be too transparent. But the point is that in Mamdani consequents, you have a Fuzzy Variable with a fixed partition, and you choose one label for the consequent of the rule. In the case of TSK consequents, it is a polynomial function of the input variables, so for each rule you have to specify a (possible) different polynomial: that is the reason I suggested to follow that procedure. Regarding the polynomials you are right, it requires more information. As TSK consequents are polynomial functions of the input variables (and the order of the TSK rules refers to the grade of the polynomial), one way to use this type of objects could be as follows: and we can use the
where variables would be the values for the input variables: |
@jcozar87 are you OK with pushing TSK systems into the next major point release? I do think it's entirely possible to do this, but I'd like to get 0.2 out very soon. |
Hi @JDWarner, sorry, I have been very busy. I recently moved to other country because my job, but I will work on it this week! I know how to implement it, so I expect to push it very soon. |
Hi @JDWarner, I made a PR to discuss some things about the implementation of the TSK systems. |
The new fuzzy system API (initially in #70, follow-ups in #76 and #92 so far) is designed for classical Mamdani fuzzy systems.
It has been requested that we consider adding support for TSK systems in the new framework.
This Issue is the place for discussion about potentially adding this support. Please post any thoughts about
Consequent
object with a kwarg, or should it be a separateConsequentTSK
object.Once we have a sense of the ideal design, we can move forward with implementation.
The text was updated successfully, but these errors were encountered: