crested.pl.patterns.similarity_heatmap

crested.pl.patterns.similarity_heatmap#

crested.pl.patterns.similarity_heatmap(similarity_matrix, indices, fig_size=(30, 15), fig_path=None)#

Plot a similarity heatmap of all pattern indices.

Parameters:
  • similarity_matrix (ndarray) – A 2D numpy array containing the similarity values.

  • indices (list) – List of pattern indices.

  • fig_size (tuple[int, int] (default: (30, 15))) – Size of the figure for the heatmap.

  • fig_path (Optional[str] (default: None)) – Path to save the figure. If None, the figure will be shown but not saved.

Return type:

None

Examples

>>> sim_matrix, indices = crested.tl.modisco.calculate_similarity_matrix(
...     all_patterns
... )
>>> crested.pl.patterns.similarity_heatmap(sim_matrix, indices, fig_size=(42, 17))
../../../_images/pattern_similarity_heatmap.png