skrub.Expr.skb.eval#

Expr.skb.eval(environment=None, *, keep_subsampling=False)[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 – a 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.

keep_subsamplingbool, default=False

If True, and if subsampling has been configured (see Expr.skb.subsample()), use a subsample of the data. By default subsampling is not applied and all the data is used.

Returns:
result

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

See also

Expr.skb.preview

Access the preview of the result on the variables initial values, with subsampling. Faster than eval but does not allow passing new data and always applies subsampling.

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