EthoML / VAME

Variational Animal Motion Embedding - A tool for time series embedding and clustering
https://ethoml.github.io/VAME/
GNU General Public License v3.0
2 stars 0 forks source link

Community analysis breaking for cohort=False and show_umap=True #38

Closed vinicvaz closed 1 week ago

vinicvaz commented 2 weeks ago

community function is breaking with cohort=False and show_umap=True.

Error track:

-> [481] plt.scatter(embed[:,0], embed[:,1],  c=community_labels_all[0, :num_points], cmap='Spectral', s=2, alpha=1)
    [482] plt.colorbar(boundaries=np.arange(np.max(num)+2)-0.5).set_ticks(np.arange(np.max(num)+1))
    [483] plt.gca().set_aspect('equal', 'datalim')

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

The community_labels_all array is of shape (X,) so the slice is wrong. I think we can fix it by removing the first index of the slice

plt.scatter(embed[:,0], embed[:,1],  c=community_labels_all[:num_points], cmap='Spectral', s=2, alpha=1)

I added fix for this case to the PR https://github.com/EthoML/VAME/pull/33 but we still have to fix the cohort=True, show_umap=True case referenced on https://github.com/EthoML/VAME/issues/32