Equations#

The fitted model: an expression with parameters, variable names and metadata.

Every estimator of eqdisco.models returns Equation objects, so that simplification, analysis, visualization, export and deployment work the same way whatever the search method.

Examples#

>>> import numpy as np
>>> from eqdisco import Equation
>>> eq = Equation.from_string("1.5*T + 0.2*T^2", feature_names=["T"])
>>> eq.predict(np.array([[1.0], [2.0]]))
array([1.7, 3.8])
>>> print(eq)
0.2 * T^2 + 1.5 * T

The fitted Equation: prediction, metrics, LaTeX, JSON.

Classes#

Equation(expr[, feature_names, metrics, meta])

A symbolic model \(\hat y = f(\mathbf{x};\boldsymbol\theta)\).

Functions#

scaled_expression(expr, a, b[, tol])

Build \(a + b f\) as one expression; trivial terms are omitted.

regression_metrics(y, yhat[, k])

MSE, RMSE, MAE, \(R^2\), AIC and BIC of a prediction with k parameters.