plot_interactions

Interaction effect plotting module for ML results analysis. Focuses on visualizing how pairs of parameters jointly affect model performance.

Classes

InteractionPlotter

Initializes the InteractionPlotter.

Module Contents

class plot_interactions.InteractionPlotter(data: pandas.DataFrame)[source]

Initializes the InteractionPlotter.

Parameters:

data (pd.DataFrame) – Results DataFrame, must contain columns for parameters and performance metrics.

data[source]
clean_data[source]
plot_categorical_interaction(param1: str, param2: str, metric: str = 'auc', figsize: Tuple[int, int] = (10, 8)) None[source]

Visualizes the interaction of two categorical parameters via a heatmap.

Parameters:
  • param1 (str) – The name of the first categorical parameter column.

  • param2 (str) – The name of the second categorical parameter column.

  • metric (str, optional) – The performance metric to plot. Defaults to ‘auc’.

  • figsize (Tuple[int, int], optional) – Figure size for the plot. Defaults to (10, 8).

plot_continuous_interaction(param1: str, param2: str, metric: str = 'auc', figsize: Tuple[int, int] = (10, 8)) None[source]

Visualizes the interaction of two continuous parameters.

Uses a scatter plot where point color represents the metric value.

Parameters:
  • param1 (str) – The name of the first continuous parameter column.

  • param2 (str) – The name of the second continuous parameter column.

  • metric (str, optional) – The performance metric to use for color. Defaults to ‘auc’.

  • figsize (Tuple[int, int], optional) – Figure size for the plot. Defaults to (10, 8).