1

I have 7 classes of inputs that are related to the brain signals activity (EEG). When the number of classes is large, the performance of classification algorithms may be affected. As you can see in the following code, I extracted the features for them and in the first phase I trained my model with 70% of the my data and got 100% accuracy but in the testing phase with the remaining 30% I did not get more than 42.5% accuracy. What is your suggestion to improve the accuracy of my Model?

for i=1:7
    [A D]=dwt2(segment_train(i).train,'db1');
    wave_train(i).A=A;
    wave_train(i).D=D;
    f1=mean(A);
    f2=median(A);
    f3=max(D);
    f4=abs(fft(D));
    f4=mean(f4);
    f5=var(D);
    f6=skewness(D);
    f7=entropy(D);
    f8=var(A);
    f9=mean(D);
    f(i,:)=[f1 f2  f3 f4 f5 f6 f7 f8 f9];
end

% feature extraction
% Classifier
nOfSamples=7;
nOfClassInstance=10;
Sample=f;
class=[1 2 3 4 5 6 7]'
%SVM 
Model=fitcecoc(Sample,class);
predictt=predict(Model,Sample);
disp('class predict')
disp([class predictt])

%Accuracy
Accuracy=mean(class==predictt)*100;
fprintf('\nAccuracy =%d\n',Accuracy)

1 Answers1

0

The question is a tad broad. However, it's a good idea to explore the distribution of the class labels.

Perhaps the distribution of the classes are skewed? It may be the case that some classes show up a lot more than others. There are various ways to counteract this, such as up/down sampling, weighting the error of under-sampled classes with a larger factor, etc. It would be a good idea to explore this further online.

That being said, it certainly sounds like you're overfitting the model. You may also want to explore regularisation to combat the low test score.

RikkiH
  • 107
  • 5