Plotter

class aixd.visualisation.Plotter(dataset: Dataset = None, datamodule: DataModule = None, model: CondAEModel = None, output: str = None, output_dir: str = None)[source]

Bases: object

Main class providing various pre-configured plots for analysis of the dataset and of the model’s performance.

Parameters:
  • dataset (Dataset, optional, default=None) – A Dataset object.

  • datamodule (DataModule, optional, default=None) – A DataModule object.

  • model (CondAEModel or CondVAEModel, optional, default=None) – A trained machine learning model. Needed only for plots that evaluate the trained model.

  • output (str, optional, default=None) – Select the type of the output for all plot methods. Default is None, and there are the following available options:

    • ‘show’ : opens the interactive plotly figure

    • ‘image’ : saves a static image in *.png format

    • ‘svg’ : saves a static image in *.svg format

    • ‘png’ : saves a static image in *.png format

    • ‘jpg’ : saves a static image in *.jpg format

    • ‘html’ : saves an interactive figure as *.html file

    • ‘txt’ : saves a static bitmap image as a string to *.txt file

    • ‘json’ : save json file that can be opened again by plotly [Not implemented]

    • ‘wandb’ : submits figure to associated Weight&Biases account [Not implemented]

    • ‘’ or None : plot methods return the plotly.graph_objects.Figure object without outputting it anywhere

  • output_dir (str, optional, default=None) – If the selected output saves a file (i.e, ), specify the target location for this file here.

Methods

attributes_obs_vs_pred

Plots the observed (true) vs predicted values for all the selected attributes (= DataObject's) in the given data block of the datamodule.

available_block_names

Returns a list of the names of all available data blocks.

contours2d

Plots the 2D contours of all the selected attributes (= DataObject's) in the given data block.

correlation

Plots the correlation between all the selected attributes (= DataObject's) in the given data blocks.

distrib_attributes

Plots the distribution of all the selected attributes (= DataObject's) in the given data block.

distrib_attributes2d

Plots the 2D joint distribution of all the selected attributes (= DataObject's) in the given data blocks.

evaluate_generation

Compact plot for evaluating the generation capabilities of the (V)AE model, in which there is a subplot for each selected attribute with the following traces:

evaluate_training

Compact plot for evaluating the training of the (V)AE model, in which there is a subplot for each selected attribute with the following traces:

generation_scatter

Plots the 2D contours of all the selected attributes (= DataObject's) in the given data block.

kde_distribution_attributes

Plots the probability density distribution or/and the cumulative density distribution of all the selected attributes (= DataObject's) in the given data block using kernel density estimation.

performance_summary

Plots the performance summary for all the selected attributes (= DataObject's) in the given data block of the datamodule.