plot_timeline

Timeline analysis plotting module for ML results analysis. Focuses on temporal trends and run-to-run comparisons with outcome stratification.

Attributes

MAX_OUTCOMES_FOR_STRATIFIED_PLOT

Classes

TimelineAnalysisPlotter

Initializes the timeline analysis plotter.

Module Contents

plot_timeline.MAX_OUTCOMES_FOR_STRATIFIED_PLOT = 8[source]
class plot_timeline.TimelineAnalysisPlotter(data: pandas.DataFrame)[source]

Initializes the timeline analysis plotter.

Parameters:

data (pd.DataFrame) – Results DataFrame, which must contain a ‘run_timestamp’ column.

Raises:

ValueError – If the ‘run_timestamp’ column is not found in the data.

data[source]
clean_data[source]
plot_performance_timeline(metric: str = 'auc', algorithms_to_plot: List[str] | None = None, stratify_by_outcome: bool = False, outcomes_to_plot: List[str] | None = None, aggregation: str = 'mean', figsize: Tuple[int, int] = (14, 6)) None[source]

Plots performance metrics over time (across runs).

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

  • algorithms_to_plot (Optional[List[str]], optional) – A list of specific algorithms to include. Defaults to None.

  • stratify_by_outcome (bool, optional) – If True, creates separate plots for each outcome. Defaults to False.

  • outcomes_to_plot (Optional[List[str]], optional) – A list of specific outcomes to plot. Defaults to None.

  • aggregation (str, optional) – How to aggregate within runs (‘mean’, ‘best’, ‘median’). Defaults to ‘mean’.

  • figsize (Tuple[int, int], optional) – The figure size. Defaults to (14, 6).

Plots the optimization progress within each run.

This helps visualize how quickly the optimization finds better models within each batch/run.

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

  • algorithms_to_plot (Optional[List[str]], optional) – A list of specific algorithms to include. If None, all are used. Defaults to None.

  • stratify_by_outcome (bool, optional) – If True, creates separate plots for each outcome. Defaults to False.

  • outcomes_to_plot (Optional[List[str]], optional) – A list of specific outcomes to plot if stratified. Defaults to None.

  • figsize (Tuple[int, int], optional) – The figure size. Defaults to (14, 7).

plot_computational_cost_timeline(algorithms_to_plot: List[str] | None = None, stratify_by_outcome: bool = False, outcomes_to_plot: List[str] | None = None, aggregation: str = 'mean', figsize: Tuple[int, int] = (14, 6)) None[source]

Plots the computational cost (run_time) over time (across runs).

Parameters:
  • algorithms_to_plot (Optional[List[str]], optional) – A list of specific algorithms to include. Defaults to None.

  • stratify_by_outcome (bool, optional) – If True, creates separate plots for each outcome. Defaults to False.

  • outcomes_to_plot (Optional[List[str]], optional) – A list of specific outcomes to plot if stratified. Defaults to None.

  • aggregation (str, optional) – How to aggregate within runs (‘mean’, ‘sum’, ‘median’). Defaults to ‘mean’.

  • figsize (Tuple[int, int], optional) – The figure size for the plot. Defaults to (14, 6).