> For the complete documentation index, see [llms.txt](https://docs.autogon.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autogon.ai/autogon-engine-studio/automated-machine-learning/autoregression-ii-auto_r_2.md).

# AutoRegression II (AUTO\_R\_2)

## Building a AutoRegression Wizard model

## Sample Request

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "AUTO_R_1",
    "args": {
        "model_name": "AutoRegression",
        "prediction_type": "regression",
        "target": "amount"
    }
}
```

## AutoRegression

<mark style="color:green;">`POST`</mark> `https://autogon.ai/api/v1/engine/start`

#### Request Body

| Name                                               | Type   | Description                                                           |
| -------------------------------------------------- | ------ | --------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current project                                       |
| block\_id<mark style="color:red;">\*</mark>        | int    | The `id` of the current block                                         |
| function\_code<mark style="color:red;">\*</mark>   | string | The function code for current block                                   |
| parent\_id<mark style="color:red;">\*</mark>       | int    | The `id` of the previous block                                        |
| args<mark style="color:red;">\*</mark>             | object | Block arguments                                                       |
| model\_name<mark style="color:red;">\*</mark>      | String | Name of the model to be used for prediction. Defaults to WizardModel. |
| prediction\_type<mark style="color:red;">\*</mark> | String | the preferred prediction type (classification or regression)          |
| target<mark style="color:red;">\*</mark>           | String | a column from the original dataset                                    |

{% tabs %}
{% tab title="200 Statemanagement object" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 8,
        "project": 1,
        "block_id": 8,
        "parent_id": 7,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{\"ClassicModel\": {\"function_code\": \"ML_R_3\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

## Prediction with AutoRegression

Make predictions with the pre-built model passing an optional test data.

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "AUTO_R_2_P",
    "args": {
        "model_name": "AutoRegression"
        "test_data": "",
    }
}
```

## AutoRegression Predict

<mark style="color:green;">`POST`</mark> `https://autogon.ai/api/v1/engine/start`

#### Request Body

| Name                                             | Type   | Description                                                                           |
| ------------------------------------------------ | ------ | ------------------------------------------------------------------------------------- |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of previously trained model to be used for prediction. Defaults to `StudioWizrd` |
| test\_data                                       | String | Input data for prediction. Defaults to `x_test_url` in StateManagment                 |
| project\_id<mark style="color:red;">\*</mark>    | int    | ID of the current project                                                             |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                                              |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                                                   |

{% tabs %}
{% tab title="200: OK Statemanagement object" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 9,
        "project": 1,
        "block_id": 9,
        "parent_id": 8,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{\"y_pred_url\": ""}"
    }
}
```

{% endtab %}
{% endtabs %}
