epysurv.visualization package

Submodules

epysurv.visualization.model_diagnostics module

epysurv.visualization.model_diagnostics.ghozzi_score_plot(prediction_result: pandas.core.frame.DataFrame, filename: str)[source]

Plots case counts and detector predictions with ghozzi weighting.

Parameters
  • prediction_result – DataFrame containing ‘alarm’, ‘county’, ‘pathogen’, ‘n_cases’, ‘n_outbreak_cases’, ‘outbreak’.

  • filename – File name to write the plot to.

epysurv.visualization.model_diagnostics.plot_confusion_matrix(confusion_matrix: numpy.ndarray, class_names: list, ax: matplotlib.axes._axes.Axes = None) → matplotlib.axes._axes.Axes[source]

Plots a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap.

Based on https://gist.github.com/shaypal5/94c53d765083101efc0240d776a23823

Parameters
  • confusion_matrix – The numpy.ndarray object returned from a call to sklearn.metrics.confusion_matrix. Similarly constructed ndarrays can also be used.

  • class_names – An ordered list of class names, in the order they index the given confusion matrix.

  • figsize – A 2-long tuple, the first value determining the horizontal size of the ouputted figure, the second determining the vertical size. Defaults to (10,7).

Returns

The resulting confusion matrix figure

epysurv.visualization.model_diagnostics.plot_prediction(train_data, test_data, prediction, ax: matplotlib.axes._axes.Axes = None) → matplotlib.axes._axes.Axes[source]

Plots case counts as step line, with outbreaks and alarms indicated by triangles.

Module contents

Module for visualizing epidemiological data and performance of outbreak detection models.