I am analysing some neural data, and want to use Kmeans to cluster the true spikes of the neuron, and the noise into two separate clusters. I have here a test array of the candidate data I want to give K means.
But, when I apply Kmeans, it seems to not run through it. It is not throwing any specific error, but does give this warning: Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.
I have am M1 Macbook Pro (which I have read leads to this warning being thrown sometimes…), but other than this I’m not sure specifically what is wrong, I would appreciate some help and advice! Thanks in advance, here is a test code, and a link to the pickle test array
import pickle
from sklearn.cluster import KMeans
fileName = ‘test_array.pickle’
with open(fileName, ‘rb’) as file:
output = pickle.load(file)
print('Open file works ')
kmeans = KMeans(n_clusters = 2, init = 'k-means++',n_init = 1).fit(output.reshape(-1,1)) # two classes: 1) spikes 2) noise
print('K means works')
https://drive.google.com/file/d/19USY6Sl07Cw4zU0qIUvdOjQIq748OIHf/view?usp=sharing
Adding error statements e.g. value, memory errors
ciara gibbs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.