Label Encode
label_encodeEncodes categorical columns into integer codes in alphabetical order, ideal for high-cardinality features and tree-based models. Unseen test categories map to -1.
Instructions
Label encode categorical columns: every category becomes an integer (alphabetical order). Best for high-cardinality columns (e.g. brand) and tree-based models. Categories that only appear in the test data become -1. 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. Returns: dict: Encoded columns and the category -> integer mapping.
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": "label_encode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| columns | No | ||
| dataset_id | Yes |