plot_errors

Contents

plot_errors#

mlproject.plotting.model_comparison.plot_errors(error_lists, labels, plot_type='boxplot', bins=40, figsize=(10, 10), target=None, target_unit=None, summary_ttest_df=None, model_type='rf', show_stats_in_title=False)[source]#

Function to plot error distributions using boxplots, histograms, or fold-wise comparisons.

Parameters:
  • error_lists (list of list or np.array) – Error values (e.g., per-fold MAE).

  • labels (list of str) – Feature set names (e.g., ‘matminer’, ‘matminer_lob’).

  • plot_type (str) – ‘boxplot’, ‘hist’, or ‘fold_comparison’.

  • bins (int) – Histogram bins.

  • figsize (tuple) – Figure size.

  • target (str, optional) – Target property name (e.g., ‘max_pfc’).

  • summary_ttest_df (pandas.DataFrame, optional) – Single-row paired t-test results dataframe.

  • show_stats_in_title (bool) – Whether to add t-test stats to the boxplot title.

  • model_type (str) – Type of model for which errors are plotted (e.g., RF, MODNet).

  • target_unit (str | None)