how to fuzzified the input into linguistic variable?

101 views
Skip to first unread message

chaguidiao

unread,
Jan 15, 2009, 7:46:27 PM1/15/09
to Fuzzy Logic
Hi all,
I need to use fuzzy logic to classified the breast cancer with the
given data. The input1 given is just an integer number of 1,2 and 3.
Can i fuzzified the input1 as low for 1,medium for 2 and high for 3?

Kirk Zurell

unread,
Jan 16, 2009, 9:33:05 AM1/16/09
to Fuzzy Logic
If that's how you or your client understand these integers, then
sounds good.

How do you plan on using the linguistic variable in your fuzzy rules?

Kirk
--
Kirk Zurell
Byte Craft Limited
Waterloo, Ontario, Canada
http://www.bytecraft.com/Fuzzy_Logic

daniel, wee lian lim

unread,
Jan 19, 2009, 9:56:52 AM1/19/09
to fu...@googlegroups.com
I planned to used 1 as Low,2 as medium and 3 as high as linguistic variable.I have a total of 800 data.But the input1 given just 1,2, and 3. I not even know how to fuzzified the input.

Bilal USANMAZ

unread,
Jan 20, 2009, 5:43:43 AM1/20/09
to fu...@googlegroups.com
I want to learn if I understand right.

a) You have 800 row data and three column like this

    input1  input2 input3
        x1       y1    z1
        x2       y2    z2
        x3       y3    z3
        .          .       .
        .          .       .
      x800    y800    z800

or

b) You have just 800 row and one column data like this
   
    input
    1
    2
    3
    2
    1
    .
    .
    .
    3

or another pls. verify and write your data type,
is your data just x1=0.55, y1=14, z1=33 like (a)
or your data 1,3,2,1,3,2,2... like (b)

please explain us
 

Bilal USANMAZ

Yakutiye Belediyesi
Bilgi Islem Mudurlugu
25100 Erzurum Turkiye
Tel-1:+90 442 233 77 41
Tel-2:+90 442 235 26 10 Dahili:1190





From: "daniel, wee lian lim" <chagu...@gmail.com>
To: fu...@googlegroups.com
Sent: Monday, January 19, 2009 4:56:52 PM
Subject: [FUZZY] - Re: how to fuzzified the input into linguistic variable?

daniel, wee lian lim

unread,
Jan 21, 2009, 10:27:17 AM1/21/09
to fu...@googlegroups.com


hi
the data i have is like this:

ID
output
input1
input2
input3
input4     input5
473(1) 1 3 3 1 8.27 11.9
520(1) 0 2 2 1 6.53 8.22
473(2) 1 3 2 1 8.11 11.65
520(2) 0 2 2 1 7.07 8.68
379(1) 1 3 3 1 8.38 12.45
428(4) 0 2 2 1 6.46 8.79
379(2) 1 2 2 1 7.8 12.24
374(1) 0 3 2 1 7.1 8.73
345(1) 1 3 2 1 8.19 11.76
374(2) 0 2 2 1 7.44 8.51
345(2) 1 2 3 1 7.7 11.7
374(3) 0 3 2 1 6.63 8.57
319(1) 1 2 2 1 6.75 11.11
374(4) 0 2 2 1 7.37 8.61
319(2) 1 3 3 1 7.43 11.25
97421(4) 0 3 2 1 7.04 8.7
95316(1) 1 2 2 1 8.06 12.14
480(1) 0 3 3 1 6.26 7.37
95316(2) 1 3 2 1 8.68 12.33
480(2) 0 3 3 1 6.21 7.66
184(1) 1 3 3 1 8.11 11.96
480(3) 0 3 3 1 6.23 7.9
184(2) 1 2 2 1 8.11 11.96
480(4) 0 3 3 1 6.49 7.61
111(1) 1 3 2 1 8.1 12.2

this is the example of the data i have...i didn't show all the data. The problem i faced is i don't know how to fuzzified the input1 ,input2 and input3.

daniel, wee lian lim

unread,
Jan 21, 2009, 8:04:26 PM1/21/09
to fu...@googlegroups.com


On Wed, Jan 21, 2009 at 11:27 PM, daniel, wee lian lim <chagu...@gmail.com> wrote:

