oist-ncbc / spykesim

Extended edit similarity measurement for high dimensional discrete-time series signal (e.g., multi-unit spike-train).
https://pypi.org/project/spykesim
MIT License
20 stars 3 forks source link

Dimension mismatch between `mat` in `gen_profile` #15

Closed tuanpham96 closed 4 years ago

tuanpham96 commented 5 years ago

I have occasionally ran into problems when I used certain min_cluster_size during clustering, and that affected gen_profile step. Apparently there was some dimension mismatch between the matrices when gen_profile is being run in this line: https://github.com/KeitaW/spykesim/blob/a18ddc4680f893b20d4c2c214228e5912649d646/spykesim/editsim.pyx#L204

I believe it has to do with how mats are produced below, which does not take into account the sliding width, or assumes that slide=window https://github.com/KeitaW/spykesim/blob/a18ddc4680f893b20d4c2c214228e5912649d646/spykesim/editsim.pyx#L193

Is that a bug? If so, can it be fixed with something like this:

for idx in indices:
      mat = self.binarray_csc[:, self.times[idx]:(self.times[idx]+self.window)].toarray()
KeitaW commented 5 years ago

Hmm... Actually, I think the current version of code is correct because slide is only matters when you calculate the similarity matrix. Could you provide a detailed example that causes an error? I have encountered a problem when min_cluster_size is too large because HDBSCAN failed to detect any cluster.

KeitaW commented 4 years ago

Close it in the meantime. Feel free to reopen it if you still have the problem :)