How to adjust the parameters of membership function after the ANFIS is trained

1 次查看(过去 30 天)
I use the 'Neuro-Fuzzy Designer' (anfis) to train a dataset of 3 inputs and one output. I have positive inputs and outputs values, but the resulted training and testing outputs include some negative values. I think this is because the membership function for the input 3 ranges from -0,5 to 0.4828 as shown in figure 1. How could I make this membership function ranging from 0 to 1 in order to not consider negative values?

回答(1 个)

Sam Chak
Sam Chak 2025-4-19
If the ANFIS model has been successfully trained and the performance is satisfactory, except for the aesthetic aspect where the 'negative value' appears in the parameter of the triangular membership function (mf1), you can manually modify the parameter using the straightforward steps outlined below:
fis = mamfis('NumInputs', 3, 'NumInputMFs', 3, 'NumOutputs', 1, 'NumOutputMFs', 8);
%% original parameters of mf1
fis.Inputs(1).MembershipFunctions(1)
ans =
fismf with properties: Type: "trimf" Parameters: [-0.4167 0 0.4167] Name: "mf1"
plotmf(fis, 'input', 1), grid on
title('Before modifying parameters of mf1')
%% modified parameters of mf1
fis.Inputs(1).MembershipFunctions(1).Parameters(1) = 0;
fis.Inputs(1).MembershipFunctions(1)
ans =
fismf with properties: Type: "trimf" Parameters: [0 0 0.4167] Name: "mf1"
figure
plotmf(fis, 'input', 1), grid on
title('After modifying parameters of mf1')

类别

Help CenterFile Exchange 中查找有关 Fuzzy Logic Toolbox 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by