deepcave.utils.symbolic_regression¶
# Symbolic Regression
This module provides utilities for running symbolic regression with gplearn.
Functions
|
Convert a fitted symbolic regression to a simplified and rounded mathematical expression. |
|
Get a safe exp function with a maximum value of 100000 to avoid overflow. |
Get a function set for symbolic regression with gplearn. |
- deepcave.utils.symbolic_regression.convert_symb(symb, n_decimals=None, hp_names=None)[source]¶
Convert a fitted symbolic regression to a simplified and rounded mathematical expression.
Warning: eval is used in this function, thus it should not be used on unsanitized input (see https://docs.sympy.org/latest/modules/core.html?highlight=eval#module-sympy.core.sympify).
- Parameters:
symb (SymbolicRegressor) – Fitted symbolic regressor to find a simplified expression for.
n_decimals (Optional[int]) – If set, round floats in the expression to this number of decimals.
hp_names (Optional[List[str]]) – If set, replace X0 and X1 in the expression by the names given.
- Returns:
Converted mathematical expression.
- Return type:
str