- Xin , ;
- Xout , ;
- radii , . radii [0, 1] , subclust . radii , ;
- 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, .
\ \
| ANFIS- |
:
mf_param = genparam(data, mf_n, mf_type)
:
genparam , .
genparam , :
- data . . , ;
- mf_n , , . , . 2;
- 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 (fis)
gensurf (fis, inputs, output)
gensurf (fis, inputs, output, grids)
gensurf (fis, inputs, output, grids, refinput)
[x y z] = gensurf()
:
"-", . gensurf :
- fis - ;
- inputs - , , . - [1 2]. , "-";
- output - , . ;
- grids - , . , . 15;
- refinput - , , . . . , , , NaN. refinput . refinput .
gensurf x, y, z, (x) (y), (z) .
|
|
:
a=readfis('tipper')
gensurf(a)
" - " "Tipper", .
\ \
|
:
out = getfis (fis)
out = getfis (fis, fisprop)
out = getfis (fis, vartype, varindex, varprop)
out = getfis (fis, vartype, varindex, 'mf', mfindex, mfprop)
:
. getfis , , :
- fis - ;
- 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' - ( ); - vartype - . : 'input' - ; 'output' - ;
- varindex - ;
- varprop - .
:
'Name' - ;
'Range' - ;
'NumMfs' - ;
'MfLabels' - , ; - mfindex - ;
- mfprop - .
:
'Name' - ();
'Type' - ;
'Params' - .
.
:
a=readfis('tipper')
out=getfis(a)
"Tipper".
\ \
|
:
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 . " - " .
\ \
|
:
outParams = mf2mf(inParams, inType, outType)
:
mf2mf . mf2mf :
- inParams - ;
- inType - ;
- 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))
. .
\ \
|
:
fis = newfis(fis_name, fis_type, andMethod, orMethod, impMethod, aggMethod, defuzzMethod)
:
. newfis :
- fis_name - ;
- fis_type - . :'mamdani' - ( );'Sugeno' - ;
- andMethod - . : ('min') - ; ('prod') - ;
- orMethod - . : ('max') - ; ('probor') - ;
- impMethod - . - 'min' - ;
- aggMethod - . - 'max' - ;
- defuzzMethod - . : ('centroid') - ; (''wtaver) - .
:
a=newfis('new_fuzzy_system')
a, 'new_fuzzy_system'. .
|
|
\ \
|
:
outfis = parsrule (infis, inrulelist, ruleformat, lang)
[outfis, outrulelist, errorstr] = parsrule (infis, inrulelist, ruleformat, lang)
:
parsrule . . parsrule , :
- infis - ;
- inrulelist - " - ". , , . Rule Editor. :
- - "if", "and", "or", "then", "is", "not";
- - "si", "et", "ou", "alors", "est ","n''est_pas";
- - "senn", "und", "oder", "dann", "ist", "nicht",
"", "", "", "", "", "", . . 1. , ; - ruleformat - . :
'verbose' - ;
'symbolic' - ;
'indexed' - .
- 'verbose'. 7.3. 'verbose' 'none'. "" ; - lang - 'verbose'. :
'english' - ;
'francais' - ;
'deutsch' - .
.
parsrule :
- outfis - ;
- outrulelist - outfis. , , inrulelist. char. outfis . '#' , .
- 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'".
\ \
| - |
:
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 :
- x , ;
- 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 (fis)
:
plotfis fis. , , . , . .
:
a=readfis(tipper);
plotfis(a)
Tipper.
\ \
|
:
plotmf (fis, varType, varIndex, numPts)
[x, y] = plotmf (fis, varType, varIndex, numPts)
:
plotmf . plotmf 3 4 :
- fis ;
- varType . : input' ; output' ;
- varIndex . .
- numPts , . 181.
plotmf :
- x - ;
- y - , x.
plotmf .
:
a=readfis(tipper);
plotmf(a, 'input', 1)
\ \
|
:
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].
\ \
|
:
y = psigmf (x, params)
:
psigmf :
psigmf . psigmf :
- x - , ;
- 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].
\ \
|
:
fis = readfis(fisfile)
:
fisfile.fis. readfis fis.
readfis .
:
a=readfis(tipper)
Tipper.
\ \
|
:
fis = rmmf (fis, varType, varIndex, mf, mfIndex)
:
. rmmf 5 :
- fis ;
- varType . : input' ; output' ;
- varIndex . ;
- mf- ;
- mfIndex , varIndex.
, , .
:
a=readfis(tipper);
b=rmmf(a, input, 1, mf, 3)
excellent -, service Tipper.