|
QDpy
|
Budgeted coefficient fitting with variable projection. More...
Go to the source code of this file.
Classes | |
| class | qdpy.symbolic._fit.CoefficientFit |
| One coefficient fit and its measured training evaluation cost. More... | |
| class | qdpy.symbolic._fit._FitLimit |
| class | qdpy.symbolic._fit._Fitter |
| class | qdpy.symbolic._fit._FitProblem |
Namespaces | |
| namespace | qdpy |
Functions | |
| CoefficientFit | qdpy.symbolic._fit.fit_expression (Expression expression, X, y, *, nonlinear_bounds=(-20., 20.), int max_evaluations=48, int restarts=4, int|None seed=None) |
| Fit free expression coefficients on labeled training data. | |
Budgeted coefficient fitting with variable projection.
Definition in file _fit.py.
| CoefficientFit qdpy.symbolic._fit.fit_expression | ( | Expression | expression, |
| X, | |||
| y, | |||
| * | , | ||
| nonlinear_bounds = (-20., 20.), | |||
| int | max_evaluations = 48, | ||
| int | restarts = 4, | ||
| int | None | seed = None ) |
Fit free expression coefficients on labeled training data.
| expression | The tree whose free coefficients are to be fitted. |
| X | Finite sample matrix. |
| y | Finite target vector. |
| nonlinear_bounds | Shared lower and upper bounds for nonlinear coefficients. |
| max_evaluations | Hard cap on expression evaluations in the fit. |
| restarts | Number of starts that share the evaluation cap. |
| seed | Seed for nonlinear restart locations. |
Fit an expression's free scalars on one finite data matrix. X has shape (samples, variables) and y has one real target per row. Solve the structurally affine coefficients together by SVD least squares. For mixed expressions, repeat that solve inside a bounded SciPy least-squares search over the remaining coefficients (variable projection). Bounds apply only to nonlinear coefficients. The evaluation limit includes finite differences and the final check in the original expression. Restarts divide that budget between starting points. The seed controls randomized start locations. A missing model indicates that the fit found no finite solution on all training rows within the budget. Nonlinear fitting can terminate at a local optimum.