フィルターのクリア

training in neural network

1 回表示 (過去 30 日間)
Narges Sedre
Narges Sedre 2018 年 11 月 26 日
コメント済み: Greg Heath 2018 年 11 月 26 日
can some one tell me why my ytrain and ytest is zero?
my labels are 100, 200 and 300
iam trying to find training error and test error but it gives me zeros
clc
clear all
close all
filename='FIFA2.xlsx';
A =xlsread(filename);
[m,n]=size(A);
T=A(:,1);
data=A(:,(2:end));
rows80=int32(floor(0.8 * m));
trainingset=A(1:rows80,2:n);
testset=A(rows80+1:end,2:n);
t=trainingset(1:rows80,1);
t_test=A(rows80+1:end,1);
net= newff(trainingset',t');
y=sim(net,trainingset');
%net.trainParam.epoch=20;
net= train(net,trainingset',t');
y=sim(net,trainingset')
y_test=sim(net,testset')
p=0;
y1=hardlim(y');
% hardlims(y_test);
for(i=1:size(t,1))
if(t(i,:)==y1(i,:))
p=p+1;
end
end
ytrain =100*p/size(trainingset,1);
q=0;
y2=hardlim(y_test');
for(j=1:size(t_test,1))
if(t_test(j,:)==y2(j,:))
q=q+1;
end
end
ytest=100*q/size(t_test,1);
  1 件のコメント
Greg Heath
Greg Heath 2018 年 11 月 26 日
Need sample data for evaluation.
Greg

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by