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

1 vue (au cours des 30 derniers jours)
sarara
sarara le 28 Oct 2020
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?

Réponses (1)

Sam Chak
Sam Chak le 19 Avr 2025
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')

Catégories

En savoir plus sur Fuzzy Logic Toolbox dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by