Predicting Mortality of ICU Patients: The PhysioNet/Computing in Cardiology Challenge 2012 1.0.0

File: <base>/sources/reko.kemppainen_at_gmail.com/entry8/featureExtractionLDA.m (693 bytes)
function featureVectors = featureExtractionLDA(matrixData,weightsLDA)

% Feature extraction based on LDA
%  
% Inputs:
%
% matrixData - d*t*n tensor containing n matrices of size d*t, where n is the number of samples.
% weightsLDA - LDA direction obtained with "getLDAweights.m"
%
% Ouput:
% 
% featureVectors - n*d matrix containing n d-dimensional feature vectors
%
%
% Jukka-Pekka Kauppi
% jukka-pekka.kauppi@helsinki.fi
% University of Helsinki, Department of Computer Science
% 23.8.2012

siz = size(matrixData);
d = siz(1);
t = siz(2);
n = siz(3);

featureVectors = zeros(n,d);

for m = 1:d
  X = squeeze(matrixData(m,:,:))'; % n*t matrix
  featureVectors(:,m) = X*weightsLDA(d,:)';
end