Interaction Features
interaction_featuresCombine pairs of numerical columns into new features such as price per km or area times rooms, using multiply, divide, add, or subtract to give models richer input.
Instructions
Combine pairs of numerical columns into new features, e.g. price per km or area * rooms.
Pass EITHER columns (every pair among them, in the order given) OR pairs (exact pairs).
Division by zero gives a missing value. Missing values must be imputed afterwards if the model needs them gone.
For squares or cubes of a single column use polynomial_features or transform_feature.
Args:
dataset_id (str): ID of a dataset or of a split.
columns (list[str], optional): Numerical columns; all pairs (a, b) with a before b are created.
pairs (list[list[str]], optional): Explicit pairs such as [["km_driven","year"]]. For "divide" the order matters (first / second).
operations (list[str], optional): Any of "multiply", "divide", "add", "subtract". Default is ["multiply"].
Names are "x", "div", "plus", "minus".
max_new_features (int): Safety limit on how many columns may be created. Default is 50.
Returns:
dict: The new feature names and how many rows had a zero denominator.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"dataset_id": "<dataset_id>"
},
"name": "interaction_features"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pairs | No | ||
| columns | No | ||
| dataset_id | Yes | ||
| operations | No | ||
| max_new_features | No |