deepof.post_hoc.get_time_on_cluster
- deepof.post_hoc.get_time_on_cluster(soft_counts: deepof_table_dict, normalize: bool = True, reduce_dim: bool = False, bin_info: dict | ndarray | None = None, roi_number: int | None = None, animals_in_roi: list | None = None)
Compute how much each animal spends on each cluster.
Requires a set of cluster assignments.
- Parameters:
soft_counts (TableDict) – A dictionary of soft counts, where the keys are the names of the experimental conditions, and the values are the soft counts for each condition.
normalize (bool) – Whether to normalize the time by the total number of frames in each condition.
reduce_dim (bool) – Whether to reduce the dimensionality of the embeddings to 2D. If False, the embeddings are kept in their original dimensionality.
bin_info (Union[dict,np.ndarray]) – A dictionary or single array containing start and end positions of all sections for given embeddings and ROIs
roi_number (int) – Number of the ROI that should be used for the plot (all behavior that occurs outside of the ROI gets excluded)
animals_in_roi (list) – List of ids of the animals that need to be inside of the active ROI. All frames in which any of the given animals are not inside of the ROI get excluded
- Returns:
A dataframe with the time spent on each cluster for each experiment.