.


:




:

































 

 

 

 


3




  1. Xin , ;
  2. Xout , ;
  3. radii , . radii [0, 1] , subclust . radii , ;
  4. xBounds , . , .. 2 x p, . xBounds , subclust Xin Xout;

options , subclust.

:

x=2*rand(100,2);
y=x(:,1).^2+2*x(:,2);
fis=genfis2(x, y, 0.5)
y_fis=evalfis(x, fis);
plot(y, y_fis, 'r.')
hold on
min_y=min(y);
max_y=max(y);
plot([min_y max_y], [min_y max_y], '-k')
xlabel('target')
ylabel('fis output')

===================================================================

100 -, y=x1^2+2*x2. , . ( ) ( ) . , ANFIS, , genfis2, .

\ \

GENPARAM
ANFIS-

:

mf_param = genparam(data, mf_n, mf_type)

:

genparam , .

genparam , :

  1. data . . , ;
  2. mf_n , , . , . 2;
  3. mf_type , . , . - 'gbellmf' ( ). genparam : 'sigmf', 'smf' 'zmf'.

genparam mf_param, . , - , , - .

:

NumData = 1000;
data = [rand(NumData,1) 10*rand(NumData,1)-5 rand(NumData,1)];
NumMf = [3 7];
MfType = str2mat('trapmf','gbellmf');
MfParams = genparam(data,NumMf,MfType);
set(gcf,'Name','genparam','NumberTitle','off');
NumInput = size(data, 2) - 1;
range = [min(data)' max(data)'];
FirstIndex = [0 cumsum(NumMf)];
for i = 1:NumInput;
subplot(NumInput, 1, i);
x = linspace(range(i, 1), range(i, 2), 100);
index = FirstIndex(i)+1:FirstIndex(i)+NumMf(i);
mf = evalmmf(x, MfParams(index,:), MfType(i,:));
plot(x, mf');
xlabel(['input ' num2str(i) ' (' MfType(i,:) ')']);
end

===================================================================

1000 -.

\ \

GENSURF
"-",

:

gensurf (fis)
gensurf (fis, inputs, output)
gensurf (fis, inputs, output, grids)
gensurf (fis, inputs, output, grids, refinput)
[x y z] = gensurf()

:

"-", . gensurf :

  1. fis - ;
  2. inputs - , , . - [1 2]. , "-";
  3. output - , . ;
  4. grids - , . , . 15;
  5. refinput - , , . . . , , , NaN. refinput . refinput .

gensurf x, y, z, (x) (y), (z) .

:

a=readfis('tipper')
gensurf(a)

" - " "Tipper", .

\ \

GETFIS

:

out = getfis (fis)
out = getfis (fis, fisprop)
out = getfis (fis, vartype, varindex, varprop)
out = getfis (fis, vartype, varindex, 'mf', mfindex, mfprop)

:

. getfis , , :

  1. fis - ;
  2. fisprop -
    :
    'AggMethod' - ;
    'AndMethod' - ;
    'DefuzzMethod' - ;
    'ImpMethod' - ;
    'InLabels' - ;
    'InMfLabels' - , ;
    'InMfParams' - ;
    'InMfs' - ;
    'InMfTypes' - ;
    'InRange' - ;
    'Name' - ;
    'NumInputMfs' - ;
    'NumInputs' - ;
    'NumOutMfs' - ;
    'NumOutputs' - ;
    'NumRules' - ;
    'OrMethod' - ;
    'OutLabels' - ;
    'OutMfLabels' - , ;
    'OutMfParams' - ;
    'OutMfs' - ;
    'OutMfTypes' - ;
    'OutRange' - ;
    'RuleList' - ;
    'Type' - ( );
  3. vartype - . : 'input' - ; 'output' - ;
  4. varindex - ;
  5. varprop - .
    :
    'Name' - ;
    'Range' - ;
    'NumMfs' - ;
    'MfLabels' - , ;
  6. mfindex - ;
  7. mfprop - .
    :
    'Name' - ();
    'Type' - ;
    'Params' - .

.

:

a=readfis('tipper')
out=getfis(a)

"Tipper".

\ \

MAM2SUG

:

sug_fis=mam2fis(mam_fis)

:

mam2sug (mam_fis) (sug_fis). . mam2sug . , . ""- (), ""- (). ""- , .

:

mam_fis=readfis('tipper');
sug_fis=mam2sug(mam_fis);
subplot(1,2,1)
gensurf(mam_fis)
title('Tipper: Mamdani type FIS');
subplot(1,2,2)
gensurf(sug_fis)
title('Tipper: Sugeno type FIS');

"Tipper", . mam2sug . " - " .

\ \

MF2MF

:

outParams = mf2mf(inParams, inType, outType)

:

mf2mf . mf2mf :

  1. inParams - ;
  2. inType - ;
  3. outType - .

: 'trimf'; 'trapmf'; 'pimf'; 'gaussmf'; 'gauss2mf'; 'gbellmf'; 'sigmf'; 'dsigmf'; 'smf'; 'psigmf'; 'zmf'. " ".

mf2mf outParams, .

mf2mf . , , .

:

x=0:0.1:5;
mfp1 = [1 2 3];
mfp2 = mf2mf(mfp1, 'gbellmf', 'trimf');
plot(x, gbellmf(x, mfp1), x, trimf(x, mfp2))

. .

\ \

NEWFIS

:

fis = newfis(fis_name, fis_type, andMethod, orMethod, impMethod, aggMethod, defuzzMethod)

:

. newfis :

  1. fis_name - ;
  2. fis_type - . :'mamdani' - ( );'Sugeno' - ;
  3. andMethod - . : ('min') - ; ('prod') - ;
  4. orMethod - . : ('max') - ; ('probor') - ;
  5. impMethod - . - 'min' - ;
  6. aggMethod - . - 'max' - ;
  7. defuzzMethod - . : ('centroid') - ; (''wtaver) - .

:

a=newfis('new_fuzzy_system')

a, 'new_fuzzy_system'. .

\ \

PARSRULE

:

outfis = parsrule (infis, inrulelist, ruleformat, lang)
[outfis, outrulelist, errorstr] = parsrule (infis, inrulelist, ruleformat, lang)

:

parsrule . . parsrule , :

  1. infis - ;
  2. inrulelist - " - ". , , . Rule Editor. :
    - - "if", "and", "or", "then", "is", "not";
    - - "si", "et", "ou", "alors", "est ","n''est_pas";
    - - "senn", "und", "oder", "dann", "ist", "nicht",
    "", "", "", "", "", "", . . 1. , ;
  3. ruleformat - . :
    'verbose' - ;
    'symbolic' - ;
    'indexed' - .
    - 'verbose'. 7.3. 'verbose' 'none'. "" ;
  4. lang - 'verbose'. :
    'english' - ;
    'francais' - ;
    'deutsch' - .
    .

parsrule :

  1. outfis - ;
  2. outrulelist - outfis. , , inrulelist. char. outfis . '#' , .
  3. errorstr - .

:

infis=readfis('tipper');
r1='if service is good then tip is average ';
r2='if service is poor and food is rancid then tip is cheap ';
r3='if service is excellent and food is delicious then tip is generous';
inrulelist=[r1; r2; r3];
outfis=parsrule(infis,inrulelist)

"Tipper", . , :

"if service is good then tip is average";
"if service is poor and food is rancid then tip is cheap";
"if service is excellent and food is delicious then tip is generous'".

\ \

PIMF
-

:

y = pimf (x, params)

:

pimf . s- z- : pimf(x, [a, b, c, d])=smf(x, [a, b]).*zmf(x, [c,d]).

b<=c, :

[a, d] ;
[b, c] .

b>c, .

pimf . pimf :

  1. x , ;
  2. params . [a b c d].

pimf y, x.

:

x = 0: 0.1: 10;
y1 = pimf (x, [0 0.5 3 9]);
y2 = pimf (x, [0 4 5.5 9]);
y3 = pimf (x, [0 6 7 9]);
plot (x, [y1; y2; y3])
title (' pimf, a=0, d=9')
ylim ([0 1.05])
legend (b=0.5, c=3, b=4, c=5,5, b=6, c=7)

===================================================================

- [0.5, 3], [4, 5.5] [6, 7].

\ \

PLOTFIS

:

plotfis (fis)

:

plotfis fis. , , . , . .

:

a=readfis(tipper);
plotfis(a)

Tipper.

\ \

PLOTMF

:

plotmf (fis, varType, varIndex, numPts)
[x, y] = plotmf (fis, varType, varIndex, numPts)

:

plotmf . plotmf 3 4 :

  1. fis ;
  2. varType . : input' ; output' ;
  3. varIndex . .
  4. numPts , . 181.

plotmf :

  1. x - ;
  2. y - , x.

plotmf .

:

a=readfis(tipper);
plotmf(a, 'input', 1)

\ \

PROBOR

:

y = probor (x)

:

y = a + b ab. x . , x. probor y, .

:

x = (0:0.1:10);
a = gaussmf(x, [2 4]);
b = gaussmf(x, [1.8 6]);
y = probor([a; b]);
plot (x,[a; b; y])
legend ('a', 'b', 'y=a OR b')
title ('Probabilistic OR')

===================================================================

Ȕ [2 4] [1.8 6].

\ \

PSIGMF

:

y = psigmf (x, params)

:

psigmf :

psigmf . psigmf :

  1. x - , ;
  2. params - . - [a1 c1 a2 c2]

psigmf y, x.

.

x = 0: 0.1: 10;

y1 = psigmf (x, [2 1 -1 7]);

y2 = psigmf (x, [2 2 -4 7]);

y3 = psigmf (x, [2 3 -8 7]);

plot (x, [y1; y2; y3])

title (' psigmf, a=2, d=7')

ylim ([0 1.05])

legend ('b=1, c=-1', 'b=2, c=-4', 'b=3, c=-8')

===================================================================

[2 1 -1 7], [2 2 -4 7] [2 3 -8 7].

\ \

READFIS

:

fis = readfis(fisfile)

:

fisfile.fis. readfis fis.

readfis .

:

a=readfis(tipper)

Tipper.

\ \

RMMF

:

fis = rmmf (fis, varType, varIndex, mf, mfIndex)

:

. rmmf 5 :

  1. fis ;
  2. varType . : input' ; output' ;
  3. varIndex . ;
  4. mf- ;
  5. mfIndex , varIndex.

, , .

:

a=readfis(tipper);
b=rmmf(a, input, 1, mf, 3)

excellent -, service Tipper.





:


: 2015-11-23; !; : 557 |


:

:

- , .
==> ...

1669 - | 1491 -


© 2015-2024 lektsii.org - -

: 0.107 .