Machine learning(Feature extraction)

So Matlab had some training in my school ’ Classify ECG Signals Using LSTMs’
They used an ECG data comes from the PhysioNet 2017 Challenge

After training, the accuracy was low, hence they decided on feature extraction. They decided on computes time-frequency (TF) moments

  • Instantaneous frequency (instfreq)
  • Spectral entropy (pentropy)

calculateFeatures = true;

if calculateFeatures
instfreqTrain = cellfun(@(x)instfreq(x,fs)’,XTrain,‘UniformOutput’,false);
instfreqTest = cellfun(@(x)instfreq(x,fs)’,XTest,‘UniformOutput’,false);
pentropyTrain = cellfun(@(x)pentropy(x,fs)’,XTrain,‘UniformOutput’,false);
pentropyTest = cellfun(@(x)pentropy(x,fs)’,XTest,‘UniformOutput’,false);
else
load ExtractedFeatures.mat
end

XTrain2 = cellfun(@(x,y)[x;y],instfreqTrain,pentropyTrain,‘UniformOutput’,false);

XTest2 = cellfun(@(x,y)[x;y],instfreqTest,pentropyTest,‘UniformOutput’,false);

Can someone please help explain the code below and why both functions needed to be applied instead of 1

Hi. I’m not sure what you mean by “both” functions – it looks like the code calls only one function (cellfun) on training and on testing data. Classification analyses generally work by fitting a model to training data and then applying that model to test data. This helps avoid over-fitting.

You’ve provided very little information about something that appears to be very specific to a particular workshop. Perhaps it would be better to contact the people who led the workshop.

1 Like