Why does the ANFIS output range vary significantly despite perfect training accuracy?

1 view (last 30 days)
In mamdani output range is defined by user. and in sugeno it is 0 to 1 only. In my training data output ranges between 4 to 15. but ANFIS output ranges between -40 to 30 for one input and for second input output ranges between -400 to 200. why there is so much difference????

Answers (1)

Sam Chak
Sam Chak on 18 Apr 2025
To explain this phenomenon, consider the following example of a training data set with two inputs and one output. Experiments have been conducted repeatedly to confirm that both input and output data values range from to 1. The training data is then used to train an ANFIS prediction model, which successfully predicts the output values from the training data with 100% accuracy.
However, when different combinations of input values within the input range are used, the ANFIS predicted output values range from to 3, which is significantly different from the output range in the training data set.
The reason for this discrepancy is that the training data (represented by red dots) is insufficient for the ANFIS algorithm to capture the underlying patterns. This issue is known as underfitting, as the trained ANFIS prediction model is too simplistic. The true output model is provided at the end.
%% Training Data
xInput1 = linspace(-1, 1, 11); % Input 1 data, min value is -1 & max value is 1
xInput2 = linspace( 1, -1, 11); % Input 2 data, min value is -1 & max value is 1
yOutput = xInput1; % Output data, min value is -1 & max value is 1
%% mock-up of ANFIS prediction model
yAnfis = @(x, y) - 1*x - 2*y;
%% check prediction accuracy on the Training Data
predErr = rmse(yOutput, yAnfis(xInput1, xInput2))
predErr = 0
%% generate ANFIS output surface data
[X1, X2]= meshgrid(xInput1);
Y_anfis = yAnfis(X1, X2); % generate surface data from ANFIS model
%% plot ANFIS output surface
figure
hold on
surf(X1, X2, Y_anfis, 'FaceAlpha', 0.5)
plot3(xInput1, xInput2, yOutput, 'r.', 'MarkerSize', 25)
hold off, grid on
view(-37.5+180, 30)
xlabel('x_{1}'), ylabel('x_{2}'), zlabel('y')
title('ANFIS output surface')
%% True output model
Y_true = sin((- X1 - 2*X2)./(- 0.0347*sqrt(X1.^2 + X2.^2).^6 - 0.06546*sqrt(X1.^2 + X2.^2) + 1.007));
figure
hold on
surf(X1, X2, Y_true, 'FaceAlpha', 0.5)
plot3(xInput1, xInput2, yOutput, 'r.', 'MarkerSize', 25)
hold off, grid on
view(-37.5+180, 30)
xlabel('x_{1}'), ylabel('x_{2}'), zlabel('y')
title('True output model')

Categories

Find more on Fuzzy Logic Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!