How Can i train pattern recognition/Feedforward Neural net on my own dataset

조회 수: 1 (최근 30일)
Med Future
Med Future 2022년 3월 8일
댓글: Med Future 2022년 3월 10일
Hello everyone , i hope you are doing well
I have the following dataset, i want to train a pattern recognition network.
I have the dataset which contains 3 classes and dataset shape is 1000x3000 and also label shape is 3x3000
I want to classify pattern of numeric numbers each column has belong to specific class.
Please can anybody help me

답변 (1개)

yanqi liu
yanqi liu 2022년 3월 9일
yes,sir,may be use nnet can get simple process,such as
warning off all
load FInalDataset.mat
[~,Y] = max(labels);
X = dataset;
% make data shuffle
rand('seed', 0)
ind = randperm(size(X, 2));
X = X(:,ind);
Y = Y(ind);
% Split Data
rate = 0.5;
ind_split = round(length(Y)*rate);
train_X = X(:,1:ind_split);
train_Y = Y(1:ind_split);
test_X = X(:,ind_split+1:end);
test_Y = Y(ind_split+1:end);
% init process
[pn,minp,maxp,tn,mint,maxt] = premnmx(train_X, train_Y);
% set net parameters
NodeNum1 = 40;
NodeNum2 = 20;
TypeNum = 1;
TF1 = 'tansig';
TF2 = 'tansig';
TF3 = 'tansig';
bp_net = newff(minmax(pn), [NodeNum1,NodeNum2,TypeNum], {TF1 TF2 TF3}, 'traingdx');
bp_net.trainParam.show = 50;
bp_net.trainParam.epochs = 10000;
bp_net.trainParam.goal = 1e-4;
bp_net.trainParam.lr = 0.05;
% train net
bp_net = train(bp_net, pn,tn);
% test net
p2n = tramnmx(test_X,minp, maxp);
y2n = sim(bp_net, p2n);
y2n = postmnmx(y2n,mint,maxt);
T = [test_Y; round(y2n)];
acc = (sum(T(1, :)-T(2, :) == 0)/numel(T(1, :)))*100;
fprintf('\nacc rate is %.2f%%\n', acc);
acc rate is 76.27%
  댓글 수: 4
Med Future
Med Future 2022년 3월 10일
@yanqi liu i have tried to make more hidden layers but model overfit.
Can you please do an experiment to increase accruacy?

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

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by