Symbolic regression
Searching for mathematical expressions that describe a relationship in data.
Published · Updated
A straight line and a gently curved equation sit almost on top of each other across your measured points. The longer formula has the better score by a hair. Where would you take one more measurement?
Test a formula where the candidates disagree
Plot both curves with the observed range shaded. Look for a physically accessible region where they separate enough to tell them apart. The extra measurement has a purpose now, even if the simpler curve eventually wins.
Try a change of units too. If a formula effectively adds a time to a length, a missing conversion may expose itself when you move from metres to centimetres. A small training error is much less persuasive once the units ask that question.
Symbolic regression searches over combinations of permitted operators and variables. Fit and complexity help rank the resulting expressions. Physical constraints, units and independent measurements help determine whether one of those expressions deserves a scientific interpretation.
The search needs a vocabulary of variables and operators, an error measure and a way to balance fit against complexity. Allowing more complicated expressions supplies more ways to fit noise. Restricting the search too aggressively can exclude a relationship with a useful physical interpretation.
PySR is one tool for exploring sets of expressions with different complexity and error. Compare several candidates on held-out measurements and examine how each behaves near relevant limits. Correlated inputs are particularly instructive. A formula using one variable may look as convincing as a formula using another until a measurement separates them.
Save the candidate expressions, settings, units and measured range along with the selection. A colleague can then decide whether a different formula explains the available evidence nearly as well. That unresolved choice can be the most productive result of the search.
Related guide: Physics & Astronomy
