Spike-Cluster-Score
Spike Cluster Score (SCS) is a clustering performance metric designed with the purpose of spike sorting in mind. Like Purity, it will evaluate the clustering of each sample as its own cluster as a perfect clustering. SCS was developed to not punish overclustering, as overclustering is acceptable for some applications. SCS was developed as underclustering was considered unacceptable and Purity did not penalise enough the underclustering of K-Means and DBSCAN. As a result, the score of Purity was similar across all algorithms. It is the user’s responsibility to evaluate how much overclustering is acceptable for each dataset. Clustering each sample as its own cluster will receive a perfect score but will not provide information. We recommend using SCS together with other performance evaluation metrics, while taking into consideration the weaknesses of each metric.
SCS was published in Frontiers in Computational Neuroscience, alongside with a clustering algorithm.
Install:
pip install spike-cluster-score
Usage example:
import numpy as np
from sklearn.cluster import KMeans
from spike_cluster_score import spike_cluster_score
for sim_nr in [1,4,21,22,30]:
X = np.load(f"./data/sim{sim_nr}_data.npy")
y = np.load(f"./data/sim{sim_nr}_labels.npy")
nr_clusters = len(np.unique(y))
kmeans = KMeans(n_clusters=nr_clusters, random_state=0).fit(X)
print(f"{spike_cluster_score(y, kmeans.labels_):.3f}")
Citation
We would appreciate it, if you cite the paper when you use this work:
- For Plain Text:
E.-R. Ardelean, A.-M. Ichim, M. Dînşoreanu, and R. C. Mureşan, “Improved space breakdown method – A robust clustering technique for spike sorting,” Frontiers in Computational Neuroscience, vol. 17, 2023, doi: 10.3389/fncom.2023.1019637.
- BibTex:
@ARTICLE{10.3389/fncom.2023.1019637,
AUTHOR={Ardelean, Eugen-Richard and Ichim, Ana-Maria and Dînşoreanu, Mihaela and Mureşan, Raul Cristian},
TITLE={Improved space breakdown method – A robust clustering technique for spike sorting},
JOURNAL={Frontiers in Computational Neuroscience},
VOLUME={17},
YEAR={2023},
URL={https://www.frontiersin.org/articles/10.3389/fncom.2023.1019637},
DOI={10.3389/fncom.2023.1019637}
}
Metadata
Release files for spike-cluster-score 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spike_cluster_score-0.0.1.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spike_cluster_score-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / spike_cluster_score-0.0.1.tar.gz
| Download URL | spike_cluster_score-0.0.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d12e318491a23012494d84c6abe60414119ed08ef881f21783d456c79f736242
|
|
BLAKE2b-256 checksum How to use checksums |
cbc0526746a1bf4d5d3d45cc07e4d9c293ee242b0ca3e2d975a85f5f408cd995
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.9
|
Release files / spike_cluster_score-0.0.1-py3-none-any.whl
| Download URL | spike_cluster_score-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
307d02a82b929653a6731ebcb4fb16de778cdb5af92da1d2599a2cde83e21547
|
|
BLAKE2b-256 checksum How to use checksums |
9cde222edde9d40b77fe4af247a68722657f2c057590572f020757a299620ab5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.9
|