Warning using " anfis " function in training of my data
3 views (last 30 days)
Show older comments
I want to train an ANFIS structure. I have 8 inputs and one corrosponding output. When I train these data with "anfis" function, I will get the following error :
Warning: Generated rule base is large. MATLAB may run out of memory if this FIS is tuned using ANFIS.
> In genfis1 (line 161)
In genfis (line 61)
In ANFIS (line 39)
ANFIS info:
Number of nodes: 555
Number of linear parameters: 2304
Number of nonlinear parameters: 48
Total number of parameters: 2352
Number of training data pairs: 501
Number of checking data pairs: 0
Number of fuzzy rules: 256
Warning: Number of training data is smaller than number of modifiable parameters.
> In anfis>trainFIS (line 190)
In anfis>anfisWithOptionalInputs (line 326)
In anfis (line 69)
In ANFIS (line 40)
Start training ANFIS ...
And the result will go to infinity. Note that I do not want to scale my data and I need the corrosponding output which is a vector, the values of which should be between zero and one. What should I do to solve this problem ?
the following is my ANFIS code :
clc;clear;close all;
%% 1. Load Data
Data = load('data_0_to_50_smooth');
t = Data.t;
u1 = Data.u1; % Vaccination
u2 = Data.u2; % Social Distancing
u3 = Data.u3; % TreatMent Rate
states = Data.y;
states = states';
data1 = [states u1];
data2 = [states u2];
data3 = [states u3];
%% 2. Create First FiS
NumMfs = 2;
InMfsType ='trimf';
OutMfsType = 'linear';
Xin1 = data1(:,1:end-1);
Xout1 = data1(:,end);
radii = 0.2;
EpochNumber = 100;
ErrorGoal = 0.001;
StepSize =0.35;
StepSizeDecreaseRate =0.85;
StepSizeIncreaseRate = 1.15;
TrainOptions = [EpochNumber,ErrorGoal,...
StepSize,StepSizeDecreaseRate,...
StepSizeIncreaseRate];
% Fis1 = genfis1(data1,NumMfs,InMfsType,OutMfsType);
Fis1 = genfis(data1(:,1:end-1),data1(:,end));
Fis1 = anfis(data1,Fis1);
out1 = evalfis(Fis1,data(:,1:end-1),TrainOptions);
The data I used for this problem is attached.
1 Comment
Answers (0)
See Also
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!