Impute Missing
impute_missingFill missing dataset values using mean, median, most-frequent, constant, or KNN strategies. Optionally restrict filling to training data via a split ID to prevent data leakage.
Instructions
Fill missing values. Recommended: use a split_id so the fill values come from training data only. Args: dataset_id (str): ID of a dataset or of a split. columns (list[str], optional): Columns to impute. If omitted, all columns with missing values. strategy (str): "auto" (median for numerical, most_frequent for categorical), "mean", "median", "most_frequent", "constant" or "knn" (numerical only). fill_value (int, float or str, optional): Value used by "constant" (default 0 for numerical, "missing" for categorical). n_neighbors (int): Neighbours used by "knn". Default is 5. Returns: dict: Columns imputed, missing counts before, and the value used for each column.
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": "impute_missing"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| columns | No | ||
| strategy | No | auto | |
| dataset_id | Yes | ||
| fill_value | No | ||
| n_neighbors | No |