eqdisco.benchmarks.is_symbolic_solution#
- eqdisco.benchmarks.is_symbolic_solution(found, truth, feature_names=None, digits=3, X=None, tol=1e-06, affine=False)[source]#
True if
found - truthis constant orfound / truthis a nonzero constant.- Parameters:
- found
Equation,SymPyexpressionorstr - truth
SymPyexpressionorstr - digits
int Floating constants of
foundare rounded to this many significant digits (and snapped to nearby simple rationals) before the symbolic test.- Xarray_like,
optional If given, a numerical test on
Xis used when the symbolic one is inconclusive: the standard deviation of the difference (or of the ratio) relative to that of the true values must be belowtol.- affinebool, default=False
Also accept
found = a + b * truth(equivalence up to the linear scaling that eqdisco applies to every candidate), tested numerically onX(or on random points of [0.5, 2] whenXis not given). This is a relaxation of the SRBench criterion and is reported as such.
- found
Examples using eqdisco.benchmarks.is_symbolic_solution#
A first search: Kepler’s third law from the planets
A first search: Kepler's third law from the planets