Universe varibales and MFs generation

87 views
Skip to first unread message

Hounaida Zemzem

unread,
May 18, 2017, 3:16:55 PM5/18/17
to scikit-fuzzy
Hi,

I am looking for a function (in the sckit fuzzy package if it exists) which generates automatically the universe of variables based on max and min values of each variable. Also, for the generation of the membership functions, how can I define the function parameters (e.g, the a, b and c for trimf function).

I am looking forward to your reply. 
Message has been deleted
Message has been deleted

Hounaida Zemzem

unread,
May 18, 2017, 6:01:43 PM5/18/17
to scikit-fuzzy

I found in the examples of fuzzy control systems two ways to define the universe for example:
  1. universe = np.linspace(-2, 2, 5) then we define the varible error as:                              error = ctrl.Antecedent(universe, 'error')
  2. x_qual = np.arange(0, 11, 1) if Quality on subjective ranges [0, 10]
So what is the difference between the two methods?

JDWarner

unread,
May 19, 2017, 9:44:40 PM5/19/17
to scikit-fuzzy
First, I would encourage you to use an interactive environment which allows inline viewing of the function documentation.  The most used and highly recommend one of these would be a Jupyter notebook.  The reason I recommend this is because what you're asking has little to do with scikit-fuzzy, but rather basic NumPy questions.  The documentation of the functions np.arange and np.linspace should make these methods clear.

Scikit-Fuzzy depends upon some basic familiarity with NumPy, as for the most part the data is represented by NumPy arrays.  The ideal case would be the ability to guide yourself forward past this sort of problem, or seek tutorials to familiarize yourself with NumPy to the point where you can begin to explore Scikit-Fuzzy. 

Hounaida Zemzem

unread,
May 21, 2017, 2:47:19 PM5/21/17
to scikit-fuzzy
Thank you for your answer. I will take your advice into account and I will see Numpy documentation when needed. Unfortunately, I am a bit under time pressure. Thus, I would like to use simple but useful predefined methods from sckit fuzzy. So that, I'm following this example steps : http://pythonhosted.org/scikit-fuzzy/auto_examples/plot_tipping_problem_newapi.html

I will explain my situation so that you understand the problem and give me some advice: I want to build a control system with:
  • input : number of a Dataset attributes
  • output : 7 classes
  • rules : number of a Dataset rows
Is the tipping problem useful for my situation ?



Hounaida Zemzem

unread,
May 22, 2017, 4:45:21 AM5/22/17
to scikit-fuzzy
I have to generate rules from normalised dataset rows so i have to extract linguistic terms from numerical number. Each function have I use ?! for example : 
Rule 1 : condition { 0.5, 0.7, 0.1 } -> each number must have one term from {low, medium, hight} 

Josh Warner

unread,
May 22, 2017, 5:59:58 PM5/22/17
to Hounaida Zemzem, scikit-fuzzy
If your desired three membership functions are equally spaced, you can simply define the universe and then use the automatic membership function generator which every Antecedent/Consequent exposes.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages