fitbenchmarking.results_processing.compare_table module

compare table

class fitbenchmarking.results_processing.compare_table.CompareTable(results, best_results, options, group_dir, pp_locations, table_name)

Bases: Table

The combined results show the accuracy in the first line of the cell and the runtime on the second line of the cell.

For Bayesian fitting, accuracy results represent the reciporcal of the confidence that the fitted parameter values are within \(2 \sigma\) of the expected parameter values (calculated using scipy.optimize.curve_fit).

cbar_title = 'Problem-Specific Cell Shading:\nTop Colour - Relative Accuracy\nBottom Colour - Relative Runtime\n'
colour_template = 'background-image: linear-gradient({0},{0},{1},{1})'
display_str(value)

Combine the accuracy and runtime values into a string representation.

Parameters:

value (list[list[float]]) – Relative and absolute values for accuracy and runtime [[acc_rel, runtime_rel], [acc_abs, runtime_abs]]

Returns:

string representation of the value for display in the table.

Return type:

str

Generates the hyperlink for a given result

Parameters:
  • result (fitbenchmarking.utils.ftibm_result.FittingResult) – The result to generate a string for

  • val_str (str) – Preprocessed val_str to display

  • text_col (str) – Foreground colour for the text as html rgb strings e.g. ‘rgb(255, 255, 255)’

Returns:

The hyperlink representation.

Return type:

str

get_value(result)

Gets the main value to be reported in the tables for a given result

Note that the first value (relative chi_sq) will be used in the default colour handling.

Parameters:

result (FittingResult) – The result to generate the values for.

Returns:

The normalised chi sq and runtime with respect to the smallest chi_sq and runtime respectively as well as the absolute values for both chi_sq and runtime for the result. [[acc_rel, runtime_rel], [acc_abs, runtime_abs]]

Return type:

list[list[float]]

name = 'compare'
vals_to_colour(vals, *args)

Override vals_to_colour to allow it to run for both accuracy and runtime.

Parameters:

vals (list[list[float, float]]) – The relative values to get the colours for

Returns:

The background colours for the acc and runtime values and The text colours for the acc and runtime values

Return type:

tuple[zip[list[str], list[str]], zip[list[str], list[str]]]