bencher.results.bench_result_base
Module Contents
Classes
Generic enumeration. |
|
A wrapper for list like containers that only appends if the item is not None |
|
- class bencher.results.bench_result_base.ReduceType
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- AUTO
- SQUEEZE
- REDUCE
- NONE
- class bencher.results.bench_result_base.EmptyContainer(pane)
A wrapper for list like containers that only appends if the item is not None
- append(child)
- get()
- class bencher.results.bench_result_base.BenchResultBase(bench_cfg: bencher.bench_cfg.BenchCfg)
Bases:
bencher.results.optuna_result.OptunaResult
- result_samples() int
The number of samples in the results dataframe
- to_hv_dataset(reduce: ReduceType = ReduceType.AUTO, result_var: bencher.variables.results.ResultVar = None) holoviews.Dataset
Generate a holoviews dataset from the xarray dataset.
- Parameters:
reduce (ReduceType, optional) – Optionally perform reduce options on the dataset. By default the returned dataset will calculate the mean and standard devation over the “repeat” dimension so that the dataset plays nicely with most of the holoviews plot types. Reduce.Sqeeze is used if there is only 1 repeat and you want the “reduce” variable removed from the dataset. ReduceType.None returns an unaltered dataset. Defaults to ReduceType.AUTO.
- Returns:
results in the form of a holoviews dataset
- Return type:
hv.Dataset
- to_dataset(reduce: ReduceType = ReduceType.AUTO, result_var: bencher.variables.results.ResultVar = None) xarray.Dataset
Generate a summarised xarray dataset.
- Parameters:
reduce (ReduceType, optional) – Optionally perform reduce options on the dataset. By default the returned dataset will calculate the mean and standard devation over the “repeat” dimension so that the dataset plays nicely with most of the holoviews plot types. Reduce.Sqeeze is used if there is only 1 repeat and you want the “reduce” variable removed from the dataset. ReduceType.None returns an unaltered dataset. Defaults to ReduceType.AUTO.
- Returns:
results in the form of an xarray dataset
- Return type:
xr.Dataset
- get_optimal_vec(result_var: bencher.variables.parametrised_sweep.ParametrizedSweep, input_vars: List[bencher.variables.parametrised_sweep.ParametrizedSweep]) List[Any]
Get the optimal values from the sweep as a vector.
- Parameters:
result_var (bch.ParametrizedSweep) – Optimal values of this result variable
input_vars (List[bch.ParametrizedSweep]) – Define which input vars values are returned in the vector
- Returns:
A vector of optimal values for the desired input vector
- Return type:
List[Any]
- get_optimal_value_indices(result_var: bencher.variables.parametrised_sweep.ParametrizedSweep) xarray.DataArray
Get an xarray mask of the values with the best values found during a parameter sweep
- Parameters:
result_var (bch.ParametrizedSweep) – Optimal value of this result variable
- Returns:
xarray mask of optimal values
- Return type:
xr.DataArray
- get_optimal_inputs(result_var: bencher.variables.parametrised_sweep.ParametrizedSweep, keep_existing_consts: bool = True, as_dict: bool = False) Tuple[bencher.variables.parametrised_sweep.ParametrizedSweep, Any] | dict[bencher.variables.parametrised_sweep.ParametrizedSweep, Any]
Get a list of tuples of optimal variable names and value pairs, that can be fed in as constant values to subsequent parameter sweeps
- Parameters:
result_var (bch.ParametrizedSweep) – Optimal values of this result variable
keep_existing_consts (bool) – Include any const values that were defined as part of the parameter sweep
as_dict (bool) – return value as a dictionary
- Returns:
Tuples of variable name and optimal values
- Return type:
Tuple[bch.ParametrizedSweep, Any]|[ParametrizedSweep, Any]
- describe_sweep()
- get_best_holomap(name: str = None)
- get_hmap(name: str = None)
- to_plot_title() str
- title_from_ds(dataset: xarray.Dataset, result_var: param.Parameter, **kwargs)
- get_results_var_list(result_var: bencher.variables.parametrised_sweep.ParametrizedSweep = None) List[bencher.variables.results.ResultVar]
- map_plots(plot_callback: callable, result_var: bencher.variables.parametrised_sweep.ParametrizedSweep = None, row: EmptyContainer = None) panel.Row | None
- map_plot_panes(plot_callback: callable, hv_dataset: holoviews.Dataset = None, target_dimension: int = 2, result_var: bencher.variables.results.ResultVar = None, result_types=None, **kwargs) panel.Row | None
- filter(plot_callback: callable, plot_filter=None, float_range: bencher.plotting.plot_filter.VarRange = VarRange(0, None), cat_range: bencher.plotting.plot_filter.VarRange = VarRange(0, None), vector_len: bencher.plotting.plot_filter.VarRange = VarRange(1, 1), result_vars: bencher.plotting.plot_filter.VarRange = VarRange(1, 1), panel_range: bencher.plotting.plot_filter.VarRange = VarRange(0, 0), repeats_range: bencher.plotting.plot_filter.VarRange = VarRange(1, None), input_range: bencher.plotting.plot_filter.VarRange = VarRange(1, None), reduce: ReduceType = ReduceType.AUTO, target_dimension: int = 2, result_var: bencher.variables.results.ResultVar = None, result_types=None, **kwargs)
- to_panes_multi_panel(hv_dataset: holoviews.Dataset, result_var: bencher.variables.results.ResultVar, plot_callback: callable = None, target_dimension: int = 1, **kwargs)
- _to_panes_da(dataset: xarray.Dataset, plot_callback: callable = None, target_dimension=1, horizontal=False, result_var=None, **kwargs) panel.panel
- to_sweep_summary(**kwargs)
- to_title(panel_name: str = None) panel.pane.Markdown
- to_description(width: int = 800) panel.pane.Markdown