tune_model
Scores a model with cross-validation and searches its hyperparameters when Optuna is available and budget remains, returning scores and parameters.
Instructions
Score one model by cross-validation, then search its hyperparameters if Optuna is installed and budget remains. Without Optuna, only the baseline is scored. Returns scores and parameters. Use automl_run to search across model families.
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": {
"name": "<name>",
"target_column": "<target_column>",
"task_type": "<task_type>",
"model_name": "<model_name>"
},
"name": "tune_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cv | No | Cross-validation folds (default 3). | |
| name | Yes | Dataset filename. | |
| metric | No | Selection metric. auto (default) uses roc_auc for binary classification, f1 for multiclass classification or r2 for regression. Loss metrics rank lowest first. | |
| delimiter | No | CSV delimiter character: comma (,), semicolon (;), tab (\t) or pipe (|). Omit to detect it automatically. | |
| task_type | Yes | 'classification' or 'regression'. | |
| max_trials | No | Total trials including the baseline, 1–50 (default 20). | |
| model_name | Yes | Model to tune. | |
| random_state | No | Random seed (default 42). | |
| target_column | Yes | Target variable column. | |
| exclude_columns | No | Feature columns to exclude before preprocessing/training. | |
| max_time_seconds | No | Shared candidate and tuning time budget in seconds (default 600). A trial already in progress may finish after the deadline. | |
| split_manifest_id | No | ID of a validated split manifest to enforce indices. |