deferred_fit_transform
deferred_fit_transform(
expr,
features,
fit,
other,
return_type,
target=None,
name_infix='transform',
cache=None,
)Create a deferred fit and transform operation on an expression.
This function creates a DeferredFitOther object that can fit a model on training data and then transform data using the fitted model, all within a deferred execution context.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| expr | Expr | The input expression (table) to fit and transform on. | required |
| features | tuple | Column names or indices to use as features. | required |
| fit | callable | Function that fits a model. Should accept (df, target, features) and return a fitted model. | required |
| other | callable | Function that transforms data. Should accept (model, df) and return transformed data. | required |
| return_type | DataType | The data type of the transformed output. | required |
| target | str | None | Optional target column name for supervised learning. | None |
| name_infix | str | Infix to use in generated function names. | 'transform' |
| cache | Cache | None | Optional cache configuration for the fitted model. | None |
Returns
| Name | Type | Description |
|---|---|---|
| DeferredFitOther | A deferred fit/transform object that can be executed later. |