EEG features values classification

8 views (last 30 days)
Hello. I have an exercise in which 4 features from EEG are extracted(delta, theta ,alpha, beta). I was asked to visualize the features values belonging to each class, seizure on non seizure. And after that to compute the mean and the standard deviation of the values of each class. My 4 features is one matrix 124x4 and the labels is 1x124. My seizure length is 62. Do you know how can I start solving this exercise because I am starter in Matlab and I am not familiar with classification... Thank you..

Accepted Answer

Star Strider
Star Strider on 7 Nov 2014
I would start by separating out the ‘seizure’ data from the ‘normal’ data. Take the means and standard deviations of those for your four EEG bands, so when you’re finished, you have 8 values for the means and another 8 for the standard deviations.
After that, what you do depends on your statistics background and the classification techniques you’re supposed to use.

More Answers (3)

Georgios P
Georgios P on 10 Nov 2014
Let's say that one feature is 1x124 and according to the exercise the non-seizure area is from 1-62 and the seizure area is from 63 to 124. So I need to have 2 classes, and I found the means and the deviations from the two areas. Now I want just to visualize in a diagram the two classes and find if there is a linear separation between the classes? Is there a matlab command for this? I tried to use the command 'classify' but I am not sure if that is correct and I don't know how to do the plots to visualize the classes in 4 diagrams for each feature... If someone help me...
  1 Comment
Star Strider
Star Strider on 10 Nov 2014
I don’t know what classification options you are supposed to use, since this seems to be a homework project. There are several different classifiers, the easiest to program being the K-th Nearest Neighbour (the knnsearch function), although it’s easy to write your own simple version.
I would use the discriminant function classify for your data. (I used a linear discriminant for EEG classification about 20 years ago, but with BMDP, not MATLAB).
Another option is k-Means Clustering. I haven’t used it, but it could be appropriate for your classification problem.
One other way to visualise them is to use a boxplot function. I would plot the features side-by-side for both classes in one box plot. You have four features, so plottting them with most other functions (such as gscatter) is not going to be an option, at least in this universe.
If your data are actual, real-world data, getting a distinct, linear separation between the classes won’t be an issue, since it won’t exist.

Sign in to comment.


Georgios P
Georgios P on 10 Nov 2014
Thanx a lot for your answers! They are very useful for me to understand a lot of things.You suggest to do k-means clustering but this is in the second part of my exercise. In the first part I have to visualise the classes and after that to create boxplots for each class. The visualisation must be something like that: http://en.wikipedia.org/wiki/Statistical_classification#mediaviewer/File:Linear-svm-scatterplot.svg
Any ideas how to do that? The exercise says: Visualize the feature values belonging to each class similarly to the figure in the book. It is a similar figure as this in wikipedia.
  3 Comments
Star Strider
Star Strider on 10 Nov 2014
Edited: Star Strider on 10 Nov 2014
My pleasure!
I would use the gscatter plot for each feature. To get the separation border, I would use the steps described in the classify documentation that does something similar. (I provided a link to that in my previous comment.)
Our EEG data were, too, although not from seizure and interictal data. We used the linear discriminant to classify (train) and then determine (test) the tasks subjects were doing based the time-frequency data of EEG activation patterns. (We published it in 1995.)
Georgios P
Georgios P on 10 Nov 2014
Ok. I'll make an effort solving it and if anything goes wrong I'll ask again. Thank you..

Sign in to comment.


Georgios P
Georgios P on 22 Nov 2014
I am trying to do k means clustering but something is confusing me. I have four features and the exercise ask me to perform k means clustering considering all features. Using k means function I can find the ''idx'' for all features. But how can I plot it? Is it correct to plot features 1,2 to x-axis and feature 3,4 to y-axis? Is it correct by physical meaning?
  3 Comments
Georgios P
Georgios P on 22 Nov 2014
Edited: Georgios P on 22 Nov 2014
My problem is not how to use the matlab commands. The problem is that all the examples that I can read in documentation describing the plots of two features only, for example x1,x2(x1 at x-axis and x2 at y-axis). I have 4 features x1,x2,x3,x4. Is there a physical meaning of ploting them by pairs in the same graph(x1,x2 at x-axis x3,x4 at y-axis)?
Star Strider
Star Strider on 22 Nov 2014
You can only plot each feature against one other feature in a 2D plot to present the data in any way that is meaningful. It would be very difficult to visualise even the separation boundaries in a 3D plot without being able to rotate it in a GUI, and impossible to plot anything beyond that. That isn’t a MATLAB constraint so much as a practical constraint.

Sign in to comment.

Categories

Find more on EEG/MEG/ECoG in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!