Plotting Utilities (starclass.plots)

Plotting utilities for stellar classification.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

starclass.plots.plot_confusion_matrix(diagnostics=None, cfmatrix=None, ticklabels=None, ax=None, cmap='Blues', style=None)[source]

Plot a confusion matrix.

If both diagnostics and cfmatrix or ticklabels are provided, the last two will take precedence.

Parameters
  • diagnostics (dict, optional) – Diagnostics to load confusion matrix from. Is created during testing and can be loaded from the diagnostics JSON files.

  • cfmatrix (ndarray, [n_classes x n_classes]) – Confusion matrix.

  • ticklabels (list, [n_classes]) – labels for plot axes.

  • ax (matplotlib.pyplot.Axes) –

  • cmap (str, optional) –

  • style (str, optional) –

Code author: Rasmus Handberg <rasmush@phys.au.dk>

starclass.plots.plot_feature_importance(shap_values, features, features_names, class_names, ax=None, style=None)[source]
starclass.plots.plot_feature_scatter_density(shap_values, features, features_names, class_name, ax=None, style=None)[source]
starclass.plots.plot_roc_curve(diagnostics, ax=None, style=None)[source]

Plot Receiver Operating Characteristic (ROC) curve.

Parameters
  • diagnostics (dict) – Diagnostics coming from utilities.roc_curve() or saved to file during BaseClassifier.test().

  • ax (matplotlib.pyplot.Axes) –

  • style (str, optional) –

See also

utilities.roc_curve()

Code author: Jeroen Audenaert <jeroen.audenaert@kuleuven.be>

Code author: Rasmus Handberg <rasmush@phys.au.dk>

starclass.plots.plots_interactive(backend=('Qt5Agg', 'MacOSX', 'Qt4Agg', 'Qt5Cairo', 'TkAgg'))[source]

Change plotting to using an interactive backend.

Parameters

backend (str or list) – Backend to change to. If not provided, will try different interactive backends and use the first one that works.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

starclass.plots.plots_noninteractive()[source]

Change plotting to using a non-interactive backend, which can e.g. be used on a cluster. Will set backend to ‘Agg’.

Code author: Rasmus Handberg <rasmush@phys.au.dk>