polynomial_features
Generate polynomial and interaction features from numeric columns to capture non-linear relationships when linear models underfit. Use degree and interaction_only to control terms.
Instructions
Create polynomial and interaction features from numeric columns. degree=2 creates x^2 and x1*x2 terms. interaction_only=True skips powers (x^2). Use when linear models underfit: polynomial features capture non-linear relationships. Example: polynomial_features(columns=["Revenue","Weight"], degree=2)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| degree | No | ||
| columns | Yes | ||
| df_name | No | ||
| interaction_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |