Expressions#

Generalizing the scikit-learn pipeline. See skrub expression for further details.

var

Create a skrub variable.

X

Create a skrub variable and mark it as being X.

y

Create a skrub variable and mark it as being y.

as_expr

Create an expression Expr that evaluates to the given value.

deferred

Wrap function calls in an expression Expr.

The expression object.

Expr

Representation of a computation that can be used to build ML pipelines.

Inline hyperparameters selection within your expressions.

choose_bool

A choice between True and False.

choose_float

A choice of floating-point numbers from a numeric range.

choose_int

A choice of integers from a numeric range.

choose_from

A choice among several possible outcomes.

optional

A choice between value and None.

Evaluate your expressions.

cross_validate

Cross-validate a pipeline built from an expression.

eval_mode

Return the mode in which the expression is currently being evaluated.

The skb accessor exposes all expressions methods and attributes.

Expr.skb.apply

Apply a scikit-learn estimator to a dataframe or numpy array.

Expr.skb.apply_func

Apply the given function.

Expr.skb.clone

Get an independent clone of the expression.

Expr.skb.concat

Concatenate dataframes vertically or horizontally.

Expr.skb.cross_validate

Cross-validate the expression.

Expr.skb.describe_defaults

Describe the hyper-parameters used by the default pipeline.

Expr.skb.describe_param_grid

Describe the hyper-parameters extracted from choices in the expression.

Expr.skb.describe_steps

Get a text representation of the computation graph.

Expr.skb.draw_graph

Get an SVG string representing the computation graph.

Expr.skb.drop

Drop some columns.

Expr.skb.eval

Evaluate the expression.

Expr.skb.freeze_after_fit

Freeze the result during pipeline fitting.

Expr.skb.full_report

Generate a full report of the expression's evaluation.

Expr.skb.get_data

Collect the values of the variables contained in the expression.

Expr.skb.get_pipeline

Get a skrub pipeline for this expression.

Expr.skb.get_grid_search

Find the best parameters with grid search.

Expr.skb.get_randomized_search

Find the best parameters with randomized search.

Expr.skb.if_else

Create a conditional expression.

Expr.skb.iter_pipelines_grid

Get pipelines with different parameter combinations.

Expr.skb.iter_pipelines_randomized

Get pipelines with different parameter combinations.

Expr.skb.mark_as_X

Mark this expression as being the X table.

Expr.skb.mark_as_y

Mark this expression as being the y table.

Expr.skb.match

Select based on the value of an expression.

Expr.skb.preview

Get the value computed for previews (shown when printing the expression).

Expr.skb.select

Select a subset of columns.

Expr.skb.set_description

Give a description to this expression.

Expr.skb.set_name

Give a name to this expression.

Expr.skb.subsample

Configure subsampling of a dataframe or numpy array.

Expr.skb.train_test_split

Split an environment into a training an testing environments.

Accessor attributes.

Expr.skb.description

A user-defined description or comment about the expression.

Expr.skb.is_X

Whether this expression has been marked with .skb.mark_as_X().

Expr.skb.is_y

Whether this expression has been marked with .skb.mark_as_y().

Expr.skb.name

A user-chosen name for the expression.

Expr.skb.applied_estimator

Retrieve the estimator applied in the previous step, as an expression.

Objects generated by the expressions.

SkrubPipeline

Pipeline that evaluates a skrub expression.

ParamSearch

Pipeline that evaluates a skrub expression with hyperparameter tuning.