skrub.Expr.skb.eval#

Expr.skb.eval(environment=None)[source]#

Evaluate the expression.

This returns the result produced by evaluating the expression, ie running the corresponding pipeline. The result is always the output of the pipeline’s fit_transform – the pipeline is refitted to the provided data.

If no data is provided, the values passed when creating the variables in the expression are used.

Parameters:
environmentdict or None, optional

If None, the initial values of the variables contained in the expression are used. If a dict, it must map the name of each variable to a corresponding value.

Returns:
result

The result of running the computation, ie of executing the pipeline’s fit_transform on the provided data.

Examples

>>> import skrub
>>> a = skrub.var('a', 10)
>>> b = skrub.var('b', 5)
>>> c = a + b
>>> c
<BinOp: add>
Result:
―――――――
15
>>> c.skb.eval()
15
>>> c.skb.eval({'a': 1, 'b': 2})
3