deepof.post_hoc.recluster

deepof.post_hoc.recluster(coordinates: deepof_coordinates, embeddings: deepof_table_dict, soft_counts: deepof_table_dict | None = None, min_confidence: float = 0.75, states: str | int = 'aic', pretrained: bool | str = False, min_states: int = 2, max_states: int = 25, save: bool = True)

Recluster the data using a HMM-based approach. If soft_counts is provided, the model will use the soft cluster assignments as priors for a semi-supervised HMM.

Parameters:
  • coordinates – deepOF project where the data is stored.

  • embeddings (table_dict) – table dict with neural embeddings per animal experiment across time.

  • soft_counts (table_dict) – table dict with soft cluster assignments per animal experiment across time.

  • min_confidence (float) – minimum confidence the model should assign to a data point for the model to avoid resorting to a uniform prior around it.

  • states – Number of states to use for the HMM. If “aic” or “bic”, the number of states is chosen by minimizing the AIC or BIC criteria (respectively) over a predefined range of states.

  • pretrained – Whether to use a pretrained model or not. If True, DeepOF will search for an existing file with the provided parameters. If a string, DeepOF will search for a file with the provided name.

  • min_states – Minimum number of states to use for the HMM if automatic search is enabled.

  • max_states – Maximum number of states to use for the HMM if automatic search is enabled.

  • save – Whether to save the trained model or not.

Returns:

table dict with soft cluster assignments per animal experiment across time, using the new HMM-based segmentation on the embedding space.

Return type:

soft_counts (table_dict)