- Updated PySR version and added parsing support for `pysr.TemplateExpressionSpec` (see e.g. https://github.com/MilesCranmer/PySR/releases/tag/v1.4.0), so the new result syntax can be interfaced with downstream LMFIT for re-parameterization and re-optimization. Now, user can utilize this class method to impose desired structure on the final expressions, which can potentially help narrowing down the function search space when domain knowledge is present.
- For example, one can constrain to search for dijet functions (new physics searches at the CERN LHC) of the form `f(x)^g(log(x))`, where `f` and `g` are functions being searched for. One can further constrain to allow only `+` and `*` operators, restricting `f(x)` to be a polynomial of `x` and `g(log(x))` to be a polynomial of `log(x)`.
from pysr import PySRRegressor, TemplateExpressionSpec
expression_spec = TemplateExpressionSpec(
'p[1] * f(x/13000) ^ g(log(x/13000))',
expressions = ['f', 'g'],
variable_names = ['x'],
parameters = {'p': 1}
)
pysr_config = PySRRegressor(
expression_spec = expression_spec,
model_selection = 'accuracy',
niterations = 200,
maxsize = 40,
binary_operators = ['+', '*'],
elementwise_loss='loss(y, y_pred, weights) = (y - y_pred)^2 * weights',
)
**Full Changelog**: https://github.com/hftsoi/symbolfit/compare/v0.1.5...v0.2.0