y#
- skrub.y(value=NULL)[source]#
Create a skrub variable and mark it as being
y.This is just a convenient shortcut for:
skrub.var("y", value).skb.mark_as_y()
Marking a variable as
ytells skrub that this is the column or table of targets that must be split into training and testing sets for cross-validation. Please refer to the examples gallery for more information.- Parameters:
- valueobject
The value passed to
skrub.var(), which is used for previews of the learner’s outputs, cross-validation etc. as described in the documentation forskrub.var()and the examples gallery.
- Returns:
- A skrub variable
- Raises:
- TypeError
If the provided value is a skrub DataOp or a skrub choose_* function.
See also
skrub.XCreate a skrub variable and mark it as being
y.skrub.varCreate a skrub variable.
skrub.DataOp.skb.mark_as_yMark this DataOp as being the
ytable.
Examples
>>> import skrub >>> col = skrub.datasets.toy_orders().delayed >>> y = skrub.y(col) >>> y <Var 'y'> Result: ――――――― 0 False 1 False 2 True 3 False Name: delayed, dtype: bool >>> y.skb.name 'y' >>> y.skb.is_y True
Gallery examples#
Use case: developing locally and deploying to production
Use case: developing locally and deploying to production