plot_master
Master plotting module that provides a single entry point to generate a comprehensive set of visualizations for ML results analysis.
Classes
Initializes the MasterPlotter with aggregated results data. |
Module Contents
- class plot_master.MasterPlotter(data: pandas.DataFrame, output_dir: str = '.')[source]
Initializes the MasterPlotter with aggregated results data.
This class acts as a facade, instantiating various specialized plotters to generate a comprehensive suite of analysis visualizations from the provided results DataFrame.
- Parameters:
data (pd.DataFrame) – A DataFrame containing the aggregated ML experiment results. Must be non-empty.
output_dir (str, optional) – The directory where output files (like CSVs) will be saved. Defaults to ‘.’.
- Raises:
ValueError – If the input data is not a valid, non-empty pandas DataFrame.
- plot_all(metric: str = 'auc_m', stratify_by_outcome: bool = True, top_n_features: int = 20, top_n_algorithms: int = 10, save_best_results: bool = True) None [source]
Generates a comprehensive set of standard plots from all plotters.
This method calls the main plotting functions from each specialized plotter to provide a full overview of the results, including algorithm comparisons, metric distributions, timeline trends, and feature importance. It also handles saving a summary of the best models.
- Parameters:
metric (str, optional) – The primary performance metric to use for plotting (e.g., ‘auc’, ‘f1’). Defaults to ‘auc_m’.
stratify_by_outcome (bool, optional) – If True, creates plots stratified by the ‘outcome_variable’ column. Defaults to True.
top_n_features (int, optional) – The number of top features to show in feature-related plots. Defaults to 20.
top_n_algorithms (int, optional) – The number of top algorithms to show in ranking plots. Defaults to 10.
save_best_results (bool, optional) – If True, saves a CSV summary of the best model per outcome. Defaults to True.