apollon.hmm.graph.grapher module

grapher.py – Plot graphs from HMMs.

apollon.hmm.graph.grapher.draw_matrix(tpm)

Draw a heatmap from a transition probability matrix.

Parameters:tpm (np.ndarray) –
Returns:(fig, ax, img)
apollon.hmm.graph.grapher.draw_network(labels, tpm, delta)

Draw the graph of a HMM’s transition probability matrix.

Params:
lables (iterable) Labels for each state. tpm (np.ndarray) A two-dimensional (row) stochastic matrix. delta (iterable)
Returns:(Figure, AxesSubplot)
apollon.hmm.graph.grapher.save_hmmfig(fig, path, **kwargs)

Save the figure to file.

This saves the figure and ensures that the out-of-axes legend is completely visible in the saved version.

All kwargs are passed on to plt.savefig.

Params:
fig (Figure) Figure of HMM tpm. path (str) Path to save file.