eqdisco.models.BayesianSymbolicRegressor#
- class eqdisco.models.BayesianSymbolicRegressor(functions=('add', 'sub', 'mul', 'div', 'exp', 'log', 'sin', 'square'), n_steps=2000, temperatures=(1.0, 1.6, 2.6, 4.2), prior_penalty=1.0, prior=None, max_size=25, swap_interval=10, burn_in=0.2, p_constant=0.3, random_state=None, feature_names=None)[source]#
Bases:
BaseEstimator,RegressorMixinPosterior sampling of model structures by Metropolis moves with parallel tempering.
The energy of an expression \(f\) with fitted parameters is
\[E(f) = \tfrac12\,\mathrm{BIC}(f) + \sum_{o\in f}\lambda_o,\]where the second term is a prior that charges every operation \(o\) (
prior_penaltyor a per-operation dictionaryprior). At temperature \(T=1\), \(\exp(-E)\) approximates the posterior probability of the structure up to a constant (the BIC approximates the log marginal likelihood). Moves: replacement of a node by another of the same arity, regrowth of a subtree, addition of a new root, and removal of the root. Chains at temperaturestemperaturesexchange states everyswap_intervalsteps. The proposal is not exactly symmetric, so the chain targets the posterior only approximately; the sample is used to rank structures and to measure how certain the identification is.- Attributes:
- equation_
Equation The structure of lowest energy visited (maximum a posteriori estimate).
- posterior_
pandas.DataFrame Visited structures with their posterior probability estimated from the energies (\(p\propto e^{-E}\), normalized over the visited structures; a Bayesian-information-criterion approximation of Bayesian model averaging), their share of the \(T=1\) sample (
share; it converges to the posterior only for long chains), energy, BIC and size.- trace_
pandas.DataFrame Energy of the \(T=1\) chain per step.
- pareto_front_
listofEquation
- equation_