Plotting functions¶
- iohblade.plots.fitness_table(logger: ExperimentLogger, alpha=0.05, smaller_is_better=False)¶
Creates a LaTeX table with rows = methods, columns = problems. Each cell shows mean ± std (p=…). Cells are bolded if that method is significantly better than all others (p < alpha) for the given problem.
- Args:
logger (ExperimentLogger): the experiment logger to process. alpha (float): Significance level for p-value cutoff. smaller_is_better (bool): If True, we treat lower fitness as “better.” Otherwise, higher is “better.”
- iohblade.plots.plot_boxplot_fitness(logger: ExperimentLogger, y_label='Fitness', x_label='Method', problems=None)¶
Plots boxplots of fitness grouped by problem_name (subplots) and method_name (categories). Each problem has its own subplot, grouped by method_name.
- Args:
logger y_label x_label problems
- iohblade.plots.plot_boxplot_fitness_hue(logger: ExperimentLogger, y_label='Fitness', x_label='Problem', hue='method_name', x='problem_name', problems=None)¶
Plots boxplots of fitness grouped by hue and method_name x. Produces one plot with grouped boxplots per x. Args:
logger
- iohblade.plots.plot_code_evolution_graphs(run_data, expfolder=None, plot_features=None, save=True, ax=None)¶
Plots optimization progress and relationships between successive solutions in an evolutionary run based on AST metrics. Can plot multiple features or a single feature on a provided axis.
- Args:
run_data (pandas.DataFrame): DataFrame containing code and fitness values. expfolder (str, optional): Folder path where the plots are saved. If None, plots are shown. plot_features (list, optional): The features to plot. If None, plots multiple default features. save (bool): If True, saves the plots otherwise shows them. ax (matplotlib.axes.Axes, optional): The axis to plot on. If None, creates new plots.
- iohblade.plots.plot_convergence(logger: ExperimentLogger, metric: str = 'Fitness', budget: int = 100, save: bool = True, return_fig: bool = False)¶
Plots the convergence of all methods for each problem from an experiment log.
- Args:
logger (ExperimentLogger): The experiment logger object. metric (str, optional): The metric to show as y-axis label. save (bool, optional): Whether to save or show the plot.
- iohblade.plots.plot_experiment_CEG(logger: ExperimentLogger, metric: str = 'total_token_count', budget: int = 100, save: bool = True, max_seeds=5)¶
Plot the Code evolution graphs for each run in an experiment, splitted by problem.
- Args:
logger (ExperimentLogger): The experiment logger object. metric (str, optional): The metric to show as y-axis label (should be a statistic from AST / Complexity). save (bool, optional): Whether to save or show the plot. max_seeds (int, optional): The maximum number of runs to plot.