Extract Date Features
extract_date_featuresSplit date or datetime columns into numerical features for machine learning, including year, month, weekday, quarter, and optional cyclical encodings; unparseable values become missing.
Instructions
Split a date/datetime column into numerical parts that models can use. Values that cannot be parsed become missing values (the call fails if more than half cannot be parsed). Args: dataset_id (str): ID of a dataset or of a split. column (str): Date column (text or datetime). features (list[str], optional): Parts to extract. Choose from: year, month, day, dayofweek, dayofyear, weekofyear, quarter, hour, minute, is_weekend, is_month_start, is_month_end, epoch_days. Default is year, month, day, dayofweek, is_weekend, quarter. drop_original (bool): Drop the original date column. Default is True. cyclical (bool): Also add "_sin" and "_cos" columns for cyclic parts (month, dayofweek, hour, ...) so that e.g. December and January are close. Default is False. date_format (str, optional): strftime format such as "%d/%m/%Y". Recommended when dates are not ISO formatted. Returns: dict: The new columns, and any extracted parts that are constant (e.g. hour for date-only data).
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>",
"column": "<column>"
},
"name": "extract_date_features"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| column | Yes | ||
| cyclical | No | ||
| features | No | ||
| dataset_id | Yes | ||
| date_format | No | ||
| drop_original | No |