10 fold cross validation

조회 수: 12 (최근 30일)
uma
uma 2022년 4월 13일
답변: uma 2022년 6월 16일
how to use 10 fold cross validation in Multilayer extreme learning machine

채택된 답변

Demet
Demet 2022년 4월 19일
편집: Demet 2022년 4월 19일
Hello,
I have never used Multilayer extreme learning machine but i found this. The code below was written assuming that the code in this link is correct and It would be helpful for you
data= dlmread('data\\inputs1.txt'); %inputs
groups=dlmread('data\\targets1.txt'); % target
Fold=10;
indices = crossvalind('Kfold',length(groups),Fold);
for i =1:Fold
testy = (indices == i);
trainy = (~testy);
TestInputData=data(testy,:)';
TrainInputData=data(trainy,:)';
TestOutputData=groups(testy,:)';
TrainOutputData=groups(trainy,:)';
number_neurons=[1000 100 100 100];% acchetecture of network
NL=4;
ELM_Type=1;
[training_Acuracy]=MLP_elm_train(TrainInputData,TrainOutputData,number_neurons,ELM_Type,NL);%training
training_Acuracy_f(fold)=training_Acuracy; %keep training acc for each fold
[testing_Accuracy,output]=MLP_elm_predict(TestInputData, TestOutputData,ELM_Type,NL);%testing
testing_Accuracy_f(Fold)=testing_Accuracy;% keep testing acc for each fold
end
  댓글 수: 1
uma
uma 2022년 6월 15일
thank you so much.

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

추가 답변 (1개)

uma
uma 2022년 6월 16일
how we can specify the input and target data as i have a dataset namely segment attached here.

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by