adaptive neuro-fuzzy inference system (ANFIS)

조회 수: 16 (최근 30일)
farheen asdf
farheen asdf 2015년 7월 13일
댓글: mekia 2020년 3월 17일
Hi. I'm trying to use ANFIS for classification of my data. I have a data set with 15 images, each of which have 22 features extracted. These images need to be classified into four classes using ANFIS. I created FIS using the command fis1 = genfis2(xin,xout,0.1). Where, xin is the matrix containing the extracted features of 15 images (size 15x22) and xout is a column matrix (size 15x1) in which each row shows the class of the respective image. Next, I have used anfisedit. My training data is size 15x23 and I have used the previously generated FIS file (fis1) loaded from workspace. It trains and tests fine and the average test error is also small. Now my questions are 1) I want to generate the FIS file and classify it using commands instead of GUI. How do I do that? I have generated a Matlab script from anfisedit but it's too complicated for me. 2) How does anfisedit classify these images? In the plot window I see circles representing all the inputs I have used. However, many of these inputs belong to the same class and I don't see any representation of any of the classes. I just need 4 classes while in the plot window i see 15 circles. 3) Once I have trained anfis how do I use it to find the class of an unknown image? After all that is the reason I'm doing all of this 4) Lastly I want to plot confusion matrix to see the percentage accuracy of the system. How should I do that?
Thank you in advance. Have a nice day
  댓글 수: 1
Braiki Marwa
Braiki Marwa 2019년 5월 9일
I have the same problem, tell me please if you find the solution
Thanks

댓글을 달려면 로그인하십시오.

답변 (1개)

Yarpiz / Mostapha Heris
Yarpiz / Mostapha Heris 2015년 9월 12일
Maybe this can help you:
It uses several methods of FIS generation methods (genfis1, genfis2 and genfis3), and uses anfis function, to train the ANFIS structure, programmatically. It is used to solve a nonlinear regression problem; however the classification problem is quite similar to this one, and you can easily modify this code, to achieve your goal.
  댓글 수: 1
mekia
mekia 2020년 3월 17일
please debug this code. am try to split pima diabetes dataset with total of 768 into 538 instance for training set,115 for validation set and the rest 115 for test set but the below code cant split like that please help me i don no what is my mistake?
function data=LoadData()
data=load('pima diabetes_dataset');
Inputs=data.Inputs';
Targets=data.Targets';
Targets=Targets(:,1);
nSample=size(Inputs,1);
% Shuffle Data
S=randperm(nSample);
Inputs=Inputs(S,:);
Targets=Targets(S,:);
% Train Data
pTrain=0.7;
nTrain=round(pTrain*nSample);
TrainInputs=Inputs(1:nTrain,:);
TrainTargets=Targets(1:nTrain,:);
% Validation Data
pvalid=0.15;
nvalid=round(pvalid*nSample);
ValInputs=Inputs(nvTrain+1:nvalid,:);
ValTargets=Targets(nTrain+1:nvalid,:);
% Test Data
TestInputs=Inputs(nvalid+1:end,:);
TestTargets=Targets(nvalid+1:end,:);
% Export
data.TrainInputs=TrainInputs;
data.TrainTargets=TrainTargets;
data.ValInputs=ValInputs;
data.ValTargets=ValTargets;
data.TestInputs=TestInputs;
data.TestTargets=TestTargets;
end

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by