plot_best_model

Module for analyzing and visualizing the single best performing model for each outcome.

Attributes

MAX_OUTCOMES_TO_PLOT

Classes

BestModelAnalyzerPlotter

Initialize the plotter.

Module Contents

plot_best_model.MAX_OUTCOMES_TO_PLOT = 10[source]
class plot_best_model.BestModelAnalyzerPlotter(data: pandas.DataFrame)[source]

Initialize the plotter.

Parameters:

data – Aggregated results DataFrame. Must contain ‘outcome_variable’.

data[source]
clean_data[source]
feature_categories = ['age', 'sex', 'bmi', 'ethnicity', 'bloods', 'diagnostic_order', 'drug_order', 'annotation_n',...[source]
pipeline_params = ['resample', 'scale', 'param_space_size', 'percent_missing'][source]
plot_best_model_summary(metric: str = 'auc', outcomes_to_plot: List[str] | None = None, figsize: Tuple[int, int] = (14, 9))[source]

Generates a summary plot for the best model of each outcome.

This method finds the best performing model for each outcome and creates a detailed 2x2 plot summarizing its algorithm, performance, hyperparameters, and pipeline settings.

Parameters:
  • metric (str, optional) – The metric to determine the “best” model. Defaults to ‘auc’.

  • outcomes_to_plot (Optional[List[str]], optional) – A specific list of outcomes to analyze. If None, analyzes all outcomes up to a limit. Defaults to None.

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