PIA-Group / BioSPPy

Biosignal Processing in Python
Other
569 stars 273 forks source link

How to use biosppy.clustering #85

Closed alexxony closed 3 years ago

alexxony commented 3 years ago

I saw API reference, but I can not apply clustering on my data(1 dimension). Can you upload examples for understanding clustering?

afonsocraposo commented 3 years ago

Hi, you can test the k-means algorithm, for example. You could use the following code:

kmeans(np.array(data).reshape(-1,1), 3)

And the output will be: "Dictionary with the sample indices (rows from 'data') for each found cluster; outliers have key -1; clusters are assigned integer keys starting at 0."