0
votes

I am working on my research question and I want to do an (un)supervised clustering to cluster different balance tasks based on EEG data to see if these tasks are sensitive enough to measure static, dynamic balance or gait (so I would hypothesize that data will be clustered in three clusters with in one cluster the more static balance tasks and, the second cluster more dynamic balance tasks and third the gait tasks). There are 9 balance tasks. Output from EEG data are Independent Components (max 32 components) and I think I need to use the maximum frequency and the peak power of the signal of these components as variables. So my data will look like this:

Subj Task IC Freqmax Powermax
1     1    1    12      26                      
1     1    2    14      14               
1     1    3    8       19                  
1     2    1    11      10                  
1     2    2    16      22            
1     2    3    9       15          
1     3    1    5       16        
1     3    2    10      22 
2     1    1    12      11                                              
2     1    2    11      19             
2     1    3    15      26                
2     2    1    8       11                   
2     2    2    9       15         
2     2    3    12      20          
2     3    1    5       24                 
2     3    2    14      19
3     1    1    9       14                    
3     1    2    12      12                      
3     1    3    12      22                             
3     2    1    10      18                                 

I have several questions:

Can I train a model based on this data to cluster the different tasks? How would my graph look like? x-axis = freqmax, y-axis = powermax and each dot would be a different participant? But how would the different components play a role? The model should consider all components per 1 task and not individually, how would I tell the machine that? Supervised clustering or not? ... probably many more questions

Also any feedback on the research question and suggestions are more than welcome!

Thank you so much for brainstorming with me!!

2

2 Answers

0
votes

A while ago I found this and it got me really started into understanding clustering and unsupervised techniques, the pages (and the library) are great:

https://scikit-learn.org/stable/modules/clustering.html#

0
votes

If you are looking for clustering algorithms, you can use neulab (https://github.com/kndahl/neulab).

Example:

import pandas as pd
from neulab.Clustering import CGraph
d = {'Age': [18, 33, 42, 24, 19, 25], 'Sex': [0, 1, 1, 0, 2, 2]}
df = pd.DataFrame(data=d, index=['A', 'B', 'C', 'D', 'E', 'F'])

clusters = CGraph(df, metric='manhattan', r='std', rnd=3, draw=False, info=True)

Output:
Distances: {'A|B': 1.125, 'A|C': 1.5, 'A|D': 0.25, 'A|E': 1.042, 'A|F': 1.292, 'B|C': 0.375, 'B|D': 0.875, 'B|E': 1.083, 'B|F': 0.833, 'C|B': 0.375, 'C|D': 1.25, 'C|E': 1.458, 'C|F': 1.208, 'D|B': 0.875, 'D|C': 1.25, 'D|E': 1.208, 'D|F': 1.042, 'E|B': 1.083, 'E|C': 1.458, 'E|D': 1.208, 'E|F': 0.25}
R = 0.388
Found clusters: [['D', 'A'], ['C', 'B'], ['E', 'F']]

More info: https://github.com/kndahl/neulab/blob/master/docs/README_cluster.md