I have data 200x90. (rowsx columns)
My input has 200x88 and my target has 200x2 .
My data number (200 ) is less according to 88 features to get good accuracy on my neural network.
It should be more data to get good accuracy but I can't increase my data .
So I want to use PCA to reduce 88 features.
I loaded data200 and shared codes .
When I apply pca I got that error:
% Error using network/train (line 340)
% Inputs and targets have different numbers of samples.
% Error in deneme (line 50)
% [net,tr] = train(net,x,t);
Because it decreases my rows also. I want to keep my rows number (200) and just decrease column numbers.
I couldn't manage how to apply PCA in proper way.
trainFcn = 'trainscg';
hiddenLayerSize = ;
net = patternnet(hiddenLayerSize, trainFcn);
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
[net,tr] = train(net,x,t);
y = net(x);
e = gsubtract(t,y);
performance = perform(net,t,y)
tind = vec2ind(t);
yind = vec2ind(y);
percentErrors = sum(tind ~= yind)/numel(tind);