Get the results of rules

146 views
Skip to first unread message

Dario Torregrossa

unread,
Oct 5, 2016, 2:01:17 PM10/5/16
to scikit-fuzzy

If at the end of the script I add this command:

print tipping.print_state()

I have a nice summary of the status of the system.

Is it possible to extract the results of the rules (called otherwise truth degree, or rule membership factor)?

For example, for the output of Rule 2, I would extract the number pasted in red:

RULE #2:
  IF service[good] AND quality[good] THEN tip[high]

  Aggregation (IF-clause):
  - service[good]                                          : 0.96
  - quality[good]                                          : 0.3
                           service[good] AND quality[good] = 0.3
  Activation (THEN-clause):
                                                 tip[high] : 0.3


Thank you

Dario

JDWarner

unread,
Nov 10, 2016, 11:14:41 PM11/10/16
to scikit-fuzzy
Hi Dario,

This should be possible.  Due to many other demands on my time, I don't have a quick answer, but will try to get back with you early next week.

Josh

Josh Warner

unread,
Nov 19, 2016, 6:27:17 PM11/19/16
to scikit-fuzzy

This value can be extracted. It lives in a special dictionary which saves the state of each simulation as a hash, for quick lookup of results if a given set of inputs happens to occur more than once. Each Rule object has this special look-up table. To access this value, you have to actually pass in the simulation you want the value for.

You can get this value - the truth degree of a given rule - as follows for your particular example:

rule3.aggregate_firing[tipping]

Note the square brackets. tipping must be a ControlSystemSimulation with a set of inputs that has already been computed, and the ControlSystem tipping is based on must contain the Rule in question.

Hope that helps!

Josh

Reply all
Reply to author
Forward
0 new messages