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
7 stars 0 forks source link

Cannot generate community videos for cohort == True #84

Open luiztauffer opened 3 days ago

luiztauffer commented 3 days ago

vame.community_videos cannot generate community videos for cohort == True. It only generates videos for communities that were calculated individually, per each session (cohort == False).

This is partially because of how the community labels are saved by vame.community, depending whether cohort is true or false.

If cohort is True:

- project_name/
    - results/
        - community_cohort/
            - parametrization-n_cluster/
                - cohort_community_bag.npy
                - cohort_community_label.npy
                - cohort_parametrization_label.npy
                - cohort_transition_matrix.npy
                - hierarchy.pkl

If cohort is False:

- project_name/
    - results/
        - file_name/
            - model_name/
                - parametrization-n_cluster/
                    - community/
                        - transition_matrix_file_name.npy
                        - community_label_file_name.npy
                        - hierarchy_file_name.pkl

The cohort-level labels of communities are being calculated, but saved in the file results/communit_cohort/.../cohort_community_label.npy, where the labels for all videos are concatenated together. Should we adapt vame.community to save the cohort-level labels of communities for each individual session as well? E.g. under

- project_name/
    - results/
        - file_name/
            - model_name/
                - parametrization-n_cluster/
                    - community/
                        - cohort_community_label_file_name.npy

The function vame.community_videos (in fact, the get_cluster_vid function) always searches in that sessions-level path to generate the community videos.

@katiekly @DrSRMiller your thoughts?

luiztauffer commented 2 days ago

This will also be a source of error for vame.visualization(label="community"), if vame.community(cohort=True)