Log Transform
log_transformApplies log transforms to selected numerical columns to reduce right skew, with methods such as log1p, log, log10, and log2 while returning skewness before and after.
Instructions
Log-transform numerical columns. This is the usual fix for right-skewed columns such as prices, counts, distances and incomes. Columns must be passed explicitly so the target is never transformed by accident. Args: dataset_id (str): ID of a dataset or of a split. columns (list[str]): Numerical columns to transform. method (str): "log1p" (log(1 + x), safe for zeros), "log", "log10" or "log2". Default is "log1p". offset (float): Constant added before the log, e.g. to shift columns that contain 0 or negatives. Default is 0. replace (bool): Overwrite the original columns instead of adding "_". Default is False. Returns: dict: The new columns and the skewness before and after (measured on the training rows).
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>",
"columns": "<columns>"
},
"name": "log_transform"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | log1p | |
| offset | No | ||
| columns | Yes | ||
| replace | No | ||
| dataset_id | Yes |