AI Glossary / AI and machine learning / Intermediate
Symbolic regression
Definition
Symbolic regression is a machine learning task that searches for mathematical expressions that fit data. Unlike fitting coefficients within one fixed formula, it can search over the formula's structure as well as its numerical constants, using a chosen set of variables and mathematical operations.
What it means
Ordinary linear regression starts with a form such as y = ax + b and estimates a and b. Symbolic regression may compare that form with alternatives involving products, powers, ratios, or other permitted functions.
Its appeal is that the result can be a compact equation that people can inspect. However, a readable expression is not automatically a true law, a causal relationship, or a reliable extrapolation.
The search space is defined by design choices. Allowed operators, complexity limits, units, and domain restrictions influence which formulas can be found. If a useful relationship cannot be expressed within those choices, the search cannot recover it exactly.
How it works
Begin with measured inputs and outputs, appropriate preprocessing, and a way to evaluate candidate expressions. Define the permitted operations and constraints, such as maximum complexity or restrictions on invalid calculations.
The search generates and modifies formulas, fits numerical constants where appropriate, and scores predictive error. Many methods also reward simplicity or maintain a tradeoff between accuracy and complexity. Evolutionary search is one approach, but it is not the only possible strategy.
Validate promising expressions on data excluded from fitting and selection. Check units, numerical stability, sensitivity to noise, and behavior near boundaries.
Domain expertise remains essential. An equation that fits observations may reflect confounding, measurement artifacts, or a narrow operating range. Replication and intervention can be needed before giving it a scientific or causal interpretation.
Three practical examples
1. Process modeling: Engineers search for a compact relationship between operating settings and an observed quality measure for further investigation.
2. Scientific exploration: Researchers propose candidate equations from experimental data, then test them against independent evidence and known constraints.
3. Model approximation: A team approximates a more complex predictor with a formula that is easier to inspect or evaluate in a constrained environment.
Think of it this way
Think of assembling a mathematical sentence from a box of allowed words and punctuation. The search tries different arrangements until it finds sentences that describe the observations well.
The analogy has limits. Mathematical expressions must also be defined over the relevant inputs and obey numerical or physical constraints. A short, elegant-looking sentence can still be false outside the examples used to construct it.
Worked example
Suppose the training observations are x = 1, 2, 3 with y = 3, 5, 7. The expression y = 2x + 1 fits all three exactly.
But y = 2x + 1 + (x − 1)(x − 2)(x − 3) also fits exactly because the extra product is zero at each training input.
At x = 4, the first expression predicts 9 while the second predicts 15. Training fit alone cannot distinguish their behavior at that new point.
A preference for lower complexity favors the first formula, but that is a modeling preference rather than proof of the underlying law. An independently observed value at x = 4 provides additional evidence. This example shows why symbolic regression needs both complexity control and testing beyond the points that shaped the search.
Illustrative case study
Fictional case: Maple Components collects machine settings and output measurements. Analysts use symbolic regression to propose a compact predictive equation.
One candidate fits well but divides by a quantity that can approach zero during startup. Another uses a sensor variable that partly reflects the outcome after production, creating a timing problem for prediction.
The team removes unavailable inputs, checks valid operating ranges, and evaluates remaining candidates on later runs. Engineers treat the resulting formula as a limited empirical model. The fictional case illustrates validation work, not discovery of a new physical law or a claimed improvement in production performance.
Common misconceptions and mistakes
Finding an equation does not prove causation. Correlated inputs can generate convincing formulas without identifying a mechanism.
An exact fit can be overfitting, especially when expression complexity is unconstrained.
Symbolic regression is not merely displaying a fixed regression model as text. Its distinguishing feature is searching expression structure within a permitted space.
Do not assume interpretable notation guarantees understandable behavior. Nested functions, unstable denominators, and complicated constants can make an expression difficult to use or explain despite its symbolic form.
Business use
The business value can be a compact, inspectable approximation that supports engineering analysis, deployment, or hypothesis generation. Define why an equation is needed and what error and complexity are acceptable.
Compare against simple predefined models before investing in a broad search. Include compute cost, reproducibility, valid input ranges, and maintenance in the evaluation. Preserve the candidate-selection history so an attractive final formula does not hide extensive trial and error. Use operational safeguards where invalid inputs or numerical singularities could cause failures.
People also ask
Does symbolic regression always use genetic programming?
No. Evolutionary methods are common, but other search and inference approaches also exist.
Will it recover the true equation?
Only under favorable conditions, and generally without a guarantee. Data quality, identifiability, noise, and the search space all matter.
Can it work with multiple input variables?
Yes. Candidate expressions can combine several inputs, subject to the chosen operators and complexity controls.
Check your understanding
Two formulas fit the training data perfectly but disagree on unseen inputs. What should guide the choice?
Answer: Independent validation, appropriate simplicity, domain constraints, and the intended operating range. Perfect training fit alone is insufficient to establish which formula will generalize.
Related terms
- Genetic programming
- Overfitting
- Surrogate model
- regression
- equation discovery
- model complexity
- dimensional analysis
- Pareto frontier
Learn next
Learn how expression trees represent formulas and how complexity measures influence search. Reproduce the two-formula example, then add held-out observations. Study dimensional consistency and numerical stability before interpreting a discovered expression as a useful scientific or business model.
More in AI and machine learning
- Switching Hidden Markov Model - A switching hidden Markov model describes a sequence by switching among the outputs of several hidden Markov models.
- Symbol level - The symbol level is a way of describing a computing system in terms of its representations and the operations that manipulate them.
- Symbolic artificial intelligence - Symbolic artificial intelligence is an approach to AI that represents information using explicit symbols and structured expressions, then applies defined...
- Syntactic pattern recognition - Syntactic pattern recognition identifies or interprets patterns through the arrangement of simpler parts and rules describing valid structures.
- Synthetic feature - A synthetic feature is a model input constructed from other available inputs.
- Target network - A target network is a more slowly updated network used to calculate learning targets in some reinforcement-learning methods.
Sources
Miles Cranmer, “Interpretable Machine Learning for Science with PySR and SymbolicRegression.jl,” 2023: https://arxiv.org/abs/2305.01582
Independent review consulted the primary abstract for expression discovery, evolutionary search, operator choices and constant optimization in this implementation. The polynomial comparison and fictional manufacturing case are original examples; no paper benchmark results or universal tool superiority are claimed.
Previous: Symbolic-numeric computation Next: Symmetric distribution