One Hot Encode
one_hot_encodeEncode categorical dataset columns as separate 0/1 feature columns, with optional first-category dropping to reduce redundancy for linear models.
Instructions
One-hot encode categorical columns: every category becomes its own 0/1 column. Best for nominal columns with few categories (e.g. fuel). Categories that only appear in the test data are encoded as all zeros. Args: dataset_id (str): ID of a dataset or of a split. columns (list[str], optional): Categorical columns to encode. If omitted, all categorical columns. drop_first (bool): Drop the first category of each column to avoid redundancy (useful for linear models). Default is False. Returns: dict: Encoded columns and the new column names.
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": "one_hot_encode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| columns | No | ||
| dataset_id | Yes | ||
| drop_first | No |