Train an AutoML model
train_modelTrain an AutoML model without SQL to predict a target column from other table columns, register the selected model under a name, and return its score and algorithm.
Instructions
Train an AutoML model that predicts one column of a table from its other columns, without writing SQL: wraps CREATE EXPERIMENT, runs max_trials trials, keeps the best algorithm, registers it as model_name, and returns the best score (accuracy for classification, R² for regression) and the algorithm. Then call predict with that name, or describe_model for full metrics. Reusing an existing model_name replaces that model; more trials take longer and can score higher. Table, target and feature names must use only letters, digits and underscores.
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": {
"collection": "<collection>",
"target": "<target>"
},
"name": "train_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Column the model should predict. | |
| features | No | Columns to learn from; omit or leave empty to use every column except `target`. | |
| task_type | No | binary_classification (default), multiclass_classification, regression, or classification (treated as binary). | binary_classification |
| collection | Yes | Table that holds the training rows. | |
| max_trials | No | How many AutoML trials to run (default 3); more trials take longer and can find a better model. | |
| model_name | No | Name to register the model under (default {collection}_{target}_model); an existing model with this name is replaced. |