How can I select and rank the input variables in a Neural Net created with the Neural Net Pattern Recognition app?

조회 수: 4 (최근 30일)
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
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개)

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by