MATLAB: KNN Classification on SSVEP response

features classificationk-nearest neighbors classificationknn

Dear all,
I am currently doing a project on SSVEP-EEG BCI and in the stage of features classification. The raw EEG signal has passing through pre-processing using bandpass filter then DWT and CCA for Features Extraction. I wonder how could I classify the extracted features using kNN for both DWT and CCA? Could someone please help me?
Thank you very much.

Best Answer

In my experience, to use knnsearch (link) with data, the idea is to begin with samples that have known classes, then compare them with the rest of your data. (I did this decades ago using EEG spectrogram data.) The knnsearch algorithm will then discover the closest matches to the known data and use that as the basis of its classification.
I would simply create a matrix of the vectors of the features you want to match, and use that. Of course, the relevant features must be in the same locations in each vector, and the vectors must have the same lengths. I am not certain whether you want to classify the DWT and CCA results separately. You could do that, with separate knnsearch runs, or you could concatenate the DWT and CCA results in each vector and submit those to knnsearch.
I have never done what you are doing, so I have no experience with the techniques you are using.
Related Question