我的数据包含16channelsx128samplesx400trials。我想在这个数据集中执行详尽的频道选择。我应该在哪里申请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
答案 0 :(得分:0)
PCA或任何降维技术应该与将要分析的数据一起应用。如果我们评估对应于较少通道(例如1:4)的子集的性能,则应在该数据中应用任何降维技术(PCA(数据([1:4),:,:)。因此,选项2是正确的选择。