deepof.post_hoc.get_aggregated_embedding

deepof.post_hoc.get_aggregated_embedding(embedding: ndarray, reduce_dim: bool = False, agg: str = 'mean')

Aggregate the embeddings of a set of videos, using the specified aggregation method.

Instead of an embedding per chunk, the function returns an embedding per experiment.

Parameters:
  • embedding (np.ndarray) – A dictionary of embeddings, where the keys are the names of the experimental conditions, and the values are the embeddings for 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.

  • agg (str) – The aggregation method to use. Can be either “mean” or “median”.

Returns:

A dataframe with the aggregated embeddings for each experiment.