此处使用的变量:
trainX: 1818x13 (Input Matrix with 13 features)
trainY: 1818x1 (Output Vector)
testX and testY are corresponding variables for testing the neural network.
现在,我想使用PCA减少输入功能的数量,因为我怀疑某些功能之间有一定程度的相关性。所以,我写下面的代码。
[pn,meanp,stdp] = prestd(trainX');
[ptrans,transMat] = prepca(pn,0.0002);
trainX = ptrans';
[pn,meanp,stdp] = prestd(testX');
[ptrans,transMat] = prepca(pn,0.0002);
testX = ptrans';
net = newfit(trainX', trainY', 45);
net.performFcn = 'mae';
net = trainlm(net, trainX', trainY');
forecast = sim(net, testX')';
我在申请PCA后forecast
收到大量错误。我知道我做错了什么,但我无法弄清楚是什么。