eqdisco.models.GrammarCERegressor#

class eqdisco.models.GrammarCERegressor(functions=('add', 'sub', 'mul', 'div', 'sin', 'cos', 'exp', 'log'), n_iterations=60, batch_size=400, elite_fraction=0.05, learning_rate=0.3, min_prob=0.005, max_depth=6, max_size=30, const_range=(-2.0, 2.0), optimize='lm', random_state=None, feature_names=None, verbose=0)[source]#

Bases: BaseEstimator, RegressorMixin

Risk-seeking cross-entropy search over a probabilistic expression grammar.

A probability table \(P(s\mid c)\) gives the probability of symbol \(s\) (function, variable or constant) in context \(c=\) (parent symbol, argument position). Each iteration samples batch_size expressions, scores them by the reward \(1/(1+\mathrm{NRMSE})\) after linear scaling, keeps the elite above the \(1-\varepsilon\) quantile (elite_fraction \(=\varepsilon\)), and moves the table toward the symbol frequencies of the elite with rate learning_rate. Only the best few percent drive learning, which is the risk-seeking principle of deep symbolic regression (Petersen et al., 2021) applied to a tabular model (new in eqdisco).

Attributes:
equation_Equation
pareto_front_list of Equation
history_pandas.DataFrame

Best and elite rewards and the mean entropy of the table per iteration.

probabilities_dict

The learned table: context -> {symbol: probability}.