deepcave.plugins.hyperparameter.symbolic_explanations

# SymbolicExplanations

This module provides utilities for generating Symbolic Explanations.

Provided utilities include getting input and output layout, processing the data and loading the outputs.

## Classes
  • SymbolicExplanations: Leverage Symbolic Explanations to obtain a formula and plot it.

## Constants

GRID_POINTS_PER_AXIS : int SAMPLES_PER_HP : int MAX_SAMPLES : int MAX_SHOWN_SAMPLES : int

Classes

SymbolicExplanations()

Generate Symbolic Explanations.

class deepcave.plugins.hyperparameter.symbolic_explanations.SymbolicExplanations[source]

Bases: StaticPlugin

Generate Symbolic Explanations.

Provided utilities include getting input and output layout, processing the data and loading the outputs.

static get_input_layout(register)[source]

Get the layout for the input block.

Parameters:

register (Callable) – Method to register (user) variables. The register_input function is located in the Plugin superclass.

Returns:

The layout for the input block.

Return type:

List[Union[dbc.Row, html.Details]

static get_output_layout(register)[source]

Get the layout for the output block.

Parameters:

register (Callable) – Method to register outputs. The register_input function is located in the Plugin superclass.

Returns:

Layout for the output block.

Return type:

List[dcc.Graph]

load_dependency_inputs(run, previous_inputs, inputs)[source]

Work like ‘load_inputs’ but called after inputs have changed.

Note

Only the changes have to be returned. The returned dictionary will be merged with the inputs.

Parameters:
  • run – The selected run.

  • inputs – Current content of the inputs.

  • previous_inputs – Previous content of the inputs. Not used in this specific function.

Returns:

Dictionary with the changes.

Return type:

Dict[str, Any]

load_inputs()[source]

Load the content for the defined inputs in ‘get_input_layout’.

This method is necessary to pre-load contents for the inputs. If the plugin is called for the first time, or there are no results in the cache, the plugin gets its content from this method.

Returns:

Content to be filled.

Return type:

Dict[str, Dict[str, Any]]

static load_outputs(run, inputs, outputs)[source]

Read the raw data and prepare it for the layout.

Note

The passed inputs are cleaned and therefore differ compared to ‘load_inputs’ or ‘load_dependency_inputs’. Please see ‘_clean_inputs’ for more information.

Parameters:
  • run – The selected run.

  • inputs – Input and filter values from the user.

  • outputs – Raw output from the run.

Returns:

The figure of the Symbolic Explanation and the Partial Dependency Plot (PDP) leveraged for training in the case that the number of hyperparameters to be explained is smaller than the number of hyperparameters that was optimized, else, a Partial Dependency Plot (PDP) for comparison.

Return type:

List[go.Figure]

static process(run, inputs)[source]

Return raw data based on a run and the input data.

Warning

The returned data must be JSON serializable.

Note

The passed inputs are cleaned and therefore differ compared to ‘load_inputs’ or ‘load_dependency_inputs’. Please see ‘_clean_inputs’ for more information.

Parameters:
  • run – The run to process.

  • inputs – The input data.

Returns:

A serialized dictionary.

Return type:

Dict[str, Any]

Raises:

RuntimeError – If the objective is None.