My data consist of 16channelsx128samplesx400trials. I wanna perform exhaustive channel selection in this dataset. Where should I apply PCA?
unsortedChannelIndices = [1:16]
sortedChannelIndices = [];
%Option 1
reducedData = PCA(data, classIndeces)
for chIdx = 1:length(unsortedChannelIndices)
for c=1:length(unsortedChannelIndices)
thisChannel = unsortedChannelIndices(c)
thisChannelSet = [sortedChannelIndices, thisChannel];
%Option 1
thisData = reducedData(thisChannelSet,:,:);
%Option 2
thisData = PCA(data(thisChannelSet, classIndeces)
thisPerformance(c) = eval_perf(thisData);%crossvalidation
end
[performance(chIdx),best] = max(thisPerformance);
sortedChannelIndices = [sortedChannelIndices,unsortedChannelIndices(best)];
unsortedChannelIndices(best) = [];
end