QDpy
Loading...
Searching...
No Matches
qdpy.symbolic._expression.FittedExpression Class Reference

A fitted expression with independently usable NumPy inference. More...

Public Member Functions

str formula (self)
 Format the equation with its fitted coefficients.
np.ndarray predict (self, X)
 Vectorized evaluation with original operator domains.
float rmse (self, X, y)
 Score the model on a separate labeled dataset.

Detailed Description

A fitted expression with independently usable NumPy inference.

Store a tree, its fitted coefficients, and its training RMSE.

Coefficients follow the leaf order of :class:`Expression`. Models
contain no training data or optimizer state.

Definition at line 226 of file _expression.py.

Member Function Documentation

◆ formula()

str qdpy.symbolic._expression.FittedExpression.formula ( self)

Format the equation with its fitted coefficients.

Format the fitted expression with variable names x0, x1, and so on.

Definition at line 247 of file _expression.py.

◆ predict()

np.ndarray qdpy.symbolic._expression.FittedExpression.predict ( self,
X )

Vectorized evaluation with original operator domains.

Parameters
XFinite sample matrix with one column per variable.
Returns
One prediction per row, with NaN for each undefined row.
Predict one value per row. Undefined or overflowing rows return NaN.

Definition at line 254 of file _expression.py.

◆ rmse()

float qdpy.symbolic._expression.FittedExpression.rmse ( self,
X,
y )

Score the model on a separate labeled dataset.

Parameters
XFinite sample matrix.
yOne finite target per row.
Returns
Root mean squared error, or infinity for undefined predictions.
Return RMSE on labeled rows, or infinity if any prediction is undefined.

Definition at line 266 of file _expression.py.


The documentation for this class was generated from the following file: