Coherence Mixture Model
Project description
Coherence Mixture Model
or for now k-Means Clustering with coherence as distance metric
Unsupervised clustering algoirthm which clusters timeseries based on coherence.
Coherence between two signals is defined as:
\mathcal{C}(\mathbf{\hat{x}}(\omega), \mathbf{\hat{\mu}}(\omega)) = \frac{|S_{x,\mu}(\omega)|^2}{S_{xx}(\omega)\cdot S_{\mu, \mu}(\omega)}
xnt: data
k: number of clusters
fs: sampling frequency
nperseg: number of timepoints in each trial (to compute FFT over and average)
itemax: max number of iterations to optimize
from cmm import CMM
cm = CMM(
xnt,
k=k,
fs=fs,
nperseg=nperseg,
)
cm.optimize(itemax=itemax)
print(cm.labels)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cmm-0.1.tar.gz
(4.4 kB
view details)
File details
Details for the file cmm-0.1.tar.gz.
File metadata
- Download URL: cmm-0.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4fd65d5ebebb9cedf47faf21715e46b2d563ae65a046748a7404e0c164d932c
|
|
| MD5 |
fb20ec04f737db55d34395652ccedd38
|
|
| BLAKE2b-256 |
8a415fc2ea3dff512ae8ce143cf06e97179af1f5f1e113ab067cb1b742925da9
|