bacpipe.embedding_evaluation.visualization.visualize

Functions

clustering_overview(path_func, label_by, ...)

Create overview plots for clustering metrics.

generate_bar_plot(metrics, fig, ax[, ...])

iterate_through_subtasks(plot_func, ...)

For classification multiple subtasks exist (linear and knn).

load_results(path_func, task, model_list)

Load the task results into a dict and return them.

plot_clusterings(path_func, model_name, ...)

Plot the clustering metrics for a given model and label type.

plot_overview_metrics(plot_path, task_name, ...)

Visualization of task performance by model accross all classes.

plot_per_class_metrics(plot_path, task_name, ...)

Visualization of per class results.

visualise_results_across_models(plot_path, ...)

Create visualizations to compare models by specified tasks.

Classes

Figure([figsize, dpi, facecolor, edgecolor, ...])

The top level container for all the plot elements.

bacpipe.embedding_evaluation.visualization.visualize.clustering_overview(path_func, label_by, no_noise, model_list, label_column, **kwargs)[source]

Create overview plots for clustering metrics.

Parameters:
  • path_func (function) – function to return the paths when model name is given

  • label_by (str) – key of default_labels dict

  • no_noise (bool) – whether to plot the metrics with or without noise

  • model_list (list) – list of models

  • label_column (str) – label as defined in the annotations.csv file

  • kwargs (dict) – additional arguments for plotting

Returns:

figure handle

Return type:

plt.plot object

bacpipe.embedding_evaluation.visualization.visualize.generate_bar_plot(metrics, fig, ax, x_label='Metric value', no_legend=False, **kwargs)[source]
bacpipe.embedding_evaluation.visualization.visualize.iterate_through_subtasks(plot_func, plot_path, task_name, model_list, metrics)[source]

For classification multiple subtasks exist (linear and knn). Iterate over each of the subtasks and call the plotting functions to create the visualizations.

Parameters:
  • plot_func (function) – returns model specific paths when model name is passed

  • plot_path (pathlib.Path object) – path to store overview plots

  • task_name (str) – name of task

  • model_list (list) – list of models

  • metrics (dict) – performance dictionary

bacpipe.embedding_evaluation.visualization.visualize.plot_clusterings(path_func, model_name, label_by, no_noise, fig=None, ax=None, **kwargs)[source]

Plot the clustering metrics for a given model and label type.

Parameters:
  • path_func (function) – function to return the paths when model name is given

  • model_name (str) – name of model

  • label_by (str) – key of default_labels dict

  • no_noise (bool) – whether to plot the metrics with or without noise

  • fig (plt.plot object, optional) – figure handle, by default None

  • ax (plt.plot object, optional) – axes handle, by default None

Returns:

figure handle

Return type:

plt.plot object

bacpipe.embedding_evaluation.visualization.visualize.plot_overview_metrics(plot_path, task_name, model_list, metrics, path_func=None, return_fig=False, sort_string='kmeans-audio_file_name')[source]

Visualization of task performance by model accross all classes. Resulting plot is stored in the plot path.

Parameters:
  • plot_path (pathlib.Path object) – path to store overview plots

  • task_name (str) – name of task

  • model_list (list) – list of models

  • metrics (dict) – performance dictionary

  • sort_string (str) – string to sort the metrics by, defaults to “kmeans-audio_file_name”

bacpipe.embedding_evaluation.visualization.visualize.visualise_results_across_models(plot_path, task_name, model_list)[source]

Create visualizations to compare models by specified tasks.

Parameters:
  • path_func (function) – return the paths when given a model name

  • plot_path (pathlib.Path object) – path to overview plots

  • task_name (str) – name of task

  • model_list (list) – list of models