SORRY,THERE ARE SOME CORRECTION ON MY DATA
hi
the data i have is like this:

ID
output
input1
input2
input3
input4     input5
473(1) 1 3 3 1 8.27 11.9
520(1) 0 2 2 1 6.53 8.22
473(2) 1 1 1 2 8.11 11.65
520(2) 0 2 2 3 7.07 8.68
379(1) 1 3 3 1 8.38 12.45
428(4) 0 2 2 1 6.46 8.79
379(2) 1 1 2 1 7.8 12.24
374(1) 0 3 2 1 7.1 8.73
345(1) 1 3 2 1 8.19 11.76
374(2) 0 2 2 2 7.44 8.51
319(2) 1 3 1 3 7.43 11.25
97421(4) 0 3 2 1 7.04 8.7
95316(1) 1 1 2 1 8.06 12.14
480(1) 0 3 3 1 6.26 7.37
95316(2) 1 3 2 1 8.68 12.33
480(2) 0 3 3 3 6.21 7.66
184(1) 1 3 1 1 8.11 11.96
480(3) 0 3 3 1 6.23 7.9
184(2) 1 2 2 1 8.11 11.96
480(4) 0 3 1 2 6.49 7.61
111(1) 1 1 2 1 8.1 12.2

Bilal USANMAZ

unread,
Jan 22, 2009, 7:07:15 AM1/22/09
to fu...@googlegroups.com
You can use MATLAB program to make this data FUZZY easily.
if you want to train this data to make a neural network model you can use ANFIS command in MATLAB.

if you want to make this data automatically with computer firstly you must prepare data for command GENFIS1 or GENFIS2
Your data must be like this

input1 input2 input3 input4 input5 output
 3        3         1        8.27  11.9     1
 2        2         1        6.53  8.22     0

 .         .         .           .       .         .
 .         .         .           .       .         .

save this file as   anyfilename.dat (dont use input1 ,input2....title in dat file just values)

run MATLAB program and use this command for loading anyfilename.dat
>>load anyfilename.dat
and to make fuzzy this data use this command
>>fis=genfis1(anyfilename,[3],char('trimf'))
then use this command to see fuzzy sets
>>mfedit(fis)
after making fuzzy sets you perform fuzzy inference system to see your new data
>>evalfis([1 1 2 8.11 11.65],fis)
you will get a result for this vector of input

I used three triangular membership function so you can give name to your each set of input1 input2 input3 input4 and input5 as low, medium, high linguistic terms.
But there is a problem, that is; for example your first arguman input1 is including 1 and 0 namely boolen statement. but if you make it fuzzy easly it will be
 [-0.5 0 0.5] for low
 [0 0.5 1] for medium
 [0.5 1 1.5] for high
yes you can change this intervals but you dont have like 0.5 or 1.5 interval values. I think; it is reasonable to make input4 and input5 fuzzy but it is not necessary for input1 ,2 and 3.



Bilal USANMAZ

Yakutiye Belediyesi
Bilgi Islem Mudurlugu
25100 Erzurum Turkiye
Tel-1:+90 442 233 77 41
Tel-2:+90 442 235 26 10 Dahili:1190





From: "daniel, wee lian lim" <chagu...@gmail.com>
To: fu...@googlegroups.com
Sent: Thursday, January 22, 2009 3:04:26 AM

Subject: [FUZZY] - Re: how to fuzzified the input into linguistic variable?

daniel, wee lian lim

unread,
Jan 22, 2009, 9:03:20 AM1/22/09
to fu...@googlegroups.com
Hi,

Thanks for your input. It really helps me a lots.
Actually my project is focusing on fuzzy logic. I have the same opinion as you where only input 4 and input 5 need to be fuzzified as linguistic variable while input 1,input 2 and input 3 are the discrete number where they do not have a defined range to be fuzzified.

Again thanks a lot for your help.

daniel, wee lian lim

unread,
Jan 22, 2009, 9:52:11 AM1/22/09
to fu...@googlegroups.com


Hi,
In between i wish to know whats the different of using the trapezium graph in the membership function instead of triangle? This is because i am using trapezium graph for the input4 and input5.I m using the membership editor and rules viewer in my project. The deffuzzification i have choosed is bisector method. I am not really sure how the output obtained by using the bisector method.Between how do i know which method of defuzzification can shown a more accurate output?

