How can I select and rank the input variables in a Neural Net created with the Neural Net Pattern Recognition app?
4 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2019 年 6 月 10 日
回答済み: MathWorks Support Team
2019 年 6 月 11 日
I am using the Neural Net Pattern Recognition App.
How can I select and rank the input variables in the Neural Net?
Not all input variables are significant and I want the Neural Net to remove non-significant variables.
採用された回答
MathWorks Support Team
2019 年 6 月 11 日
One possible way to determine feature importance in a shallow network is by looking at the input weighs just before it starts over-fitting. This is shown in the next example, where the informative features are hidden within some random vectors:
rng(0)
[x,t] = cancer_dataset;
xx = ceil(rand(50,699)*10)./10;
xx([12 16 20 23 26 40 41 44 50],:) = x;
x = xx;
trainFcn = 'trainscg'; % Scaled conjugate gradient backpropagation.
hiddenLayerSize = 10;
net = patternnet(hiddenLayerSize, trainFcn);
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
net.trainParam.epochs = 6
% Train the Network
[net,tr] = train(net,x,t);
% ranking
[~,h]=sort(sum(abs(net.IW{1}))','descend')
For this approach to work it is important that the inputs are normalised, so the input weights can represent variable importance.
Another approach would be to use one of the variable selection approaches in the Statistics and Machine Learning Toolbox
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!