> 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.autogon.ai/autogon-engine-studio/automated-machine-learning/autoregression-ii-auto_r_2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