Thanks for your time.

Bilal USANMAZ

unread,
Jan 23, 2009, 2:17:46 AM1/23/09
to fu...@googlegroups.com
you can use this address

http://www.mathworks.com/products/fuzzylogic/demos.html?file=/products/demos/shipping/fuzzy/defuzzdm.html
 
for defuzzification methods. And you can use STATFIT program to see your data shape for example your (input4 and input5) shape like log-normal. Maybe this will ve a clue for your decision to choose your membership graph but it is more important your experience choosing a mem.graph so you know your data best.



 

Bilal USANMAZ

Yakutiye Belediyesi
Bilgi Islem Mudurlugu
25100 Erzurum Turkiye
Tel-1:+90 442 233 77 41
Tel-2:+90 442 235 26 10 Dahili:1190




From: "daniel, wee lian lim" <chagu...@gmail.com>
To: fu...@googlegroups.com
Sent: Thursday, January 22, 2009 4:52:11 PM

Subject: [FUZZY] - Re: how to fuzzified the input into linguistic variable?

daniel, wee lian lim

unread,
Jan 23, 2009, 3:07:29 AM1/23/09
to fu...@googlegroups.com

Hi
    Thanks again for your guidance.
    The only way i can work on my project is by fuzzified the input4 and input5. The fuzzification of input 4 and 5 into linguistic variable is shown as below.(this is part of the data) Is this way correct? Because i really cant have any idea on how to make input 1,input2 and input3 fuzzy.
 
   

Input4

Input5

Input1

Input2

Input3

Output

High

High

1

1

1

High

Medium

High

1

1

1

High

Medium

Medium

1

1

1

High

Low

Low

1

1

1

Low

Low

Low

1

2

1

Low

Low

High

1

2

1

Low

Medium

Low

1

2

1

Low

Medium

Medium

1

2

1

Medium

Low

Low

1

3

1

Low

Benbernou Reda

unread,
Jan 23, 2009, 2:54:24 PM1/23/09
to fu...@googlegroups.com
Daniel,
 
I don't think inputs 1, 2, 3 should be fuzzified for one simple reason: they are absolutely discrete and can only take one of 3 values: 1, 2, or 3. In contrast, inputs 4 and 5 can be fuzzified because they cover a wide spectrum of values. When variables cover a wide range of values, clear-cut boundaries between what is perceived as e.g. 'high', 'average', and 'low'  do not make sense anymore. In such cases, fuzzy logic can prove handy because it enables the formulation of rules (i.e. reasoning) in terms of vague linguistic terms such as 'low', medium', and 'high'. Different input values will have different degrees of membership to each of these fuzzy sets (i.e. 'low', 'average', 'high'). 
 
Ray   


From: "daniel, wee lian lim" <chagu...@gmail.com>
To: fu...@googlegroups.com
Sent: Friday, 23 January, 2009 12:07:29

Subject: [FUZZY] - Re: how to fuzzified the input into linguistic variable?

daniel, wee lian lim

unread,
Jan 25, 2009, 5:57:26 AM1/25/09
to fu...@googlegroups.com
Hi Ray

Thanks a lot for your input.  I am now clarified.  This helps me a lot.

Daniel

daniel, wee lian lim

unread,
Jan 29, 2009, 3:39:06 AM1/29/09
to fu...@googlegroups.com

Hi
I have doubt in the calculation of defuzzification using bisector. I am using Membership function editor in MATLAB in my project. The problem I faced is the higher value for my output is only 0.9 and the lowest is 0.1. I am wonder why i cant get a maximum of 1 and minimum of 0 in my output?

Thanks for your time.

daniel, wee lian lim

unread,
Feb 2, 2009, 9:36:18 PM2/2/09
to fu...@googlegroups.com


Hi
i wish to know that is there any different by using triangular or trapezium graph in membership function? Under which condition is the trapezium graph being used?
For the input value state as below...
 
Input4:   output = 0 when input 4 < 6
 
             output = 1 when input 4 > 11.5
 
             between 6 and 11.5 the output will contains the value of 1 and 0.
 
Isn't in this condition trapezium graph is more suitable to be used?
 
Thanks.
Reply all
Reply to author
Forward
0 new messages