# Change Log

This represents a log of all changes to the API. Stay up-to-date with our most recent and past changes.


# Get Started

This page should help you get started on grabbing your API Keys from the dashboard and making your first request to Autogon.

## Our Structure

Our API  is based on both a single and multi-endpoint architecture. Specific operations are determined by requests sent to the respective endpoints.

Some requests made to Autogon will require an API key. Please refer to the sections below on API key creation.

While most requests require authentication using API keys; any of such requests that doesn't include an API key will return an error. You can generate an API key from your portal at any time.

### Getting your API Keys

Before you begin integration with the Autogon API,

1. Create an Autogon account and complete necessary verification
2. Fetch your integration credentials from the Integrations tab in Settings.
3. Proceed to set up your integration.

{% hint style="info" %}
Refer to the article/video embedded below for a complete guide on how to get API keys and integrate with the Autogon API.
{% endhint %}

#### [Link to article/video on integrating with Autogon](#user-content-fn-1)[^1]

## Install the library

The best way to interact with our API is to use any of our supported integration libraries:

{% tabs %}
{% tab title="Node" %}

```
# Install via NPM
npm install -g autogonai-node
```

{% endtab %}

{% tab title="Python" %}

```
# Install via pip
pip3 install autogonai-python
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Learn More:** Find out more about our supported libraries [here](/libraries).
{% endhint %}

## Make your first request

To make your first request, send an authenticated request to the project endpoint. This will create a project. A project is the baseline for using our powerful tools.

## Create project.

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

Creates a new project.

#### Request Body

| Name                                            | Type   | Description                    |
| ----------------------------------------------- | ------ | ------------------------------ |
| project\_name<mark style="color:red;">\*</mark> | String | name of project                |
| project\_description                            | String | short description for project. |

{% tabs %}
{% tab title="200 Project created successfully" %}
{% code overflow="wrap" %}

```javascript
{
    "id": 1,
    "app_id": "a295d247-05c9-424d-aa8c-5a8990ef5f6a",
    "project_name": "My First Project",
    "project_description": "This is a great project. I hope to achieve more with Autogon",
    "project_compiled_models": null,
    "created_at": "2023-01-22T01:47:43.158604Z"
}
```

{% endcode %}
{% endtab %}

{% tab title="403: Forbidden Project already exists" %}

```json
{
    "status": "false",
    "message": "This project name already exists"
}
```

{% endtab %}
{% endtabs %}

Take a look at how you might call this method using our official libraries, or via `curl`:

{% tabs %}
{% tab title="curl" %}

```
curl -L -X POST "https://autogon.ai/api/v1/api/v1/engine/project" -H "X-AUG-KEY: <API-KEY>" -H "Content-Type: application/json" --data-raw "{
    \"project_name\": \"My First Project\",
    \"project_description\": \"This is a great project. I hope to achieve more with Autogon\"
}"
```

{% endtab %}

{% tab title="Node" %}
{% code overflow="wrap" %}

```javascript
// require the autogonai module and set it up with your API key
const autogonai = require('autogonai');

// load environment variables
require("dotenv").config();

// initilalize client
const client = new Client(process.env.AUTOGON_API_KEY);

// create project
const newProject = await client.Project.create({
    project_name: 'My First Project',
    project_description: 'This is a great project. I hope to achieve more with Autogon',
})
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}

```python
import os
from dotenv import load_dotenv
from autogonai.core import Client

# Set your API key before making the request
client = Client(api_key=API_KEY)

client.Project.create(
    project_name="My First Project",
    project_description="This is a great project. I hope to achieve" \
    " more with Autogon",
)
```

{% endtab %}
{% endtabs %}

[^1]: This is an external link to article or video content


# Libraries

Supported libraries and packages for continuous integration with Autogon from your application.

We are very pleased to announce the Autogon  AI developer's community. Through the community, we currently support the following packages:

* [Python](https://github.com/autogoninc/autogonai-python/)
* [Node.js](https://github.com/autogoninc/autogoai-node/)

### Build with us?

We support and continue to improve the developer's experience on our platform, therefore we are happy to collaborate and extend the list to support other languages and technologies. Please reach out to us <developers@autogon.ai>, the official Autogon Developer's Community on [Discord](https://discord.gg/K86QEGgZeS) or the Autogon AI GitHub repositories. We'll be happy to review and approve your pull requests and upload your integration sequence to this list.


# Slicing & Indexing

Learn how to select subsets of data on Autogon using slice notation. This concise syntax allows you to select elements based on various criteria, including specific indices, labels, and ranges.

## Slicing Notation

Our slice notation is a way of selecting subsets of a specified dataset using a concise, Pythonic syntax. This notation can be used to select rows and columns based on various criteria.

#### Selecting Rows

To select rows using slice notation, you can use the following syntax:

```
start:end
```

Here, `start` and `end` are the starting and ending indices of the slice, respectively. Note that the slice is inclusive of the starting index and exclusive of the ending index.

For example, to select rows 1 to 3 of a dataset, you can use the following slice:

```
1:4
```

This selects rows 1, 2, and 3 (because the slice is inclusive of the starting index 1 and exclusive of the ending index 4).

You can also use negative indices to select rows from the end of the data. For example, to select the last 3 rows, you can use the following slice:

```
-3:
```

This selects the last 3 rows of the dataset (because the slice starts at index -3 and continues to the end of the dataset).

#### Selecting Columns

To select columns using slice notation, you can use the following syntax:

```
:, start:end
```

Here, `start` and `end` are the starting and ending column labels of the slice, respectively. Note that the slice is inclusive of the starting label and exclusive of the ending label.

For example, to select columns "A" through "C" of your dataset, you can use the following slice:

```
:, "A":"D"
```

This selects columns "A", "B", and "C" (because the slice is inclusive of the starting label "A" and exclusive of the ending label "D").

You can also use negative indices to select columns from the end of the dataset. For example, to select all columns except for the last column of a dataset, you can use the following slice:

```
:, :-1
```

This selects all columns up to, but not including, the last column of the dataset.

#### Selecting Rows and Columns

To select both rows and columns using slice notation, you can combine the row and column slices using the following syntax:

```
start_row:end_row, start_col:end_col
```

For example, to select rows 1 to 3 and columns "A" through "C" of your dataset, you can use the following slice:

```
1:4, "A":"C"
```

This selects rows 1, 2, and 3 and columns "A", "B", and "C" (because the slices are inclusive of the starting indices and exclusive of the ending indices).


# Data Processing

This engine collects raw data and translates into usable information. It uses a single endpoint architecture, differentiated by function codes.

Below are the specific function codes for functionality&#x20;

## Data Input

Specify the data sources, this functionality can take database connection or CSV file or JSON file

{% content-ref url="/pages/1Hn1hMsFg5ajfAIDc0k1" %}
[Data Input (DP\_1)](/autogon-engine-studio/data-processing/data-input-dp_1)
{% endcontent-ref %}

## Missing Data

This functionality handles missing data using various techniques. e.g mean, mode and more

{% content-ref url="/pages/pTxQtOOJaUkHaiBw2hsd" %}
[Missing Data (DP\_2)](/autogon-engine-studio/data-processing/missing-data-dp_2)
{% endcontent-ref %}

## Data Encoding

This functionality converts data to a recognizable format through encoding. Supported techniques include one-hot, label and categorical encoding.

{% content-ref url="/pages/KYS7VTlgMhHNn8o6sl5L" %}
[Data Encoding (DP\_3)](/autogon-engine-studio/data-processing/data-encoding-dp_3)
{% endcontent-ref %}

## Data Split

This functionality splits data into two subsets: a training set and a test set. The training set is used to train a model, while the test set is used to evaluate its performance.

{% content-ref url="/pages/v2pqMBk0BDs2r5YK9kuK" %}
[Data Split (DP\_4)](/autogon-engine-studio/data-processing/data-split-dp_4)
{% endcontent-ref %}

## Feature Scaling

This functionality normalizes the range of values for different features in the dataset.

{% content-ref url="/pages/Uk52hbKFHK8fBzVKnDYO" %}
[Feature Scaling (DP\_5)](/autogon-engine-studio/data-processing/feature-scaling-dp_5)
{% endcontent-ref %}

## Drop Data Column

This functionality drops specified multiple columns on the X and Y columns.

{% content-ref url="/pages/kc35gPiaTVf0W9nXTV4v" %}
[Drop Columns (DP\_6)](/autogon-engine-studio/data-processing/drop-columns-dp_6)
{% endcontent-ref %}

## Time Stepper

This functionality enables you to transform your data into a time series format.

{% content-ref url="/pages/EMPKVDBb9rNWFeSjr6JO" %}
[Time Stepper (DP\_7)](/autogon-engine-studio/data-processing/time-stepper-dp_7)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** Using the 'Page Link' block lets you link directly to a page. If this page's name, URL or parent location changes, the reference will be kept up to date. You can also mention a page – like [Broken mention](broken://pages/bc4ToVvOSidfb8Vv304g) – if you don't w/sant a block-level link.
{% endhint %}


# Data Input (DP\_1)

Specify the data sources, this functionality can take database connection, CSV, JSON or ZIP files

{% hint style="warning" %}
**NOTE:** If you're using a database connection, create a separate user with appropriate permissions, before uploading data from a database.&#x20;
{% endhint %}

## Sample Request

```javascript
{
    "project_id": 1,
    "parent_id": 0,
    "block_id": 1,
    "function_code": "DP_1",
    "args": {
        "dburl": "https://raw.githubusercontent.com/autogonai/autogon-public-datasets/main/mobile_price_prediction.csv",
        "dbservertype": "",
        "file_type": "csv",
        "database_name": "",
        "dbuser": "",
        "dbpassword": "",
        "query": "",
    }
}
```

## Data input

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

Loads data into a project.

#### Request Body

| Name                                                   | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dburl<mark style="color:red;">\*</mark>                | String | database host or Data Source URL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| file\_type<mark style="color:red;">\*</mark>           | String | File type for data input (`db` for database, `csv` for CSV, `json` for JSON for source files.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| dbservertype                                           | String | database server type (required with `file_type: db`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| database\_name                                         | String | Name of the database (required with `file_type`: `db)`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| dbuser                                                 | String | Username for connecting with database (required with `file_type`: `db)`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| dbpassword                                             | String | Password for connecting with the database (required with `file_type`: `db)`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| query                                                  | String | query to fetch data from the database (required with `file_type`: `db)`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| project\_id<mark style="color:red;">\*</mark>          | int    | current project ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| block\_id<mark style="color:red;">\*</mark>            | int    | current block ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| function\_code<mark style="color:red;">\*</mark>       | String | block's function code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| args<mark style="color:red;">\*</mark>                 | object | block arguments                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| parent\_id                                             | int    | previous block ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| method<mark style="color:red;">\*</mark>               | String | <p>Method of importation.</p><p><br><strong>Options:</strong><br></p><p>'<code>img\_class\_folder</code>': import as an image classification problem with folder names as image class labels<br><br>'<code>img\_csv</code>': import as an image regression or classification problem<br>with image paths listed in a colmn of a csv and target variables on other column(s)<br></p><p>(required with <code>file\_type</code> : <code>zip</code>)</p>                                                                                                                                                                                                                                                                                                                                  |
| images\_path                                           | String | <p>Path to images from zip file's root<br><br>(required with <code>file\_type</code>: <code>zip</code>)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| class\_mode                                            | String | <p>Method of importing target labels or variables<br><br><strong>Options:</strong><br></p><p>'<code>binary</code>': The inputter will return binary labels indicating the class membership of each sample<br><br>'<code>categorical</code>': The inputter will return one-hot encoded labels, where each class is represented by a binary vector with a single 1 and 0s elsewhere</p><p></p><p></p><p>'<code>sparse</code>': Instead of one-hot encoded labels for a multi-classifcation problem, the inputter will return integer labels for each class</p><p></p><p></p><p>'<code>input</code>': The inputter will return the input images as both the input and output.</p><p></p><p></p><p>'<code>raw</code>': The inputter will return the raw data gotten for the y\_column</p> |
| target\_size<mark style="color:red;">\*</mark>         | array  | <p>Image size in pixels (Length, Width)<br><br>(required with <code>file\_type</code>: <code>zip</code>)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| csv\_path<mark style="color:red;">\*</mark>            | String | <p>Path to CSV from zip file's root<br><br>(required with <code>file\_type</code>: <code>zip</code> and <code>method</code>: <code>img\_csv</code>)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| image\_files\_column<mark style="color:red;">\*</mark> | String | <p>Column name of column containing the list of image file names (images within folders aren't allowed)</p><p></p><p>(required with <code>file\_type</code>: <code>zip</code> and <code>method</code>: <code>img\_csv</code>)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| y\_columns                                             | array  | <p>Column names of columns containing target variable(s). Leave empty to include all other columns</p><p></p><p>(required with <code>file\_type</code>: <code>zip</code> and <code>method</code>: <code>img\_csv</code>)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

{% tabs %}
{% tab title="200: OK Data Input Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 2,
        "block_id": 1,
        "parent_id": 0,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
await client.data_input(1, 0, 1, {
    dburl: "https://raw.githubusercontent.com/autogonai/autogon-public-datasets/main/mobile_price_prediction.csv" ,
    file_type: "csv"
})
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** Unlike other block requests, the **Data Input** block isn't permitted to have parent blocks, hence its `null` value.
{% endhint %}


# Automated Data Processing (DP\_ADP)

This function automatically cleans and encodes supported data.

Automated data cleaning and pre-processing streamline the preparation of data for machine learning training. These techniques involve identifying and addressing missing values, outliers, and inconsistencies in the dataset, as well as standardizing and transforming features. By automating these tasks, data scientists can save time, ensure data quality, and enhance the performance and reliability of machine learning models.

## Sample Request

```javascript
{
    "project_id": 1,
    "parent_id": 0,
    "block_id": 1,
    "function_code": "DP_ADP",
    "args": {
        "clean": true,
        "dataset_type": "any",
        "le_thresh": 2
        "load_name": "generated",
        "ohe_thresh": 10,
        "save_name": "generated",
        "strategy_value": "mean",
        "test_size_value": 0.25,
        "x_slice": ":-1",
        "y_slice": "-1"
    }
}
```

## Automated Data Preprocessing

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

#### Request Body

| Name                                                | Type            | Description                                                                                               |
| --------------------------------------------------- | --------------- | --------------------------------------------------------------------------------------------------------- |
| x\_slice<mark style="color:red;">\*</mark>          | String \| array | boundaries for the x dataset                                                                              |
| y\_slice<mark style="color:red;">\*</mark>          | String \| array | boundaries for the y dataset                                                                              |
| strategy\_value                                     | String          | method of handling missing values. Check the Missing Data block                                           |
| le\_thresh                                          | int             | uniques threshold for label encoding                                                                      |
| ohe\_thresh                                         | int             | uniques threshold for one hot encoding                                                                    |
| project\_id<mark style="color:red;">\*</mark>       | int             | current project ID                                                                                        |
| block\_id<mark style="color:red;">\*</mark>         | int             | current block ID                                                                                          |
| function\_code<mark style="color:red;">\*</mark>    | String          | block's function code                                                                                     |
| args<mark style="color:red;">\*</mark>              | object          | block arguments                                                                                           |
| parent\_id                                          | int             | previous block ID                                                                                         |
| excluded\_columns<mark style="color:red;">\*</mark> | array           | Columns to ignore entirely                                                                                |
| excluded\_fillmissing\_columns                      | array           | Columns to ignore for filling in missing data only                                                        |
| excluded\_encoding\_columns                         | array           | Columns to ignore for encoding only                                                                       |
| excluded\_scaling\_columns                          | array           | Columns to ignore for scaling only                                                                        |
| save\_name<mark style="color:red;">\*</mark>        | String          | name to save processing models with                                                                       |
| load\_name<mark style="color:red;">\*</mark>        | String          | name to load processing models with. Used to switch to loading mode                                       |
| dataset\_type                                       | String          | <p>type of dataset being processed with loaded weights.<br><br><code>load\_name</code> required</p>       |
| clean                                               | bool            | <p>set's wether or not to drop duplicates during loading mode<br><br><code>load\_name</code> required</p> |

{% tabs %}
{% tab title="200: OK Data Input Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 2,
        "block_id": 1,
        "parent_id": 0,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
await client.data_input(1, 0, 1, {
    dburl: "https://raw.githubusercontent.com/autogonai/autogon-public-datasets/main/mobile_price_prediction.csv" ,
    file_type: "csv"
})
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** Unlike other block requests, the **Data Input** block isn't permitted to have parent blocks, hence its `null` value.
{% endhint %}


# Missing Data (DP\_2)

This functionality handles missing data using various techniques. e.g mean, mode and more.

Missing data can pose significant challenges in machine learning because many algorithms cannot handle missing values. Therefore, before applying a machine learning algorithm to a dataset with missing values, the missing data must be addressed through some form of data imputation, which involves estimating the missing values from the available data.

There are various techniques for imputing missing data, such as mean imputation, mode imputation, regression imputation, and more advanced methods. The choice of imputation technique depends on the nature of the missing data and the goals of the analysis. However, it is essential to handle missing data appropriately to prevent biases and errors in the machine learning model.

## Sample Request

This request uses the mean strategy to fill in missing values in the second column to the end with the mean values of the X variable.

```javascript
{
    "project_id": 1,
    "parent_id": 1,
    "block_id": 2,
    "function_code": "DP_2",
    "args": {
        "strategy_value": "mean",
        "boundaries": ":, 2:"
    }
}
```

## Missing Data

## Handle missing data

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

Handles missing data rows in the dataset either by deletion of such rows or filling in with a specified method.

#### Request Body

| Name                                              | Type   | Description                        |
| ------------------------------------------------- | ------ | ---------------------------------- |
| project\_id<mark style="color:red;">\*</mark>     | int    | current project ID                 |
| parent\_id<mark style="color:red;">\*</mark>      | int    | parent block ID                    |
| block\_id<mark style="color:red;">\*</mark>       | int    | current block ID                   |
| function\_code<mark style="color:red;">\*</mark>  | String | block's function code              |
| strategy\_value<mark style="color:red;">\*</mark> | String | strategy for handling missing data |
| boundaries                                        | String | slicing boundaries for x features  |
| args                                              | object | block arguments                    |

{% tabs %}
{% tab title="200: OK Missing Data Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 2,
        "project": 1,
        "block_id": 2,
        "parent_id": 1,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Data Encoding (DP\_3)

This functionality converts data to a recognizable format through encoding. Supported techniques including, but are not limited to, one-hot, label and categorical encoding.

This process involves converting data into a format that can be understood by a computer. This can include converting text into numerical values, or categorizing data into discrete groups. The goal of encoding is to make it possible for a machine learning algorithm to interpret and learn from the data.

There are many different types of encoding techniques, such as one-hot encoding, which converts categorical data into a binary format, and label encoding, which assigns a unique numerical value to each category in a categorical variable. The appropriate encoding technique depends on the type of data and the machine learning algorithm being used.

## Sample Request

This request encodes categorical values in the X variable with `one-hot` method, ignoring values in the Y variable.

```javascript
{
    "project_id": 1,
    "parent_id": 2,
    "block_id": 3,
    "function_code": "DP_3",
    "args": {
        "xvalue": {
            "encode": true,
            "encoding_type": "onehot",
            "remainder": "passthrough",
            "index": 0
        },
        "yvalue": {
            "encode": false,
            "encoding_type": "categorical",
            "remainder": "drop",
            "index": 2
        }
        "save_name": "testweights",
        "load_name": "testweights"
    }
}
```

## Encoding Data

## Encode categorical values

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

Encodes categorical data on specific columns with specified boundaries

#### Request Body

| Name                                             | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | current project ID                                                                                                                                                                                                                                                                                                                                                                                         |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                                                                                                                                                                                                                                                                                                                                                                            |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                                                                                                                                                                                                                                                                                                                                                                           |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                                                                                                                                                                                                                                                                                                                                                                                      |
| xvalue/yvalue<mark style="color:red;">\*</mark>  | object | arguments for X or Y variables                                                                                                                                                                                                                                                                                                                                                                             |
| encode<mark style="color:red;">\*</mark>         | bool   | specify if variable is encoded                                                                                                                                                                                                                                                                                                                                                                             |
| args                                             | object | block arguments                                                                                                                                                                                                                                                                                                                                                                                            |
| encoding\_type<mark style="color:red;">\*</mark> | String | <p>One-Hot Encoding: Converts categories into binary columns.<br><br>Label Encoding: Assigns numbers to categories.</p><p></p><p>Binary Encoding: Represents categories as binary codes.</p><p></p><p>Target Encoding: Replaces categories with target stats.</p><p></p><p>String to Hash Encoding: Hashes strings to numbers.</p><p></p><p>Extract Numbers Encoding: Converts text numbers to digits.</p> |
| remainder<mark style="color:red;">\*</mark>      | String | applied method to none specified columns; `drop` drops the unspecified columns for encoding, `passthrough` ignores unspecified columns                                                                                                                                                                                                                                                                     |
| index<mark style="color:red;">\*</mark>          | int    | column index to apply encoding technique                                                                                                                                                                                                                                                                                                                                                                   |
| save\_name                                       | String | name to save processing models with.                                                                                                                                                                                                                                                                                                                                                                       |
| load\_name                                       | String | name to load processing models with. Used to switch to loading mode                                                                                                                                                                                                                                                                                                                                        |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 3,
        "parent_id": 2,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Data Split (DP\_4)

This functionality splits data into two subsets: a training set and a test set. The training set is used to train a model, while the test set is used to evaluate its performance.

This process of separating data into two sets is a crucial step in the process of developing and evaluating machine learning models. It ensures that the model is able to generalize well to new, unseen data, and it also allows for a more accurate assessment of the model's performance.

This functionality of splitting data into training and test sets is widely used in the field of machine learning and data science.

## Sample Request

This request uses the mean strategy to fill in missing values in the second column to the end with the mean values of the X variable.

```javascript
{
    "project_id": 1,
    "parent_id": 3,
    "block_id": 4,
    "function_code": "DP_4",
    "args": {
        "test_size": 0.3,
        "random_state": 0
    }
}
```

## Splitting Data

## Splits data

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

Splitting data into training and test data.

#### Request Body

| Name                                             | Type      | Description                                                                                                                                                                                                                                  |
| ------------------------------------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int       | current project ID                                                                                                                                                                                                                           |
| parent\_id<mark style="color:red;">\*</mark>     | int       | parent block ID                                                                                                                                                                                                                              |
| block\_id<mark style="color:red;">\*</mark>      | int       | current block ID                                                                                                                                                                                                                             |
| function\_code<mark style="color:red;">\*</mark> | String    | block's function code                                                                                                                                                                                                                        |
| args                                             | object    | block arguments                                                                                                                                                                                                                              |
| test\_size                                       | float/int | If `float`, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the test split. If `int`, represents the absolute number of test samples. If None, the value is set to the complement of the train size. |
| random\_state                                    | int       | Controls the shuffling applied to the data before applying the split.                                                                                                                                                                        |

{% tabs %}
{% tab title="200: OK Feature Scaling Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 4,
        "project": 1,
        "block_id": 4,
        "parent_id": 3,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Feature Scaling (DP\_5)

This functionality normalizes the range of values for different features in the dataset

This process is very important because many machine learning algorithms use the Euclidean distance between two points in their computations, and if the ranges of the features are vastly different, then the algorithm will be sensitive to the feature with the larger range, and may produce unexpected results.

## Sample Request

This request scales the feature sets defined in the range of columns for training and testing.

```javascript
{
    "project_id": 1,
    "parent_id": 4,
    "block_id": 5,
    "function_code": "DP_5",
    "args": {
        "dataset": true,
        "xtrain": true,
        "xtest": true,
        "x": true,
        "ytrain": true,
        "ytest": true,
        "y": true,
        "scaler": "maxabs",
        "boundariestoscale": ":, 2:",
        "save_name": "testweights",
        "load_name": "testweights"
    }
}
```

## Missing Data

## Encode categorical values

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

Encodes categorical data on specific columns with specified boundaries

#### Request Body

| Name                                             | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| project\_id<mark style="color:red;">\*</mark>    | int     | current project ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| parent\_id<mark style="color:red;">\*</mark>     | int     | parent block ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| block\_id<mark style="color:red;">\*</mark>      | int     | current block ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| function\_code<mark style="color:red;">\*</mark> | String  | block's function code                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| encode<mark style="color:red;">\*</mark>         | boolean | specify if variable is encoded                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| args                                             | object  | block arguments                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| remainder<mark style="color:red;">\*</mark>      |         | applied method to none specified columns; `drop` drops the unspecified columns for encoding, `passthrough` ignores unspecified columns                                                                                                                                                                                                                                                                                                                                               |
| index<mark style="color:red;">\*</mark>          | int     | column index to apply encoding technique                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| scaler                                           | String  | <p>Type of scaler to use:<br><br><code>'minmax'</code> : transforms data to a 0-1 range.<br></p><p><code>'standard'</code> : transforms data to have zero mean and unit variance.<br></p><p><code>'robust'</code> : scaling technique that is less sensitive to outliers in the data.<br></p><p><code>'maxabs'</code> : scaling technique that scales the data by dividing each feature by its maximum absolute value, preserving the sign of the values while normalizing them.</p> |
| save\_name                                       |         | name to save processing models with.                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| load\_name                                       | String  | name to load processing models with. Used to switch to loading mode                                                                                                                                                                                                                                                                                                                                                                                                                  |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 3,
        "parent_id": 2,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Drop Columns (DP\_6)

This functionality drops specified multiple columns on the X and Y columns.

With this, you can easily drop one or multiple columns that are not relevant or redundant to your analysis. The process of removing columns is straightforward and user-friendly, simply select the columns you want to drop and the tool will do the rest.&#x20;

The remaining columns will be updated in real-time to reflect the changes made, and the modified dataset can be saved for future use.

## Sample Request

This request drops columns on index 0, 1, 3, and 8 in the X variable.

```json
{
    "project_id": 1,
    "parent_id": 5,
    "block_id": 6,
    "function_code": "DP_6",
    "args": {
        "x_columns": [0, 1, 3, 8],
        "y_columns": [],
        "d_columns": []
    }
}
```

## Drop Specific Columns

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

Drop specified multiple columns

#### Request Body

| Name                                             | Type   | Description           |
| ------------------------------------------------ | ------ | --------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | current project ID    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code |
| args                                             | object | block arguments       |

{% tabs %}
{% tab title="200: OK Drop Column Successful" %}

```json
{
    "status": true,
    "message": {
        "id": 00000,
        "project": 0,
        "block_id": 0,
        "parent_id": 0,
        "dataset_url": "https://storage.autogon.ai/dataset.csv",
        "function_action": 00
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Time Stepper (DP\_7)

This functionality enables you to transform your data into a time series format.

A time series is a series of data points collected or recorded at regular time intervals. By transforming your data into a time series format, you can easily analyze trends and patterns over time, which can be useful for forecasting future values or making informed decisions.&#x20;

The process of transforming data into a time series is simple, you just need to specify the time column and we automatically convert the data into a time series format.

## Sample Request

This request steps the data per 60 entries and replaces existing data in the Y variable.

```javascript
{
    "project_id": 1,
    "parent_id": 6,
    "block_id": 7,
    "function_code": "DP_7",
    "args": {
        "lookback": 60,
        "lookforward": 1,
        "index": 4
    }
}
```

## Time Stepper

## Step data into time series

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

Step data per entries or replace existing data in the Y variable.

#### Request Body

| Name                                             | Type   | Description                                                                                                                                                          |
| ------------------------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | current project ID                                                                                                                                                   |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                                                                                                                                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                                                                                                                                     |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                                                                                                                                                |
| lookback<mark style="color:red;">\*</mark>       | int    | determines how many past time steps the model should consider when making predictions. It influences the length of the input sequence used to predict the next value |
| args                                             | object | block arguments                                                                                                                                                      |
| index<mark style="color:red;">\*</mark>          | int    | column index to apply time stepping function                                                                                                                         |
| lookforward                                      | int    | defines how many future time steps the model should predict ahead. It indicates the distance into the future the model aims to forecast. Defaults to 1               |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
```

{% endtab %}
{% endtabs %}


# Parse Datetime (DP\_PDT)

In data analysis and various applications, datetime information is a crucial component. To leverage this information effectively, we rely on the process of datetime data parsing.

DateTime data parsing involves extracting meaningful details from datetime values and converting them into formats that computers can understand. This process includes breaking down datetime strings into individual components such as year, month, day, hour, minute, and second.

By parsing datetime data, we enable our systems to recognize and use chronological patterns. For example, in financial analysis, parsing datetime information allows us to identify trading hours, weekdays, or specific times of the day.

The parsed datetime data can then be employed to align different datasets, create time-based features, and enable sophisticated chronological analyses. Whether it's for predicting trends, analyzing patterns, or understanding user interactions, datetime data parsing empowers us to unlock valuable insights embedded within time-related data.

## Sample Request

```javascript
{
    "project_id": 1,
    "parent_id": 5,
    "block_id": 6,
    "function_code": "DP_PDT",
    "args": {
        "index": 0,
        "drop": true
    }
}
```

## Request Parameters

## Parse Datetime

<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    | current project ID                                                       |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                                          |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                                         |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                                                    |
| drop<mark style="color:red;">\*</mark>           | bool   | specifies if you want to drop the column after parsing the original date |
| args                                             | object | block arguments                                                          |
| index<mark style="color:red;">\*</mark>          | int    | column index to apply time stepping function                             |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
```

{% endtab %}
{% endtabs %}


# Reorder Columns (DP\_ROC)

The process of reordering columns involves changing the sequence of columns to better suit the needs of analysis, visualization, or downstream processes.

Reordering columns is a fundamental data preprocessing step that can be achieved using various programming tools and libraries, such as pandas in Python. This operation is particularly valuable when dealing with datasets that have a large number of columns, as it helps streamline data analysis workflows and enhances data clarity.

The procedure usually involves specifying the desired order of columns, often by providing a list or defining the new column order. Libraries like pandas offer functions like `reorder_columns` that take the specified order as an input and generate a new dataframe with columns rearranged accordingly.

In practical scenarios, reordering columns can be employed for tasks like bringing essential information to the forefront, grouping related columns together, or ensuring a more intuitive flow of data. For instance, in a financial dataset, one might reorder columns to arrange date-related columns in chronological order, followed by transactional details, and then supplementary information.

## Sample Request

```javascript
{
    "project_id": 1,
    "parent_id": 5,
    "block_id": 6,
    "function_code": "DP_ROC",
    "args": {
        "column": 1,
        "posititon": 3,
        "dataset": false,
        "xtrain": true,
        "xtest": true,
        "x": true,
        "ytrain": false,
        "ytest": false,
        "y": false
    }
}
```

## Request Parameters

## Reorder Columns

<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    | current project ID                    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                 |
| args                                             | object | block arguments                       |
| position<mark style="color:red;">\*</mark>       | int    | specifies new position in the dataset |
| column<mark style="color:red;">\*</mark>         | int    | specifies column to move              |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
```

{% endtab %}
{% endtabs %}


# Feature Sampling (DP\_FSP)

This functionality samples a dataset into X and Y features

When you have a dataset with many features, it can be difficult to determine which features are most relevant for making predictions. Feature sampling is a technique that involves randomly selecting a subset of features from the dataset to use in a machine learning model.

To perform feature sampling, you would typically split the dataset into two parts: the X features and the Y features. The X features are the input features, which are used to make predictions, while the Y features are the output features, which are the values that you are trying to predict.

## Sample Request

This request splits the dataset into X and Y values based on the specified boundaries

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "DP_FSP",
    "args": {
        "x_boundaries": ":, :-1",
        "y_boundaries": ":, -1"
    }   
}
```

## Feature Sampling

## Sample data into X and Y

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

Split the dataset into X and Y values

#### Request Body

| Name                                             | Type   | Description                       |
| ------------------------------------------------ | ------ | --------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | current project ID                |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                   |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                  |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code             |
| x\_boundaries<mark style="color:red;">\*</mark>  | String | slicing boundaries for x features |
| args                                             | object | block arguments                   |
| y\_boundaries<mark style="color:red;">\*</mark>  | String | slicing boundaries for y features |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Reshape Array (DP\_RSH)

This function takes an input array of data and reshapes it into a time series format. The resulting time series data can be used for time-based analysis, modeling, and forecasting.

Reshaping Arrays is a functionality used in data processing to transform data into a different shape. This can be useful when working with data that needs to be reorganized to be used in an analysis or modeling. The reshaping operation involves changing the number of dimensions, the size of each dimension, or both, of an input array to obtain a new output array with a different shape.

To reshape an array, you need to specify the input array and the desired shape of the output array. The shape of the output array can be defined using a tuple or a list of integers representing the size of each dimension.

## Sample Request

This request reshapes the passed data to a specified dimension

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_RSH",
    "args": {
        "data": "",
        "dimensions": [2, 21000]
    }
}
```

## Reshaping Arrays

## Reshapes an array based on specified dimensions

<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    | current project ID                                                                                                                  |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                                                                                                     |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                                                                                                    |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                                                                                                               |
| data<mark style="color:red;">\*</mark>           | String | The input data to be reshaped. This can be a URL to a CSV file                                                                      |
| args                                             | object | block arguments                                                                                                                     |
| dimensions<mark style="color:red;">\*</mark>     | Array  | The new dimensions to reshape the input data to. The number of dimensions must be the same as the number of axes in the input data. |

{% tabs %}
{% tab title="200: OK Reshape Array Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Column Astype (DP\_ASP)

This function casts a column to a specified datatype

This is a useful block in data processing that allows you to convert the data type of a column to a specified type. It provides flexibility in handling and transforming data by allowing you to change the data type of one or more columns.

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_ASP",
    "args": {
        "astype": "int32",
        "columns": [0, 5, 7]
    }
}
```

## Parameter Details

## Column Astype

<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    | current project ID               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                  |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                 |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code            |
| astype<mark style="color:red;">\*</mark>         | String | New datatype                     |
| args<mark style="color:red;">\*</mark>           | object | block arguments                  |
| columns<mark style="color:red;">\*</mark>        | Array  | Columns to apply type conversion |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
// Column AsType
const Client = require("./src/client");

let client = new Client(process.env.AUTOGON_API_KEY);

projectId = 41;
parentId = 9;
blockId = 10;

dataInput = (await client.columns_astype(projectId, parentId, blockId, {
    astype: "int32",
    columns: [0, 5, 7]
})).data;
```

{% endtab %}
{% endtabs %}


# Show Duplicates (DP\_SDC)

This function shows duplicates

This is a useful block in data processing that exposes duplicated rows in preparation for a data clean up

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_SDC",
    "args": {
        "columns": [0, 5, 7]
    }
}
```

## Parameter Details

## Show Duplicates

<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    | current project ID                   |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                     |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                |
| args<mark style="color:red;">\*</mark>           | object | block arguments                      |
| columns<mark style="color:red;">\*</mark>        | Array  | Columns to check for duplicates with |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Drop Duplicates (DP\_DRD)

This function drops duplicated rows

This is a useful block in data processing that drops duplicated rows in preparation for a data clean up

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_DRD",
    "args": {
        "columns": [0, 5, 7]
    }
}
```

## Parameter Details

## Drop Duplicates

<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    | current project ID                   |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                     |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                |
| args<mark style="color:red;">\*</mark>           | object | block arguments                      |
| columns<mark style="color:red;">\*</mark>        | Array  | Columns to check for duplicates with |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Scalar to Ndarray (DP\_STN)

This function "listifies" the scalar value

This function "listifies" the scalar value n number of times and saves the output to the output field

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_STN",
    "args": {
        "scalar": [89, 13, 13, 345, 34, 332, 68, 39, 83, 73],
        "dimensions": 3
    }
}
```

## Parameter Details

## Scalar to Ndarray

<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    | current project ID                              |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                 |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                           |
| args<mark style="color:red;">\*</mark>           | object | block arguments                                 |
| dimensions<mark style="color:red;">\*</mark>     | float  | The new number of dimensions. The "ndim" number |
| scalar<mark style="color:red;">\*</mark>         | array  | The input scalar array                          |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Image to Ndarray (DP\_ITN)

This function creates an image array

This function converts an image from a URL to a JSON array

## Sample Request

```javascript
{
    "block_id": 9,
    "project_id": 229,
    "parent_id": 8,
    "function_code": "DP_ITN",
    "args": {
        "image_url": "https://consolidatedlabel.com/app/uploads/2007/10/high-res-300dpi.jpg",
        "target_size": [28,28],
        "rescale": true
    }
}
```

## Parameter Details

## Image to Ndarray

<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     | current project ID                                                                                    |
| parent\_id<mark style="color:red;">\*</mark>     | int     | parent block ID                                                                                       |
| block\_id<mark style="color:red;">\*</mark>      | int     | current block ID                                                                                      |
| function\_code<mark style="color:red;">\*</mark> | String  | block's function code                                                                                 |
| args<mark style="color:red;">\*</mark>           | object  | block arguments                                                                                       |
| target\_size<mark style="color:red;">\*</mark>   | array   | The target size of the image array                                                                    |
| image\_url<mark style="color:red;">\*</mark>     | String  | Path to uploaded image                                                                                |
| rescale                                          | boolean | <p>specifies wether the image array should be scaled between 0-1</p><p>Default: <code>true</code></p> |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Dataset Info (DP\_INF)

This function shows dataset info

This is a useful block in data processing that shows dataset information in the output field of the block

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_ASP",
    "args": {}
}
```

## Parameter Details

## Dataset Info

<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    | current project ID    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code |
| args<mark style="color:red;">\*</mark>           | object | block arguments       |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Dataset Correlations (DP\_CRR)

This function shows dataset correlations

This is a useful block in data processing that shows dataset correlations in the output field of the block

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_CRR",
    "args": {}
}
```

## Parameter Details

## Dataset Correlations

<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    | current project ID    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code |
| args<mark style="color:red;">\*</mark>           | object | block arguments       |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Dataset Description (DP\_DSC)

This function shows dataset descriptions

This is a useful block in data processing that shows dataset descriptions of all columns within the dataset and saves the output in the output field

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_DSC",
    "args": {}
}
```

## Parameter Details

## Dataset Description

<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    | current project ID    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code |
| args<mark style="color:red;">\*</mark>           | object | block arguments       |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Dataset Datatypes (DP\_DTY)

This function shows dataset datatypes

This is a useful block in data processing that shows dataset datatypes of all columns within and saves it to the output field

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_DTY",
    "args": {}
}
```

## Parameter Details

## Dataset Datatypes

<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    | current project ID    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code |
| args<mark style="color:red;">\*</mark>           | object | block arguments       |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Dataset Uniques (DP\_UNQ)

This function shows the number of unique data classes

This is a useful block in data processing that shows the number of distinct elements in each column

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_UNQ",
    "args": {}
}
```

## Parameter Details

## Dataset Uniques

<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    | current project ID    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code |
| args<mark style="color:red;">\*</mark>           | object | block arguments       |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Dataset Stats Counts (DP\_STC)

This function shows the number of unique data classes within a specific column

This is a useful block in data processing that shows the number of distinct elements in a specific column

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_STC",
    "args": {
        "index": 3
    }
}
```

## Parameter Details

## Dataset Stats Counts

<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    | current project ID    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code |
| args<mark style="color:red;">\*</mark>           | object | block arguments       |
| index<mark style="color:red;">\*</mark>          | int    | the column index      |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Principal Component Analysis (DP\_PCA)

This function reduces the dimensionality using PCA

Linear dimensionality reduction using Singular Value Decomposition of the data to project it to a lower dimensional space. The input data is centered but not scaled for each feature before applying the SVD

## Sample Request

<pre class="language-javascript"><code class="lang-javascript">{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_PCA",
    "args": {
<strong>        "n_components": 3,
</strong><strong>        "dataset": false,
</strong>        "xtrain": true,
        "xtest": true,
        "x": true,
        "ytrain": false,
        "ytest": false,
        "y": false
    }
}
</code></pre>

## Parameter Details

## Principal Component Analysis

<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    | current project ID                                                                                                                                   |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                                                                                                                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                                                                                                                     |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                                                                                                                                |
| args<mark style="color:red;">\*</mark>           | object | block arguments                                                                                                                                      |
| n\_components                                    | float  | <p>int, float or 'mle'</p><p></p><p>Number of components to keep. If n\_components is not set, all components are kept<br><br>Defaults to 'null'</p> |
| dataset/x/y/xtrain/ytrain/xtest/ytest            | bool   | variables to apply function                                                                                                                          |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Text Vectorizer (DP\_VEC)

Transform textual data into numerical representations that are compatible with machine learning models, enabling efficient processing of text-based tasks.

Text Vectorizers are tools used to convert textual data into numerical representations suitable for machine learning models. They process text inputs and transform them into feature vectors, enabling the API to perform natural language processing and text-based tasks efficiently.

Supported Vectorizers:

1. TF-IDF Vectorizer: Assigns weights to words based on their importance in a document and rarity across the dataset, capturing their significance for modeling.
2. Count Vectorizer: Counts the occurrences of each word in a document, representing it as a sparse matrix with word frequencies.
3. Hashing Vectorizer: Converts words into numerical indices using a hashing trick, providing memory-efficient representations.

These vectorizers are crucial for handling text data in the API, facilitating tasks like text classification, sentiment analysis, and other natural language processing tasks.

## Sample Request

The request performs text vectorization using the TF-IDF vectorizer with specified boundaries to scale the data on the specified variables.

```javascript
{
    "project_id": 1,
    "parent_id": 5,
    "block_id": 6,
    "function_code": "DP_VEC",
    "args": {
        "vectorizer": "tfidf",
        "boundariestoscale": ":, :",
        "dataset": false,
        "xtrain": true,
        "xtest": true,
        "x": true,
        "ytrain": false,
        "ytest": false,
        "y": false
    }
}

```

## Parameter Details

## Principal Component Analysis

<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    | current project ID                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| args<mark style="color:red;">\*</mark>           | object | block arguments                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| boundariestoscale                                | String | boundaries to vectorize                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| dataset/x/y/xtrain/ytrain/xtest/ytest            | bool   | variables to apply vectorizer                                                                                                                                                                                                                                                                                                                                                                                                                              |
| vectorizer                                       | String | <p>Type of vectorizer to apply:</p><p></p><p><code>tfidf</code> : Converts text data into numerical features based on term frequency-inverse document frequency, capturing word importance in documents and across the corpus.</p><p></p><p><code>count</code>: Transforms text data into numerical features by counting the occurrences of words</p><p></p><p><code>hashing</code>: Uses a hashing trick to map words into fixed-size feature vectors</p> |

{% tabs %}
{% tab title="200: OK Text Vectorization Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Resampler (DP\_RES)

Resample input datasets using specified resampling techniques.

Resampling helps in providing more flexibility when handling imbalanced datasets.

Supported Resampling Techniques:

1. RandomOverSampler:
2. SMOTE
3. RandomUnderSampler
4. TomekLinks
5. SMOTETomek

Args:

xy\_train (bool): Flag indicating whether to resample the training dataset.&#x20;

xy\_test (bool): Flag indicating whether to resample the testing dataset.&#x20;

xy (bool): Flag indicating whether to resample main x and y datasets.&#x20;

resampler (str): The name of the resampling technique to use.&#x20;

details (object): Object containing dataset details.

&#x20;load\_name (object): Name of a saved resampler object, for loading.&#x20;

save\_name (str): Name to save the resampler object as.

## Sample Request

The request performs resampling operation using the SMOTE technique

```json
{
    "block_id": 000,
    "project_id": 000,
    "parent_id": 000,
    "function_code": "DP_RES",
    "args": {
        "xy": true,
        "xy_train": false,
        "xy_test": false,
        "resampler": "SMOTE",
        "save_name": "test"
    }
}
```

## Parameter Details

<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    | current project ID    |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID      |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID       |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code |
| args<mark style="color:red;">\*</mark>           | object | block arguments       |


# Data Visualization


# Scatter Plots (DP\_SCP)

This function creates scatter plots for pairs of columns in a given input dataset. Scatter plots are a useful visualization tool for examining the relationship between two variables.

Scatter plots are a type of data visualization that display the relationship between two variables. Each point on the plot represents a pair of values for the two variables being compared. Scatter plots are useful for identifying patterns or trends in data, and for detecting outliers or unusual observations.

To create a scatter plot, you need to specify the x and y values to be plotted. These values can be provided in the form of arrays or data frames. You can also choose to display a grid on the plot by setting the "is\_grid" parameter to true.

## Sample Request

```javascript
{
    "project_id": 1,
    "block_id": ,
    "parent_id": 0,
    "function_code": "DP_SCP",
    "args": {
        "xvalue": "http://cloud.autogonai.s3.amazonaws.com/143ac49a-7bbc-4224-a58e-d6811930b86b.csv",
        "yvalue": "http://cloud.autogonai.s3.amazonaws.com/1a65c19c-b891-4be3-bbfe-ed5c5ec58207.csv",
        "is_grid": true

    }
}
```

## Parameter Details

## Scatter Plots

<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    | current project ID                                                                                    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                                                                       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                                                                      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                                                                                 |
| xvalue<mark style="color:red;">\*</mark>         | String | The input data representing the x-axis values. This can be a string representing a URL to a CSV file. |
| args                                             | object | block arguments                                                                                       |
| yvalue<mark style="color:red;">\*</mark>         | String | The input data representing the y-axis values. This can be a string representing a URL to a CSV file. |
| is\_grid                                         | Bool   | Whether to enable grid in the scatter plot. Default is `False.`                                       |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Ordinary Plots (DP\_ORD)

This function creates ordinary line plots for pairs of columns in a given input dataset.

Ordinary line plots, also known as line charts or line graphs, are a common visualization technique used to display the relationship between two continuous variables. They are particularly useful for showing trends and patterns over time or across different categories.

## Sample Request

```javascript
{
    "project_id": 1,
    "block_id": ,
    "parent_id": 0,
    "function_code": "DP_ORD",
    "args": {
        "xvalue": "http://cloud.autogonai.s3.amazonaws.com/143ac49a-7bbc-4224-a58e-d6811930b86b.csv",
        "yvalue": "http://cloud.autogonai.s3.amazonaws.com/1a65c19c-b891-4be3-bbfe-ed5c5ec58207.csv",
        "is_grid": true

    }
}
```

## Parameter Details

## Ordinary Plots

<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    | current project ID                                                                                    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                                                                       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                                                                      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                                                                                 |
| xvalue<mark style="color:red;">\*</mark>         | String | The input data representing the x-axis values. This can be a string representing a URL to a CSV file. |
| args                                             | object | block arguments                                                                                       |
| yvalue<mark style="color:red;">\*</mark>         | String | The input data representing the y-axis values. This can be a string representing a URL to a CSV file. |
| is\_grid                                         | Bool   | Whether to enable grid in the scatter plot. Default is `False.`                                       |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Compare Scatter Plots (DP\_CSP)

This function compares scatter plots for pairs of columns in a given input dataset

Scatter plots are a type of data visualization that display the relationship between two variables. Each point on the plot represents a pair of values for the two variables being compared. Scatter plots are useful for identifying patterns or trends in data, and for detecting outliers or unusual observations.

## Sample Request

This request reshapes the passed data to a specified dimension

```javascript
{
    "project_id": 1,
    "block_id": ,
    "parent_id": 0,
    "function_code": "DP_CSP",
    "args": {
        "avalue": "http://cloud.autogonai.s3.amazonaws.com/1a65c19c-b891-4be3-bbfe-ed5c5ec58207.csv",
        "bvalue": "http://cloud.autogonai.s3.amazonaws.com/143ac49a-7bbc-4224-a58e-d6811930b86b.csv",
        "xvalue": "http://cloud.autogonai.s3.amazonaws.com/143ac49a-7bbc-4224-a58e-d6811930b86b.csv",
        "yvalue": "http://cloud.autogonai.s3.amazonaws.com/1a65c19c-b891-4be3-bbfe-ed5c5ec58207.csv",
        "is_grid": true

    }
}
```

## Parameter Details

## Compare Scatter Plots

<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    | current project ID                                                                                                       |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                                                                                                          |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                                                                                                         |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                                                                                                    |
| xvalue<mark style="color:red;">\*</mark>         | String | The input data representing the x-axis values on the first plot. This can be a string representing a URL to a CSV file.  |
| args                                             | object | block arguments                                                                                                          |
| yvalue<mark style="color:red;">\*</mark>         | String | The input data representing the y-axis values on the second plot. This can be a string representing a URL to a CSV file. |
| is\_grid                                         | Bool   | Whether to enable grid in the scatter plot. Default is `False.`                                                          |
| avalue                                           | String | The input data representing the x-axis values on the first plot. This can be a string representing a URL to a CSV file.  |
| bvalue                                           | String | The input data representing the y-axis values on the second plot. This can be a string representing a URL to a CSV file. |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Pie Plots (DP\_PIE)

This function creates pie plots for a given input dataset.

Pie plots, also known as pie charts, are a simple and effective way to visualize data proportions or percentages in a circular format. They are particularly useful for displaying categorical data and showing the distribution or composition of different categories within a whole. Each category is represented by a wedge-shaped slice, with the size of the slice corresponding to the proportion or percentage it represents. Pie plots provide a quick and intuitive

## Sample Request

```javascript
{
    "project_id": 1,
    "block_id": ,
    "parent_id": 0,
    "function_code": "DP_PIE",
    "args": {
        "dataset": "http://cloud.autogonai.s3.amazonaws.com/1a65c19c-b891-4be3-bbfe-ed5c5ec58207.csv"
    }
}
```

## Parameter Details

## Pie Plots

<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    | current project ID                 |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                    |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                   |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code              |
| args<mark style="color:red;">\*</mark>           | object | block arguments                    |
| dataset<mark style="color:red;">\*</mark>        | String | URL for dataset to be plotted from |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Heatmap Plots (DP\_HMP)

This function creates heatmap plots for a given input dataset.

A heatmap plot is a visualization technique that uses color-coded cells to represent the values of a two-dimensional dataset. It provides a quick and intuitive way to identify patterns, relationships, and variations in the data. Heatmap plots are commonly used in data analysis, exploratory data visualization, and correlation analysis.

## Sample Request

```javascript
{
    "project_id": 1,
    "block_id": ,
    "parent_id": 0,
    "function_code": "DP_HMP",
    "args": {
        "dataset": "http://cloud.autogonai.s3.amazonaws.com/1a65c19c-b891-4be3-bbfe-ed5c5ec58207.csv"
    }
}
```

## Parameter Details

## Heatmap Plots

<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    | current project ID                 |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                    |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                   |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code              |
| args<mark style="color:red;">\*</mark>           | object | block arguments                    |
| dataset<mark style="color:red;">\*</mark>        | String | URL for dataset to be plotted from |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}


# Machine Learning

This subset focuses on building systems that learn or improve performance based on the data they consume.

Discover the specifics of each method associated with building powerful machine learning models from scratch, making predictions and solving problems easily

## Simple Linear Regression

This function models the relationship between two continuous variables. The objective is to predict the value of an output variable based on the value of an input variable.

{% content-ref url="/pages/DbapNUJWsFnFhByXiC1G" %}
[Simple Linear Regression (ML\_R\_1)](/autogon-engine-studio/machine-learning/simple-linear-regression-ml_r_1)
{% endcontent-ref %}

## Multiple Linear Regression

This function models the relationship between more independent variables. The objective is to predict the value of an output variable based on the value of input variables.

{% content-ref url="/pages/Og4jxQ2bZ2JW8bey7qE1" %}
[Multiple Linear Regression (ML\_R\_2)](/autogon-engine-studio/machine-learning/multiple-linear-regression-ml_r_2)
{% endcontent-ref %}

## Polynomial Linear Regression

This function uses the relationship between variables to find the best non-linear fit through the data points.

{% content-ref url="/pages/rvmKAClKdCk0LFpGRpBg" %}
[Polynomial Linear Regression (ML\_R\_3)](/autogon-engine-studio/machine-learning/polynomial-linear-regression-ml_r_3)
{% endcontent-ref %}

## Support Vector Regression

This function can be used for solving both linear and non-linear problems.

{% content-ref url="/pages/YAdV0wmljZ9h3N4HBBxU" %}
[Support Vector Regression (ML\_R\_4)](/autogon-engine-studio/machine-learning/support-vector-regression-ml_r_4)
{% endcontent-ref %}

## Decision Tree Regression

This function splits the data into smaller subsets while at the same time an associated decision rule is used to predict the target variable, built in the form of a tree structure.

{% content-ref url="/pages/uYNB55eqtrazQuvy34ry" %}
[Decision Tree Regression (ML\_R\_5)](/autogon-engine-studio/machine-learning/decision-tree-regression-ml_r_5)
{% endcontent-ref %}

## Random Forest Regression

This function builds multiple decision trees and combines their outputs to make a final prediction.

{% content-ref url="/pages/A7qwmMWp7V0j5kfdq32t" %}
[Random Forest Regression (ML\_R\_6)](/autogon-engine-studio/machine-learning/random-forest-regression-ml_r_6)
{% endcontent-ref %}

## Logistic Regression

This function performs analysis on a dataset and returns the predicted binary outcome based on the input independent variables.

{% content-ref url="/pages/YGBhkmI9mkZvbaDh2ccl" %}
[Logistic Regression (ML\_CN\_1)](/autogon-engine-studio/machine-learning/logistic-regression-ml_cn_1)
{% endcontent-ref %}

## K-Nearest Neighbours

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

{% content-ref url="/pages/zzgVbR9CAPOzXHWqpiXd" %}
[K-Nearest Neighbors - KNN (ML\_CN\_2)](/autogon-engine-studio/machine-learning/k-nearest-neighbors-knn-ml_cn_2)
{% endcontent-ref %}

## Support Vector Machine

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

{% content-ref url="/pages/joog1HdIq45cGAvNnOPU" %}
[Support Vector Machine (ML\_CN\_3)](/autogon-engine-studio/machine-learning/support-vector-machine-ml_cn_3)
{% endcontent-ref %}

## Kernel SVM

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

{% content-ref url="/pages/RMCpV9Q5cNj8rAmJYQmu" %}
[Kernel SVM (ML\_CN\_4)](/autogon-engine-studio/machine-learning/kernel-svm-ml_cn_4)
{% endcontent-ref %}

## Naive Bayes

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

{% content-ref url="/pages/OMFXhT52Rbx5tZVfyAKS" %}
[Naive Bayes (ML\_CN\_5)](/autogon-engine-studio/machine-learning/naive-bayes-ml_cn_5)
{% endcontent-ref %}

## Decision Tree Classification

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

{% content-ref url="/pages/W301YLHozh2fZYrJn6Vb" %}
[Decision Tree Classification (ML\_CN\_6)](/autogon-engine-studio/machine-learning/decision-tree-classification-ml_cn_6)
{% endcontent-ref %}

## Random Forest Classification

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

{% content-ref url="/pages/sTwb1plRIVVOdi1JGUIG" %}
[Random Forest Classification (ML\_CN\_7)](/autogon-engine-studio/machine-learning/random-forest-classification-ml_cn_7)
{% endcontent-ref %}


# Simple Linear Regression (ML\_R\_1)

This function models the relationship between two continuous variables. The objective is to predict the value of an output variable  based on the value of an input variable.

It uses a linear technique to predict the value of the dependent variable based on the value of the independent variable.&#x20;

The values of the coefficients of the equation are found by minimizing the difference between the observed values of the dependent variable and the predicted values by the equation.&#x20;

It can help understand the relationship between two variables and make&#x20;

## Sample Request

Build a simple linear regression model named, *"SimpleModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_R_1",
    "args": {
        "model_name": "SimpleModel"
    }
}
```

## Building a Simple Linear Regression model

## Simple Linear Regression

<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                                             | object | Block arguments                              |
| model\_name                                      | String | Name of the model to be used for prediction. |

{% 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": "{\"SimpleModel\": {\"function_code\": \"ML_R_1\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```python
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

simpleLinearRegression = await client.simple_linear_regression(project_id, parent_id, block_id, {
    model_name: "SimpleModel"
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_R_1_P",
    "args": {
        "model_name": "SimpleModel",
        "test_data": ""
    }
}
```

## Predicting with Simple Linear Regression

## Simple Linear Regression 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             |
| test\_data                                    | String | Input data for prediction. Defaults to `x_train_url` in StateManagment |
| project\_id                                   | int    | ID of the current project                                              |
| block\_id                                     | int    | ID of the current block                                                |
| parent\_id                                    | int    | ID of the previous block                                               |
| function\_code                                | 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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

simpleLinearRegressionPredict = await client.simple_linear_regression_predict(project_id, parent_id, block_id, {
     model_name: "SimpleModel"
     test_data: null
});
```

{% endtab %}
{% endtabs %}


# Multiple Linear Regression (ML\_R\_2)

This function models the relationship between more independent variables. The objective is to predict the value of an output variable  based on the value of input variables.

The method uses a linear technique to describe the relationship between the variables, and the coefficients of the equation are determined by minimizing the sum of the squared differences between the observed values of the dependent variable and the values predicted by the equation.&#x20;

It's a way to analyze multiple factors and understand how they influence a certain outcome.

## Sample Request

Build a multiple linear regression model named, *"SimpleModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_R_2",
    "args": {
        "model_name": "SimpleModel"
    }
}
```

## Building a Multiple Linear Regression model

## Multiple Linear Regression

<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. |

{% 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": "{\"SimpleModel\": {\"function_code\": \"ML_R_1\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

multipleLinearRegression = await client.multiple_linear_regression(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_R_2_P",
    "args": {
        "model_name": "SimpleModel",
        "test_data": ""
    }
}
```

## Predicting with Multiple Linear Regression

## Multiple Linear Regression 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8 

multipleLinearRegressionPredict = await client.multiple_linear_regression_predict(project_id, parent_id, block_id, {
       model_name: "SimpleModel",
       test_data: ""
    });
```

{% endtab %}
{% endtabs %}


# Polynomial Linear Regression (ML\_R\_3)

This function uses the relationship between variables to find the best non-linear fit through the data points.

It does this by fitting a polynomial equation to the data, rather than a straight line. The degree of the polynomial equation can be adjusted to improve the fit of the model to the data.&#x20;

This approach can be useful when the relationship between the variables is more complex than a simple linear relationship.

## Sample Request

Build a multiple linear regression model named, *"PolyModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_R_3",
    "args": {
        "model_name": "SimpleModel",
        "degree": 2
    }
}
```

## Building a Polynomial Linear Regression model

## Polynomial Linear Regression

<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.          |
| degree                                           | int    | maximum degree of polynomial features (defaults to 2) |

{% 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": "{\"SimpleModel\": {\"function_code\": \"ML_R_3\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

polynomialLinearRegression = await client.polynomial_linear_regression(project_id, parent_id, block_id, {
    model_name: "SimpleModel",
    degree: 2
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_R_3_P",
    "args": {
        "model_name": "SimpleModel",
        "test_data": ""
    }
}
```

## Predicting with Polynomial Linear Regression

## Multiple Linear Regression 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

polynomialLinearRegressionPredict = await client.polynomial_linear_regression_predict(project_id, parent_id, block_id, {
       model_name: "SimpleModel",
      test_data: ""
    });
```

{% endtab %}
{% endtabs %}


# Support Vector Regression (ML\_R\_4)

This function can be used for solving both linear and non-linear problems.

It is based on the concept of support vectors, which are the data points that are closest to the decision boundary, or the line that separates the data into different classes. SVR algorithm aims to find the best line that maximizes the margin between the support vectors and the decision boundary, this line is known as the support vector.&#x20;

This function aims to find the best line that maximizes the margin between the support vectors and the decision boundary, this line is known as the support vector. It can also be used with kernel functions to find the best decision boundary in non-linear regression problems.&#x20;

It is a powerful algorithm that is able to handle high dimensional and non-linear data, making it suitable for various regression problems.

## Sample Request

Build a multiple linear regression model named, *"SimpleModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_R_4",
    "args": {
        "model_name": "SimpleModel",
        "kernel": "rbf"
    }
}
```

## Building a Support Vector Regression model

## Support Vector Regression

<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.                               |
| kernel                                           | String | Specifies the kernel type to be used in the algorithm (defaults to "rbf"). |

{% 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": "{\"SimpleModel\": {\"function_code\": \"ML_R_3\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

supportVectorRegression = await client.support_vector_regression(project_id, parent_id, block_id, {
    model_name: "SimpleModel",
    kernel: "rbf"
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_R_4_P",
    "args": {
        "model_name": "SimpleModel",
        "test_data": ""
    }
}
```

## Predicting with Support Vector Regression

## Support Vector Regression 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

supportVectorRegressionPredict = await client.support_vector_machine_predict(project_id, parent_id, block_id, {
       model_name: "SimpleModel",
      test_data: "http://cloud.autogonai.s3.amazonaws.com/f6fc6cf1-bdba-48d0-a7ac-fddd9609c826.csv"
    });
```

{% endtab %}
{% endtabs %}


# Decision Tree Regression (ML\_R\_5)

This function splits the data into smaller subsets while at the same time an associated decision rule is used to predict the target variable, built in the form of a tree structure.

The final prediction is made by traversing the tree from the root to a leaf node, where the value of the target variable is stored. It is simple to understand and interpret, but can be prone to overfitting, particularly when the tree is deep and the data is noisy.&#x20;

It is most suitable for continuous target variables and it's popularly used in many applications.

## Sample Request

Build a multiple linear regression model named, *"SimpleModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_R_5",
    "args": {
        "model_name": "SimpleModel",
        "random_state": 0
    }
}
```

## Building a Decision Tree Regression model

## Decision Tree Regression

<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                                             | object | Block arguments                                           |
| model\_name                                      | String | Name of the model to be used for prediction.              |
| random\_state                                    | int    | Controls the randomness of the estimator (defaults to 0). |

{% 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": "{\"SimpleModel\": {\"function_code\": \"ML_R_3\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript">const project_id = 1
const parent_id = 7
const block_id = 8

decisionTreeRegression= await client.decision_tree_regression(project_id, parent_id, block_id, {
<strong>    model_name: "SimpleModel",
</strong>    random_state: 0
});
</code></pre>

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_R_5_P",
    "args": {
        "model_name": "SimpleModel",
        "test_data": ""
    }
}
```

## Predicting with Decision Tree Regression

## Decision Tree Regression 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             |
| test\_data                                    | String | Input data for prediction. Defaults to `x_train_url` in StateManagment |
| project\_id                                   | int    | ID of the current project                                              |
| block\_id                                     | int    | ID of the current block                                                |
| parent\_id                                    | int    | ID of the previous block                                               |
| function\_code                                | 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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

decisionTreeRegressionPredict = await client.decision_tree_regression_predict(project_id, parent_id, block_id, {
   model_name: "SimpleModel",
});
```

{% endtab %}
{% endtabs %}


# Random Forest Regression (ML\_R\_6)

This function builds multiple decision trees and combines their outputs to make a final prediction.

The algorithm randomly selects a subset of features and samples to train each decision tree, making it less prone to overfitting compared to a single decision tree. The final prediction is made by averaging the predictions of all the trees in the forest. It can be used for both continuous and categorical target variables and is often considered to be a robust and accurate algorithm for regression tasks.

## Sample Request

Build a multiple linear regression model named, *"SimpleModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_R_6",
    "args": {
        "model_name": "SimpleModel",
        "random_state": 0,
        "n_estimators": 100
    }
}
```

## Building a Random Forest Regression model

## Random Forest Regression

<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.              |
| random\_state                                    | int    | Controls the randomness of the estimator (defaults to 0). |
| n\_estimators                                    | int    | The number of trees in the forest (defaults to 100).      |

{% 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": "{\"SimpleModel\": {\"function_code\": \"ML_R_3\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

randomForestRegression= await client.random_forest_regression(project_id, parent_id, block_id, {
    model_name: "SimpleModel",
    random_state: 0,
    n_estimators: 100
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_R_6_P",
    "args": {
        "model_name": "SimpleModel",
        "test_data": ""
    }
}
```

## Predicting with Random Forest Regression

## Random Forest Regression 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

randomForestRegressionPredict = await client.random_forest_regression_predict(project_id, parent_id, block_id, {
    model_name: "SimpleModel",
    test_data: ""
});
```

{% endtab %}
{% endtabs %}


# Logistic Regression (ML\_CN\_1)

This function performs analysis on a dataset and returns the predicted binary outcome based on the input independent variables.

This function analyzes a dataset in which there are one or more independent variables that determine an outcome. The outcome is measured with a dichotomous variable (in which there are only two possible outcomes).

It is used to predict a binary outcome (1 / 0, Yes / No, True / False) given a set of independent variables. The model is based on the relationship between the independent variables and the probability of the binary outcome.

Logistic regression models the probability that an event belongs to a certain category, then makes predictions based on the maximum likelihood of the observed data.

## Sample Request

Build a logistic regression model named, *"ClassicModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_R_5",
    "args": {
        "model_name": "ClassicModel",
        "random_state": 0
    }
}
```

## Building a Logistic Regression model

## Logistic Regression

<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.              |
| random\_state                                    | int    | Controls the randomness of the estimator (defaults to 0). |

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

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

LogisticRegression = await client.logistic_regression(project_id, parent_id, block_id, {
    model_name: "SimpleModel",
    random_state: 0
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_1_P ",
    "args": {
        "model_name": "ClassicModel",
        "test_data": null
    }
}
```

## Predicting with Logistic Regression

## Logistic Regression 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const Client = require("./src/client");

const client = new Client(process.env.AUTOGON_API_KEY);

projectId = 1;
parentId = 8;
blockId = 9;


logisticRegression = (await client.logistic_regression(projectId, parentId, blockId, {
    model_name: "LogisticModel",
    test_data: null
})).data
```

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_1_P ",
    "args": {
        "model_name": "ClassicModel"
    }
}
```

## Logistic Regression Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8
    
LogisticRegressionMetrics= await client.logistic_regression_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}
{% endtabs %}


# K-Nearest Neighbors - KNN (ML\_CN\_2)

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

In other words, it assigns a label to a new data point based on how similar it is to the existing data points, where similarity is defined by distance metric such as Euclidean or Manhattan.&#x20;

This function can be used for both supervised and unsupervised learning.

## Sample Request

Build a KNN model named, *"ClassicModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_CN_2",
    "args": {
        "model_name": "ClassicModel",
        "random_state": 0,
        "n_neighbors": 5,
        "distance": "minkowski",
        "p": 2
    }
}
```

## Building a K-Nearest Neighbors model

## K-Nearest Neighbors

<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.                                                                                                                  |
| random\_state                                    | int    | Controls the randomness of the estimator (defaults to 0).                                                                                                     |
| n\_neighbors                                     | int    | Number of neighbors to use by default for `kneighbors` queries (defaults to 5).                                                                               |
| distance                                         | String | Metric to use for distance computation. Default `minkowski`, which results in the standard Euclidean distance when `p = 2`.                                   |
| p                                                | int    | Power parameter for the Minkowski metric. When `p = 1,` this is equivalent to using `manhattan_distance`, and `euclidean_distance` for p = 2 (defaults to 2). |

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

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

kNearestNeighbors = await client.k_nearest_neighbors(project_id, parent_id, block_id, {
    model_name: "ClassicModel",
    random_state: 0,
    n_neighbors: 5,
    distance: "minkowski",
    p: 2
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_2_P",
    "args": {
        "model_name": "ClassicModel",
        "test_data": ""
    }
}
```

## Predicting with K-Nearest Neighbors

## K-Nearest Neighbors 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

kNearestNeighborsnPredict = await client.k_nearest_neighbors_predict(project_id, parent_id, block_id, {
   model_name: "ClassicModel",
    test_data: ""
});
```

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_2_M",
    "args": {
        "model_name": "ClassicModel"
    }
}
```

## K-Nearest Neighbors Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

kNearestNeighborsMetrics= await client.k_nearest_neighbors_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",
 
});
```

{% endtab %}
{% endtabs %}


# Support Vector Machine (ML\_CN\_3)

This functionality creates a decision boundary based on the support vectors, and classifies new input data based on which side of the boundary it falls on.

In SVM, the algorithm finds the best possible line (or hyperplane in higher dimensions) that can separate two classes of data. It does this by identifying the data points closest to the dividing line, which are called support vectors, and maximizing the margin between the two classes.

Once the best line is identified, it can be used to predict the class of new data points. SVM is a powerful algorithm because it can work well with both linearly separable and non-linearly separable data by using a technique called kernel trick to transform the data into a higher dimensional space where it can be more easily separated.

## Sample Request

Build a SVM model named, *"ClassicModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_CN_3",
    "args": {
        "model_name": "ClassicModel"
    }
}
```

## Building a Support Vector Machine model

## Support Vector Machine&#x20;

<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.                                 |
| kernel                                           | String | Specifies the kernel type to be used in the algorithm (defaults to "linear") |
| random\_state                                    | int    | Controls the randomness of the estimator (defaults to 0).                    |

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

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

supportVectorMachine = await client.support_vector_machine(project_id, parent_id, block_id, {
    model_name: "ClassicModel",
    kernel: "linear",
    random_state: 0
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_3_P",
    "args": {
        "model_name": "ClassicModel",
        "test_data": ""
    }
}
```

## Predicting with Support Vector Machine

## Support Vector Machine 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

supportVectorMachinePredict = await client.support_vector_machine_predict(project_id, parent_id, block_id, {
   model_name: "ClassicModel",
    test_data: ""
});
```

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_3_M",
    "args": {
        "model_name": "ClassicModel"
    }
}
```

## Support Vector Machine  Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

supportVectorMachineMetrics= await client.support_vector_machine_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}
{% endtabs %}


# Kernel SVM (ML\_CN\_4)

This functionality uses a kernel function to map the input data to a higher-dimensional space, where a linear decision boundary is created based on the support vectors.

Kernel SVM works by finding a line or a hyperplane that separates the data into different classes. However, in cases where the data is not linearly separable, a kernel function is used to transform the data into a higher-dimensional space where it becomes separable.

Kernel SVM is a powerful algorithm that can handle complex and nonlinear data. It is widely used in image recognition, natural language processing, and other fields where the data is not easily separable in a linear fashion.

## Sample Request

Build a Kernel SVM model named, *"ClassicModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_CN_4",
    "args": {
        "model_name": "ClassicModel",
        "kernel": "rbf",
        "random_state": 0
    }
}
```

## Building a Kernel SVM model

## Kernel SVM&#x20;

<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.                               |
| kernel                                           | String | Specifies the kernel type to be used in the algorithm (defaults to "rbf"). |
| random\_state                                    | int    | Controls the randomness of the estimator (defaults to 0).                  |

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

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript">const project_id = 1
const parent_id = 7
const block_id = 8

kernelSvm = await client.kernel_svm(project_id, parent_id, block_id, {
<strong>    model_name: "ClassicModel",
</strong>    kernel: "rbf",
<strong>    random_state: 0
</strong>});
</code></pre>

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_4_P",
    "args": {
        "model_name": "ClassicModel",
        "test_data": ""
    }
}
```

## Predicting with Kernel SVM

## Kernel SVM 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
```

{% endtab %}

{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript">const project_id = 1
const parent_id = 7
const block_id = 8

kernelSvmPredict = await client.kernel_svm_predict(project_id, parent_id, block_id, {
    model_name: "ClassicModel",
<strong>    test_data: ""
</strong>});
</code></pre>

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_4_M",
    "args": {
        "model_name": "ClassicModel"
    }
}
```

## Kernel SVM  Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8


kernelSvmMetrics= await client.kernel_svm_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}

{% tab title="Node" %}

```
```

{% endtab %}
{% endtabs %}


# Naive Bayes (ML\_CN\_5)

This function uses the Bayes' theorem to calculate the probability of each class based on the frequency of the features in the training data, and classifies new input data based on highest probability

Naive Bayes is a probabilistic machine learning algorithm that uses Bayes' theorem to make predictions. It assumes that the features are independent of each other and calculates the probability of each class based on the frequency of the features in the training data.

Once the probabilities of each class are calculated, new input data is classified based on the class with the highest probability.

## Sample Request

Build a Naive Bayes model named, *"ClassicModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_CN_5",
    "args": {
        "model_name": "NaiveModel",
        "type": "gaussian"
    }
}
```

## Building a Naive Bayes model

## Naive Bayes

<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.                                                                                    |
| type                                             | String | variant of the Naive Bayes classifier to use (`categorical`, `bernoulli`, `categorical`, `complement`). Defaults to `gaussian`. |

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

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

naiveBayes = await client.naive_bayes(project_id, parent_id, block_id, {
    model_name: "ClassicModel",

});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_5_P",
    "args": {
        "model_name": "ClassicModel",
        "test_data": ""
    }
}
```

## Predicting with Naïve Bayes

## Naive Bayes 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

naiveBayesPredict = await client.naive_bayes_predict(project_id, parent_id, block_id, {
    model_name: "ClassicModel",
    test_data: ""
});
```

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_5_M",
    "args": {
        "model_name": "ClassicModel"
    }
}
```

## Naive Bayes  Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

naiveBayesMetrics= await client.naive_bayes_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}
{% endtabs %}


# Decision Tree Classification (ML\_CN\_6)

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

This algorithm works by creating a tree-like model of decisions and their possible consequences. The model starts with a root node that represents the entire dataset and branches out into different nodes that represent possible decisions or features that can be used to split the data into smaller groups.

At each node, the algorithm chooses the feature that results in the greatest information gain, meaning the feature that provides the most information about the class labels of the data points. The process continues recursively until a leaf node is reached, which represents a final decision or classification for the data point.

Decision tree classification is a popular algorithm because it is easy to understand and interpret, and it can work well with both categorical and numerical data.

## Sample Request

Build a Decision Tree Classification model named, *"ClassicModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_CN_6",
    "args": {
        "model_name": "ClassicModel",
        "criterion": "gini",
        "random_state": 0
    }
}
```

## Building a Decision Tree Classification model

## Decision Tree Classification&#x20;

<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.                                                                                                                                           |
| criterion                                        | String | function to measure the quality of a split. Supported criteria are “gini” for the Gini impurity and “log\_loss” and “entropy” both for the Shannon information gain (defaults to gini) |
| random\_state                                    | int    | Controls the randomness of the estimator (defaults to 0).                                                                                                                              |

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

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

decisionTreeClassification = await client.decision_tree_classification(project_id, parent_id, block_id, {
    model_name: "ClassicModel",
    criterion: "gini",
    random_state: 0
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_6_P",
    "args": {
        "model_name": "ClassicModel",
        "test_data": ""
    }
}
```

## Predicting with Decision Tree Classification

## Decision Tree Classification  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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript">const project_id = 1
const parent_id = 7
const block_id = 8

decisionTreeClassificationPredict = await client.decision_tree_classification_predict(project_id, parent_id, block_id, {
<strong>    model_name: "ClassicModel",
</strong><strong>    test_data: ""
</strong>});
</code></pre>

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_6_M",
    "args": {
        "model_name": "ClassicModel"
    }
}
```

## Decision Tree Classification Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

decisionTreeClassificationMetrics= await client.decision_tree_classification_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}
{% endtabs %}


# Random Forest Classification (ML\_CN\_7)

This function combines multiple decision trees and aggregates their results to make predictions.

Random Forest is an ensemble machine learning algorithm that combines multiple decision trees to improve performance and reduce overfitting. It creates a set of decision trees by randomly selecting subsets of the features and data samples, and then aggregates the results of the trees to make predictions.

## Sample Request

Build a Random Forest Classification model named, *"ClassicModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_CN_7",
    "args": {
        "model_name": "ClassicModel",
        "criterion": "gini"
    }
}
```

## Building a Random Forest Classification model

## Random Forest Classification&#x20;

<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.                                                                                                                                                                                                    |
| random\_state                                    | int    | Seed for random number generation. If provided, it ensures reproducibility of the random processes in the algorithm. If not provided, a random seed will be used                                                                                |
| n\_estimators                                    | int    | The number of trees in the forest (ensemble) used by the algorithm. Each tree contributes to the final prediction. Larger values generally improve performance, but also increase computation time.                                             |
| criterion                                        | String | The function to measure the quality of a split in the decision tree. Common criteria include `gini` for the Gini impurity and `entropy` for information gain. The choice of criterion affects how the decision tree grows and splits its nodes. |

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

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Second Tab" %}

```
// Some code
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_7_P",
    "args": {
        "model_name": "ClassicModel",
        "test_data": ""
    }
}
```

## Predicting with Random Forest Classification

## Random Forest Classification   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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

randomForestClassificationPredict = await client.random_forest_classification_predict(project_id, parent_id, block_id, {
    model_name: "ClassicModel",
    test_data: ""
});
```

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CN_7_M",
    "args": {
        "model_name": "ClassicModel"
    }
}
```

## Decision Tree Classification   Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

randomForestClassificationMetrics= await client.random_forest_classification_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}
{% endtabs %}


# Hierarchical Clustering (ML\_CG\_1)

Hierarchical Clustering groups similar data points into clusters by recursively merging the two closest clusters based on a distance metric.

Hierarchical Clustering is a machine learning algorithm used for grouping similar data points into clusters. It starts with each data point in its own cluster, and then recursively merges the two closest clusters until there is only one cluster left.

The algorithm uses a distance metric to determine the similarity between clusters and data points, and creates a dendrogram to visualize the hierarchy of the merged clusters.

## Sample Request

Build a Hierarchical Clustering model named, *"ClusterModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_CG_1",
    "args": {
	"model_name": "ClusterModel",
        "n_clusters": 5,
        "affinity": "euclidean",
        "linkage": "ward"
    }
}
```

## Building a Hierarchical Clustering model

## Hierarchical Clustering&#x20;

<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. |

{% 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": "{\"ClusterModel\": {\"function_code\": \"ML_R_3\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

hierarchicalClustering  = await client.hierarchicalClustering(project_id, parent_id, block_id, {
    model_name: "ClassicModel",
    n_clusters: 5,
    affinity: "euclidean",
    linkage: "ward"
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CG_1_P",
    "args": {
        "model_name": "ClusterModel",
        "test_data": ""
    }
}
```

## Predicting with Hierarchical Clustering

## Hierarchical Clustering 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

hierarchicalClusteringPredict = await client.hierarchical_clustering_predict(project_id, parent_id, block_id, {
    model_name: "ClassicModel",
    test_data: ""
});
```

{% endtab %}
{% endtabs %}


# K-Means Clustering (ML\_CG\_2)

This function groups similar data points into K clusters by iteratively assigning each data point to the nearest center and updating the cluster centers based on the mean of the assigned data points.

K-Means Clustering is a machine learning algorithm used for grouping similar data points into K clusters. It randomly selects K cluster centers and assigns each data point to the nearest center based on a distance metric. It then updates the cluster centers based on the mean of the assigned data points, and repeats the assignment and update steps until convergence.

The algorithm can converge to a local minimum, so it is often run multiple times with different initial cluster centers to improve the chances of finding the optimal solution.

## Sample Request

Find the optimal number of clusters&#x20;

```javascript
{
    "project_id": 12,
    "parent_id": 2,
    "block_id": 3,
    "function_code": "ML_CG_2_F",
    "args": {
        "n_clusters": 11,
        "init": "k-means++",
        "random_state": 42
    }
}
```

<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        |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block         |
| 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 of the current block |
| n\_clusters<mark style="color:red;">\*</mark>    | int    | numbers of iterations to make          |
| init<mark style="color:red;">\*</mark>           | string | initialization method to use           |
| random\_state                                    | String | control algorithm randomness           |

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8


kmeansClusteringFindClusters   = await client.kmeans_clustering_find_clusters(project_id, parent_id, block_id, {
    n_clusters: 11,
    init: "k-means++",
    random_state: 42
});
```

{% endtab %}
{% endtabs %}

## Sample Request

Build a K-Means Clustering model named, *"ClusterModel"*

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_CG_2",
    "args": {
        "model_name": "ClusterModel",
        "n_clusters": 11,
        "init": "k-means++",
        "random_state": 42
    }
}
```

## Building a K-Means Clustering model

## K-Means Clustering

<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. |

{% 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": "{\"ClusterModel\": {\"function_code\": \"ML_R_3\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

kmeansClustering = await client.kmeans_clustering(project_id, parent_id, block_id, {
    model_name: "ClassicModel",
    n_clusters: 5,
    affinity: "euclidean",
    linkage: "ward"
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 9,
    "block_id": 10,
    "function_code": "ML_CG_2_P",
    "args": {
        "model_name": "ClusterModel",
        "test_data": ""
    }
}
```

## Predicting with K-Means Clustering

## K-Means Clustering 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

kmeansClusteringPredict = await client.kmeans_clustering_predict(project_id, parent_id, block_id, {
    model_name: "SimpleModel",
    test_data: ""
});
```

{% endtab %}
{% endtabs %}


# XGBoost (MS\_XGBOOST)

This function is based on gradient boosting that iteratively trains weak models while optimizing a regularized objective function to reduce overfitting.

XGBoost (Extreme Gradient Boosting) is a machine learning algorithm used for both classification and regression tasks. It is based on the gradient boosting technique, which iteratively trains weak models (usually decision trees) on the residuals of the previous models.

XGBoost optimizes a regularized objective function by minimizing the sum of the loss function and a penalty term that encourages simpler models and reduces overfitting. It also includes several advanced features, such as weighted quantile sketch for handling sparse data and cache-aware computing for faster training.

## Sample Request

Build an XGBoost model named, *"XGBoost"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "MS_XGBOOST",
    "args": {
        "model_name": "XGBoost"
    }
}
```

## Building a XGBoost model

## XGBoost

<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. |

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

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

xgboost = await client.xgboost(project_id, parent_id, block_id, {
    model_name: "XGBoost"
});
```

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "MS_XGBOOST_P",
    "args": {
        "model_name": "XGBoost",
        "test_data": ""
    }
}
```

## Predicting with XGBoost

## XGBoost 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript">const project_id = 1
const parent_id = 7
const block_id = 8

kmeansClustering = await client.xgboost_predict(project_id, parent_id, block_id, {
<strong>    model_name: "XGBoost",
</strong><strong>    test_data: ""
</strong>});
</code></pre>

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "MS_XGBOOST_P",
    "args": {
        "model_name": "ClassicModel"
    }
}
```

## XGBoost Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```python
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

kmeansClusteringPredict = await client.xgboost_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}
{% endtabs %}


# Grid Search (ML\_GRID)

This function exhaustively searches for the optimal combination of hyperparameter values for a machine learning model.

Grid search is a hyperparameter tuning technique used to find the optimal combination of hyperparameter values for a machine learning model. It works by systematically searching through a predefined grid of hyperparameter values, evaluating the model's performance using cross-validation at each point in the grid. Grid search helps to identify the hyperparameter configuration that yields the best performance, enhancing the model's accuracy and generalization ability.

## Sample Request

This request is performing a grid search for hyperparameter tuning on the "RandomForest" model. It searches for the best combination of hyperparameters `"n_estimators"`, `"random_state"`, and `"criterion"` by evaluating the model's performance with different values provided in the "param\_grid."

```javascript
{
    "project_id": 13,
    "parent_id": 3,
    "block_id": 4,
    "function_code": "ML_GRID",
    "args": {
        "model_name": "RandomForest",
        "param_grid": [
            {
                "n_estimators": [
                    5,
                    10,
                    60,
                    100
                ]
            },
            {
                "random_state": [
                    0,
                    42,
                    60
                ],
                "criterion": [
                    "gini",
                    "entropy"
                ]
            }
        ]
    }
}
```

## Grid Search

<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    | ID of the current project                                                                                                      |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                                                                                       |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                                                                                        |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                                                                                            |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for analysis                                                                          |
| param\_grid                                      | object | set of hyperparameter values that the grid search will exhaustively explore to find the optimal combination of hyperparameters |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8
    
LogisticRegressionMetrics= await client.logistic_regression_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}
{% endtabs %}


# Shap Explain (ML\_SHAP)

This function provides interpretable insights into machine learning model predictions by explaining the contribution of each feature to the output.

Shap (SHapley Additive exPlanations) is an Explainable AI (XAI) method that provides interpretable insights into the predictions made by a logistic regression model. It allows us to understand the contribution of each independent variable in determining the probability of a binary outcome (e.g., Yes/No, True/False).&#x20;

Shap values help to uncover the impact of individual features on the model's predictions, enhancing transparency and facilitating model evaluation and decision-making.

## Sample Request

Perform model analysis using SHAP (SHapley Additive exPlanations) on a specific model named "RandomForest."

```javascript
{
    "project_id": 13,
    "parent_id": 3,
    "block_id": 4,
    "function_code": "ML_SHAP",
    "args": {
        "model_name": "RandomForest"
    }
}
```

## Shap Explain

<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    | ID of the current project                             |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                              |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                               |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                   |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for analysis |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8
    
LogisticRegressionMetrics= await client.logistic_regression_metrics(project_id, parent_id, block_id, {
    model_name: "SimpleModel",

});
```

{% endtab %}
{% endtabs %}


# Isolation Forest (ML\_ISF)

This function isolates outliers by creating binary trees to efficiently separate normal data points from anomalies based on their low-dimensional representations.

Isolation Forest is an unsupervised machine learning algorithm designed for anomaly detection. It efficiently identifies outliers in a dataset by creating random binary trees that isolate anomalies with fewer tree traversals compared to normal data points. The algorithm measures the average path length needed to isolate an observation, and anomalies are expected to have shorter path lengths due to their rarity and distinctiveness.&#x20;

Isolation Forest is particularly effective for large datasets with high-dimensional features, providing a scalable and accurate solution for detecting anomalies without the need for labeled data.

## Sample Request

Build an Isolation Forest model named, *"IsolateForest"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "ML_ISF",
    "args": {
        "model_name": "IsolateForest",
        "random_state": 0
    }
}
```

## Building a Isolation Forest Anomaly Detection model

## Isolation Forest

<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                                             | object | Block arguments                                           |
| model\_name                                      | String | Name of the model to be used for prediction.              |
| random\_state                                    | int    | Controls the randomness of the estimator (defaults to 0). |

{% 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": "{\"SimpleModel\": {\"function_code\": \"ML_R_3\", \"model_url\": ""}}"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript">const project_id = 1
const parent_id = 7
const block_id = 8

decisionTreeRegression = await client.isolation_forest(project_id, parent_id, block_id, {
<strong>    model_name: "IsolateForest"
</strong>});
</code></pre>

{% endtab %}
{% endtabs %}

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_ISF_P",
    "args": {
        "model_name": "IsoslateForest",
        "test_data": null
    }
}
```

## Detecting Anomalies with Isolation Forest&#x20;

## Isolation Forest 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 detection              |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```javascript
const project_id = 1
const parent_id = 7
const block_id = 8

await client.isolation_forest_predict(project_id, parent_id, block_id, {
   model_name: "IsolateForest",
});
```

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate anomaly detection model performance

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "ML_ISF_M",
    "args": {
        "model_name": "IsoslateForest",
    }
}
```

## Evaluating Anomaly Detection with Isolation Forest&#x20;

## Isolation Forest Metrics

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

{% tabs %}
{% tab title="Python" %}

```python
# Some codethon
```

{% endtab %}

{% tab title="Node" %}

<pre><code><strong>// Some code
</strong></code></pre>

{% endtab %}
{% endtabs %}


# (ML\_DBS)


# Automated Machine Learning

Dive into the specifics of each API endpoint by checking out our complete documentation.

## Pets

All the methods associated with `CRUD`ing some pets. Which isn't as weird as it sounds:

{% content-ref url="/pages/bc4ToVvOSidfb8Vv304g" %}
[Broken mention](broken://pages/bc4ToVvOSidfb8Vv304g)
{% endcontent-ref %}

## Users

Everything related to users:

{% content-ref url="/pages/QmGtKILWfr0rQtRWvGee" %}
[Broken mention](broken://pages/QmGtKILWfr0rQtRWvGee)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** Using the 'Page Link' block lets you link directly to a page. If this page's name, URL or parent location changes, the reference will be kept up to date. You can also mention a page – like [Broken mention](broken://pages/bc4ToVvOSidfb8Vv304g) – if you don't want a block-level link.
{% endhint %}


# AutoRegression (AUTO\_R\_1)

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

In other words, it assigns a label to a new data point based on how similar it is to the existing data points, where similarity is defined by distance metric such as Euclidean or Manhattan.&#x20;

This function can be used for both supervised and unsupervised learning.

## Sample Request

Build an AutoRegression model named, *"*&#x41;utoRegressio&#x6E;*"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "AUTO_R_1",
    "args": {
        "model_name": "AutoRegression",
        "time_left": 60,
        "run_time_limit": 30,
        "n_jobs": 1
    }
}
```

## Building a AutoRegression model

## 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. |

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

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "AUTO_R_1_P",
    "args": {
        "model_name": "AutoRegressionAutoRegression"
    }
}
```

## Predicting with AutoRegression

## XGBoost 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "AUTO_R_1_M",
    "args": {
        "model_name": "AutoRegression",
        "metric": "mae"
    }
}
```

## AutoRegression Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}


# AutoClassification (AUTO\_CN\_1)

This function finds the K number of training examples closest (nearest neighbors) to the input data and then classifying the input data based on the majority class of its nearest neighbors.

In other words, it assigns a label to a new data point based on how similar it is to the existing data points, where similarity is defined by distance metric such as Euclidean or Manhattan.&#x20;

This function can be used for both supervised and unsupervised learning.

## Sample Request

Build an AutoClassification model named, *"*&#x41;utoClassificatio&#x6E;*"*

```javascript
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "AUTO_R_1",
    "args": {
        "model_name": "AutoRegression",
        "time_left": 60,
        "run_time_limit": 30,
        "n_jobs": 1
    }
}
```

## Building a AutoClassification model

## AutoClassification

<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. |

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

## Sample Request

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

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "AUTO_CN_1_P",
    "args": {
        "model_name": "AutoClassification"
    }
}
```

## Predicting with AutoClassification

## AutoClassification 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             |
| test\_data                                       | String | Input data for prediction. Defaults to `x_train_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 %}

## Sample Request

Evaluate model metrics

```javascript
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "AUTO_CN_1_M",
    "args": {
        "model_name": "AutoClassification",
        "metric": "mae"
    }
}
```

## AutoClassification Metrics

<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    | ID of the current project                               |
| parent\_id<mark style="color:red;">\*</mark>     | int    | ID of the previous block                                |
| block\_id<mark style="color:red;">\*</mark>      | int    | ID of the current block                                 |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                     |
| model\_name<mark style="color:red;">\*</mark>    | String | Name of the pre-trained model to be used for evaluation |

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

```javascript
{
    "status": "true",
    "message": {
        "id": 1,
        "project": 12,
        "block_id": 10,
        "parent_id": 11,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": "",
        "x_train_url": "",
        "y_train_url": "",
        "x_test_url": "",
        "y_test_url": "",
        "output": "{'confusion_matrix': '', 'accuracy': 0.9}"
    }
}
```

{% endtab %}
{% endtabs %}


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


# Deep Learning


# Artificial Neural Network (DL\_ANN)

This function creates and uses a model consisting of layers of interconnected nodes (neurons) that process input data and produce output predictions.

An artificial neural network (ANN) is a type of machine learning model inspired by the structure and function of biological neurons in the human brain. It consists of layers of interconnected nodes (neurons) that process input data and produce output predictions.\
\
Each neuron takes in one or more inputs, applies a mathematical function to them, and passes the result to the next layer of neurons.\
\
By adjusting the weights and biases of the connections between neurons during training, the network can learn to make accurate predictions on new data. ANNs are used for a wide variety of tasks, including image and speech recognition, natural language processing, and predictive modeling.

## Sample Request

Build a sequential ANN model for Binary Classification

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "DL_ANN_S_I",
    "args": {
        "layer_list": [
            {
                "type": "conv2d",
                "filters": 32,
                "kernel_size": [3, 3],
                "padding": "valid",
                "activation": "relu"
            },
            {
                "type": "maxpooling2d",
                "pool_size": [2, 2]
            },
            {
                "type": "upsampling2d",
                "size": [2, 2]
            },
            {
                "type": "flatten"
            },
            {
                "type": "dropout",
                "rate": 0.5,
            },
            {
                "type": "embedding",
                "input_dim": 1000,
                "output_dim": 64
            },
            {
                "type": "lstm",
                "units": 64,
                "return_sequences": false
            },
            {
                "type": "batchnormalization",
            {
                "type": "dense",
                "units": 1,
                "activation": "sigmoid"
            }
        ]
    }
}
```

## Building a Sequential Artificial Neural Network

## Sequential ANN Construction

<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                                                               |
| layer\_list<mark style="color:red;">\*</mark>    | list   | List of layers for the Artificial Neural Network                              |
| type<mark style="color:red;">\*</mark>           | string | Type of layer to add                                                          |
| units<mark style="color:red;">\*</mark>          | int    | Dimensionality of the output space of the layer                               |
| activation                                       | string | Activation function applied to the layer's output. Default: "relu".           |
| filters                                          | int    | Number of filters or output channels in the convolutional layer. Default: 32. |
| kernel\_size                                     | array  | Size of the convolutional kernel. Default: \[3, 3].                           |
| padding                                          | string | Padding scheme for the layer. Default: "valid".                               |
| pool\_size                                       | array  | Size of the pooling window. Default: \[2, 2].                                 |
| rate                                             | float  | Fraction of input units to drop during training (0-1). Default: 0.5.          |
| input\_dim                                       | int    | Size of the input vocabulary. Default: 1000.                                  |
| output\_dim                                      | int    | Dimensionality of the dense embedding. Default: 64.                           |
| return\_sequences                                | bool   | Whether to return the full sequence or only the last output. Default: false.  |
| size                                             | array  | <p>The upsampling factors for rows and columns.</p><p>Default: \[2, 2].</p>   |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Compile and train the pre-built ANN model, using passed-in Hyper Parameters

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "DL_ANN_T",
    "args": {
        "model_name": "titanic_model",
        "add_dim": false,
        "hyp_params":{
            "optimizer": "adam",
            "loss": "binary_crossentropy",
            "metrics": ["accuracy"],
            "batch_size": 12,
            "epochs": 5,
            "autoencoder": false
        }
    }
}
```

## Training an Artificial Neural Network

## ANN Training

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

#### Request Body

| Name                                             | Type   | Description                                                                      |
| ------------------------------------------------ | ------ | -------------------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                                                  |
| hyp\_params<mark style="color:red;">\*</mark>    | object | hyper parameters for model compilation and training                              |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                                                   |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                                                    |
| function\_code<mark style="color:red;">\*</mark> |        | The function code for current block                                              |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                                                  |
| model\_name<mark style="color:red;">\*</mark>    | String | The name the model would be saved with                                           |
| optimizer                                        | String | Optimization function to be used e.g: `"adam"`                                   |
| loss<mark style="color:red;">\*</mark>           | String | Loss function to be used e.g: `"binary_crossentropy"`                            |
| metrics                                          | list   | Evaluation metrics used to judge the performance of the model                    |
| batch\_size                                      | String | Number of samples that are processed by the model during each training iteration |
| epochs<mark style="color:red;">\*</mark>         | String | Number of iterations through the dataset                                         |
| add\_dim                                         | bool   | Sets whether an extra dimension should be added to `x` train data                |
| autoencoder                                      | bool   | Specifies whether to use x data as y data                                        |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Evaluate the accuracy and losses of a trained artificial neural network.

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "DL_ANN_E",
    "args": {
        "hyp_params": {
            "batch_size": 32
        }
    }
}
```

## Evaluating an Artificial Neural Network

## ANN Evaluating

<mark style="color:green;">`POST`</mark>&#x20;

#### Request Body

| Name                                             | Type   | Description                                                         |
| ------------------------------------------------ | ------ | ------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                                     |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                                       |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                                 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                                     |
| hyp\_params<mark style="color:red;">\*</mark>    | object | hyper parameters for model evaluation                               |
| batch\_size                                      | int    | Number of samples that are processed by the model during evaluation |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Make predictions with the trained ANN model.

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

## Predicting with an Artificial Neural Network

## ANN Predict

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

#### Request Body

| Name                                             | Type   | Description                                                  |
| ------------------------------------------------ | ------ | ------------------------------------------------------------ |
| test\_data                                       | String | <p>Input data for prediction<br>Defaults to x\_test\_url</p> |
| 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                          |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                              |
| add\_dim                                         | bool   | Sets whether an extra dimension should be added to `x` data  |

{% 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": {}
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Self Organizing Maps (DL\_SOM)

This function creates self organizing maps used for data clustering

Self-organizing maps (SOM), also known as Kohonen maps, are a type of artificial neural network that can be used for unsupervised learning and data visualization. They are typically used for clustering and dimensionality reduction of complex data sets.

SOMs consist of a two-dimensional grid of nodes or neurons, each of which represents a different feature or attribute of the data. During training, the SOM learns to associate similar data points with adjacent neurons on the grid. This results in a topology-preserving mapping of the input space onto the two-dimensional grid.

SOMs are often used in data visualization applications because they can represent high-dimensional data in a two-dimensional map, making it easier to understand and interpret. They have been used in a variety of fields, including image and speech recognition, text mining, and pattern recognition.

## Sample Request

Build an SOM for data clustering

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "DL_SOM_I",
    "args": {
    "hyp_params":{
            "x": 10,
            "y": 10,
            "input_len": 14,
            "sigma": 1.0,
            "learning_rate": 0.1,
        }
    }
}
```

## Building a Self Organizing Map

## SOM Construction

<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                                                                        |
| x<mark style="color:red;">\*</mark>              | int    | x dimension                                                                            |
| y<mark style="color:red;">\*</mark>              | int    | y dimension                                                                            |
| input\_len<mark style="color:red;">\*</mark>     | int    | Number of the elements of the vectors in input                                         |
| learning\_rate                                   | float  | initial learning rate                                                                  |
| sigma                                            | float  | Spread of the neighborhood function, needs to be adequate to the dimensions of the map |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Compile and train the pre-built SOM model, using passed in Hyper Parameters

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "DL_SOM_T",
    "args": {
        "model_name": "titanic_model",
        "hyp_params":{
            "num_iterations": 100
        }
    }
}
```

## Training a Sequential Organizing Map

## SOM Training

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

#### Request Body

| Name                                              | Type   | Description                                         |
| ------------------------------------------------- | ------ | --------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the current project                     |
| hyp\_params<mark style="color:red;">\*</mark>     | object | hyper parameters for model compilation and training |
| parent\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the previous block                      |
| block\_id<mark style="color:red;">\*</mark>       | int    | The `id` of the current block                       |
| function\_code<mark style="color:red;">\*</mark>  |        | The function code for current block                 |
| args<mark style="color:red;">\*</mark>            | object | Block arguments                                     |
| model\_name<mark style="color:red;">\*</mark>     | String | The name the model would be saved with              |
| num\_iterations<mark style="color:red;">\*</mark> | int    | number of training iterations                       |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Make predictions with the trained SOM model.

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "DL_SOM_P",
    "args": {
        "test_data": "",
        "row": 12,
    }
}
```

## Predicting Cluster with an Self Organizing Map

## SOM Predict

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

#### Request Body

| Name                                             | Type   | Description                         |
| ------------------------------------------------ | ------ | ----------------------------------- |
| test\_data<mark style="color:red;">\*</mark>     | String | Input data for prediction           |
| 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 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                     |
| row                                              | int    | row in the dataset to be used       |

{% 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": {}
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Restricted Boltzmann Machine (DL\_RBM)

This function creates a Restricted Boltzmann Machine used for dimensionality reduction

An RBM is a type of neural network used for unsupervised learning. It has two layers of neurons - visible and hidden - that are connected by weights. RBMs are unique because they have symmetric connections between the visible and hidden layers and no connections within the same layer. They use contrastive divergence to adjust the weights and learn complex probability distributions of the input data. RBMs are used in applications such as image and speech recognition, dimensionality reduction, and collaborative filtering. They can learn without labeled data and be used as building blocks for larger neural network architectures.

## Sample Request

Build an RBM for data clustering

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "DL_RBM_I",
    "args": {
    "hyp_params":{
            "n_components": 5,
            "n_iter": 5
        }
    }
}
```

## Building a Restricted Boltzmann Machine

## RBM Construction

<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                                                     |
| n\_components                                    | int    | Number of binary hidden units                                       |
| n\_iter                                          | int    | Number of iterations over the dataset                               |
| random\_state                                    | int    | Pass an int for reproducible results across multiple function calls |
| learning\_rate                                   | float  | The learning rate for weight updates                                |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Compile and train the pre-built RBM model, using passed in Hyper Parameters

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "DL_RBM_T",
    "args": {
        "model_name": "titanic_model",
        "hyp_params":{
        }
    }
}
```

## Training a Restricted Boltzmann Machine

## RBM Training

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

#### Request Body

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                     |
| hyp\_params                                      | object | hyper parameters for model compilation and training |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                       |
| function\_code<mark style="color:red;">\*</mark> |        | The function code for current block                 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                     |
| model\_name<mark style="color:red;">\*</mark>    | String | The name the model would be saved with              |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Make predictions with the trained RBM model.

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

## Predicting with a Restricted Boltzmann Machine

## RBM Predict

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

#### Request Body

| Name                                             | Type   | Description                         |
| ------------------------------------------------ | ------ | ----------------------------------- |
| test\_data<mark style="color:red;">\*</mark>     | String | Input data for prediction           |
| 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 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                     |

{% 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": {}
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Automated Deep Learning


# Auto Image Classification (A\_DL\_IMC)

This function creates an Automated Image classifying model

These models are designed to classify images into different categories, such as identifying the object or animal in the image

## Sample Request

Build an Auto Image Classifier

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "A_DL_IMC_I",
    "args": {
    "hyp_params":{
            "max_trials": 1
        }
    }
}
```

## Building an Auto Image Classifier

## Automated Model Construction

<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                                       |
| max\_trials                                      | int    | Maximum number of different models that will be tried |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Compile and train the pre-built IMC model, using passed in Hyper Parameters

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "A_DL_IMC_T",
    "args": {
        "model_name": "titanic_model",
        "hyp_params":{
            "epochs": 10
        }
    }
}
```

## Training an Auto Image Classifier

## Automated Model Training

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

#### Request Body

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                     |
| hyp\_params                                      | object | hyper parameters for model compilation and training |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                       |
| function\_code<mark style="color:red;">\*</mark> |        | The function code for current block                 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                     |
| model\_name<mark style="color:red;">\*</mark>    | String | The name the model would be saved with              |
| epochs                                           | int    | Number of iterations through the dataset            |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Predictions

Make predictions with the DL\_ANN Predict block

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Auto Image Regression (A\_DL\_IMR)

This function creates an Automated Image regression model

These models are designed to predict continuous values, examples include predicting the price of a house or the age of a person.

## Sample Request

Build an Auto Image Regressor

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "A_DL_IMR_R",
    "args": {
    "hyp_params":{
            "max_trials": 1
        }
    }
}
```

## Building an Auto Image Regressor

## Automated Model Construction

<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                                       |
| max\_trials                                      | int    | Maximum number of different models that will be tried |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Compile and train the pre-built IMR model, using passed in Hyper Parameters

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "A_DL_IMR_T",
    "args": {
        "model_name": "titanic_model",
        "hyp_params":{
            "epochs": 10
        }
    }
}
```

## Training an Auto Image Regressor

## Automated Model Training

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

#### Request Body

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                     |
| hyp\_params                                      | object | hyper parameters for model compilation and training |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                       |
| function\_code<mark style="color:red;">\*</mark> |        | The function code for current block                 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                     |
| model\_name<mark style="color:red;">\*</mark>    | String | The name the model would be saved with              |
| epochs                                           | int    | Number of iterations through the dataset            |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Predictions

Make predictions with the DL\_ANN Predict block

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Auto Text Classification (A\_DL\_TXC)

This function creates an Automated Text classifying model

These models are designed to classify text into different categories, such as sentiment analysis or topic modeling.

## Sample Request

Build an Auto Text Classifier

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "A_DL_TXC_I",
    "args": {
    "hyp_params":{
            "max_trials": 1
        }
    }
}
```

## Building an Auto Text Classifier

## Automated Model Construction

<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                                       |
| max\_trials                                      | int    | Maximum number of different models that will be tried |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Compile and train the pre-built TXC model, using passed in Hyper Parameters

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "A_DL_TXC_T",
    "args": {
        "model_name": "titanic_model",
        "hyp_params":{
            "epochs": 10
        }
    }
}
```

## Training an Auto Image Classifier

## Automated Model Training

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

#### Request Body

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                     |
| hyp\_params                                      | object | hyper parameters for model compilation and training |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                       |
| function\_code<mark style="color:red;">\*</mark> |        | The function code for current block                 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                     |
| model\_name<mark style="color:red;">\*</mark>    | String | The name the model would be saved with              |
| epochs                                           | int    | Number of iterations through the dataset            |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Predictions

Make predictions with the DL\_ANN Predict block

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Auto Text Regression (A\_DL\_TXR)

This function creates an Automated Text regression model

This model is used for predicting a continuous numeric value given some text input. This model is particularly useful for solving problems such as sentiment analysis, where the goal is to predict the sentiment of a text as a real number between -1 and 1, or price prediction, where the goal is to predict the price of a product based on its description.

## Sample Request

Build an Auto Text Regressor

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "A_DL_TXR_I",
    "args": {
    "hyp_params":{
            "max_trials": 1
        }
    }
}
```

## Building an Auto Text Regressor

## Automated Model Construction

<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                                       |
| max\_trials                                      | int    | Maximum number of different models that will be tried |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Compile and train the pre-built TXR model, using passed in Hyper Parameters

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "A_DL_TXR_T",
    "args": {
        "model_name": "titanic_model",
        "hyp_params":{
            "epochs": 10
        }
    }
}
```

## Training an Auto Text Regressor

## Automated Model Training

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

#### Request Body

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                     |
| hyp\_params                                      | object | hyper parameters for model compilation and training |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                       |
| function\_code<mark style="color:red;">\*</mark> |        | The function code for current block                 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                     |
| model\_name<mark style="color:red;">\*</mark>    | String | The name the model would be saved with              |
| epochs                                           | int    | Number of iterations through the dataset            |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Predictions

Make predictions with the DL\_ANN Predict block

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Auto Structured Data Classification (A\_DL\_SDC)

This function creates an Automated Structured Data classifying model

These models are designed to classify structured data, such as predicting whether a customer will churn or not based on their purchase history.

## Sample Request

Build an Auto Structured Data Classifier

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "A_DL_SDC_I",
    "args": {
    "hyp_params":{
            "max_trials": 1
        }
    }
}
```

## Building an Auto Structured Data Classifier

## Automated Model Construction

<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                                       |
| max\_trials                                      | int    | Maximum number of different models that will be tried |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Compile and train the pre-built SDC model, using passed in Hyper Parameters

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "A_DL_SDC_T",
    "args": {
        "model_name": "titanic_model",
        "hyp_params":{
            "epochs": 10
        }
    }
}
```

## Training an Auto Structured Data Classifier

## Automated Model Training

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

#### Request Body

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                     |
| hyp\_params                                      | object | hyper parameters for model compilation and training |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                       |
| function\_code<mark style="color:red;">\*</mark> |        | The function code for current block                 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                     |
| model\_name<mark style="color:red;">\*</mark>    | String | The name the model would be saved with              |
| epochs                                           | int    | Number of iterations through the dataset            |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Predictions

Make predictions with the DL\_ANN Predict block

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Auto Structured Data Regression (A\_DL\_SDR)

This function creates an Automated Structured Data regression model

This is a type of machine learning model that is designed to predict a continuous numerical output based on a set of input features that are structured in a tabular format.

## Sample Request

Build an Auto Structured Data Regressor

```json
{
    "project_id": 1,
    "parent_id": 7,
    "block_id": 8,
    "function_code": "A_DL_SDR_I",
    "args": {
    "hyp_params":{
            "max_trials": 1
        }
    }
}
```

## Building an Auto Structured Data Regressor

## Automated Model Construction

<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                                       |
| max\_trials                                      | int    | Maximum number of different models that will be tried |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Request

Compile and train the pre-built SDR model, using passed in Hyper Parameters

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "A_DL_SDR_T",
    "args": {
        "model_name": "titanic_model",
        "hyp_params":{
            "epochs": 10
        }
    }
}
```

## Training an Auto Structured Data Regressor

## Automated Model Training

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

#### Request Body

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                     |
| hyp\_params                                      | object | hyper parameters for model compilation and training |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                       |
| function\_code<mark style="color:red;">\*</mark> |        | The function code for current block                 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                     |
| model\_name<mark style="color:red;">\*</mark>    | String | The name the model would be saved with              |
| epochs                                           | int    | Number of iterations through the dataset            |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Predictions

Make predictions with the DL\_ANN Predict block

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# General AutoDL Blocks (A\_DL\_ALL)

This function loads and uses pre-trained AutoDL models to perform actions such as model evaluation and value prediction.

After training auto models, you'd have to use them of course. Blocks in this category are the right tools for the job. They are compatible with all AutoDL models, thanks to our dynamic approach to handling them

## Evaluating an Automated Deep Learning Model

```json
{
    "project_id": 1,
    "parent_id": 8,
    "block_id": 9,
    "function_code": "A_DL_ALL_E",
    "args": {
        "hyp_params": {
            "batch_size": 32
        }
    }
}
```

## Parameter Details

## AutoDL Evaluating

<mark style="color:green;">`POST`</mark>&#x20;

#### Request Body

| Name                                             | Type   | Description                                                         |
| ------------------------------------------------ | ------ | ------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | The `id` of the current project                                     |
| parent\_id<mark style="color:red;">\*</mark>     | int    | The `id` of the previous block                                      |
| block\_id<mark style="color:red;">\*</mark>      | int    | The `id` of the current block                                       |
| function\_code<mark style="color:red;">\*</mark> | String | Function code for the current block                                 |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                                     |
| hyp\_params<mark style="color:red;">\*</mark>    | object | hyper parameters for model evaluation                               |
| batch\_size                                      | int    | Number of samples that are processed by the model during evaluation |

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

```json
{
    "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": {}
    }
}
```

{% endtab %}
{% endtabs %}

## Predicting with an Automated Deep Learning Model

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

## Parameter Details

## AutoDL Predict

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

#### Request Body

| Name                                             | Type   | Description                                                  |
| ------------------------------------------------ | ------ | ------------------------------------------------------------ |
| test\_data<mark style="color:red;">\*</mark>     | String | <p>Input data for prediction<br>Defaults to x\_test\_url</p> |
| 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                          |
| args<mark style="color:red;">\*</mark>           | object | Block arguments                                              |
| add\_dim                                         | bool   | Sets whether an extra dimension should be added to `x` data  |

{% 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": {}
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
// Some code
```

{% endtab %}
{% endtabs %}


# Images, Annotations and Augmentation

Images and Annotations data fetching and modifications endpoints

## Create Image Object

## Create Image

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

#### Request Body

| Name                                          | Type  | Description        |
| --------------------------------------------- | ----- | ------------------ |
| images<mark style="color:red;">\*</mark>      | array | List of Image URLs |
| project\_id<mark style="color:red;">\*</mark> | int   | Project ID         |

{% tabs %}
{% tab title="201: Created " %}

{% endtab %}
{% endtabs %}

## Get Images

## Perform quick and fully-managed model inference&#x20;

<mark style="color:blue;">`GET`</mark> `https://api.autogon.ai/api/v1/label/image`

#### Path Parameters

| Name                                          | Type | Description |
| --------------------------------------------- | ---- | ----------- |
| project\_id<mark style="color:red;">\*</mark> | int  | Project ID  |

{% tabs %}
{% tab title="200: OK Image IDs and annotations data" %}

{% endtab %}
{% endtabs %}

## Delete Images

## Delete images using IDs

<mark style="color:red;">`DELETE`</mark> `https://api.autogon.ai/api/v1/label/image/`

#### Request Body

| Name                                          | Type  | Description        |
| --------------------------------------------- | ----- | ------------------ |
| images                                        | array | Array of image IDs |
| project\_id<mark style="color:red;">\*</mark> | int   | Project ID         |

{% tabs %}
{% tab title="200: OK Deleted Objects" %}

{% endtab %}
{% endtabs %}

## Annotate Images

Sample Request

```json
{
    "project_id": 258,
    "images": [
        {
            "image_id": 91,
            "annotations": [
                {
                    "lbl": "object_class",
                    "bbx": {
                        "x": 452,
                        "y": 134,
                        "w": 241,
                        "h": 143
                    }
                },
                {
                    "lbl": "test_class",
                    "bbx": {
                        "x": 413,
                        "y": 234,
                        "w": 143,
                        "h": 134
                    }
                }
            ]
        },
        {
            "image_url": "https://storage.autogon.ai/......",
            "w": 800,
            "h": 600,
            "annotations": [
                {
                    "lbl": "object_class",
                    "bbx": {
                        "x": 452,
                        "y": 134,
                        "w": 241,
                        "h": 143
                    }
                },
                {
                    "lbl": "test_class",
                    "bbx": {
                        "x": 413,
                        "y": 234,
                        "w": 143,
                        "h": 134
                    }
                }
            ]
        }
    ]
}
```

## Modifiy Image Annotations

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/label/image/annotate`

#### Request Body

| Name                                          | Type  | Description                                                      |
| --------------------------------------------- | ----- | ---------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark> | int   | Project ID                                                       |
| images<mark style="color:red;">\*</mark>      | array | List of image data for each specific image including annotations |

## Image Augmentation

## Augment all

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/label/image/augment/`

Augment all image-annotation pairs in a project

#### Request Body

| Name                                          | Type  | Description                                                                                                                                                                                        |
| --------------------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark> | int   | Project ID                                                                                                                                                                                         |
| augmentations                                 | array | <p>List of augmentations to apply.<br>Default: <code>\["all"]</code><br>Equivalent to: <code>\["HorizontalFlip", "VerticalFlip", "Crop", "HueSaturation", "BrightnessContrast", "Blur"]</code></p> |
| multiplier                                    | int   | <p>Number of augmented images to generate per image<br>Default: <code>3</code></p>                                                                                                                 |

{% tabs %}
{% tab title="200: OK List of images from augmentation" %}

{% endtab %}
{% endtabs %}


# Import and Export

Images and Annotations data import and export APIs

## Import

## Import Images and Annotations

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/label/image/import`

#### Headers

| Name                                           | Type | Description         |
| ---------------------------------------------- | ---- | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> |      | multipart/form-data |

#### Request Body

| Name                                          | Type | Description         |
| --------------------------------------------- | ---- | ------------------- |
| dataset<mark style="color:red;">\*</mark>     | file | zipped dataset file |
| project\_id<mark style="color:red;">\*</mark> | int  | Project ID          |

{% tabs %}
{% tab title="201: Created " %}

{% endtab %}
{% endtabs %}

## Get Images

## Modifiy Image Annotations

<mark style="color:blue;">`GET`</mark> `https://api.autogon.ai/api/v1/label/image/annotate`

#### Request Body

| Name                                          | Type  | Description                                                      |
| --------------------------------------------- | ----- | ---------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark> | int   | Project ID                                                       |
| images<mark style="color:red;">\*</mark>      | array | List of image data for each specific image including annotations |


# Model Training and Prediction

APIs for model training and annotation predictions

## Train Model

## Train model

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/label/model/train/`

#### Request Body

| Name                                          | Type   | Description                                                                                                                    |
| --------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| model\_type<mark style="color:red;">\*</mark> | string | <p>String constant of model\_type.<br>Supported types:<br><code>'small'</code>, <code>'medium'</code>,<code>'large'</code></p> |
| project\_id<mark style="color:red;">\*</mark> | int    | Project ID                                                                                                                     |
| model\_load\_name                             | string | Name of model to be loaded for retraining. Leave as `null` to train a fresh model                                              |
| model\_save\_name                             | string | Name used to save the model to be trained                                                                                      |

{% tabs %}
{% tab title="201: Created Model metrics" %}

{% endtab %}
{% endtabs %}

## Make Predictions

## Predict annotations

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/label/model/predict/`

#### Request Body

| Name                                          | Type   | Description                                   |
| --------------------------------------------- | ------ | --------------------------------------------- |
| app\_id<mark style="color:red;">\*</mark>     | int    | Project's app ID                              |
| image\_urls<mark style="color:red;">\*</mark> | array  | List of image urls for annotations prediction |
| confidence\_thresh                            | float  | Minimum confidence threshold to return        |
| overlap\_thresh                               | float  | Minimum boundiing box overlap threshold       |
| model\_name<mark style="color:red;">\*</mark> | string | Name of model to use for predicting           |

{% tabs %}
{% tab title="200: OK Annotations" %}

{% endtab %}
{% endtabs %}


# Production Pipelines

Pipelines, for MLOps, efficiently integrate your data with streamlined processing and make inference with your pre-built models.

## Generate Dataset From Scalar/Vector Values

Our production pipelines works strictly with your dataset in CSV or JSON files. This API is exposed to ease the generation of dataset from single values or vector of values to be used for prediction.

## Generate dataset API

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

To prepare a single value for prediction, pass the single value. To prepare for multiple values, pass them in an array. To prepare multi-dimensional values, pass them in nested arrays.

#### Path Parameters

| Name                                   | Type    | Description                              |
| -------------------------------------- | ------- | ---------------------------------------- |
| data<mark style="color:red;">\*</mark> | Various | Value(s) to be generated for prediction. |

{% tabs %}
{% tab title="200: OK URL to CSV for prediction use" %}

````
"To make an HTTP request in Python, you can use the built-in `requests` module. Here is an example:\n\n```python\nimport requests\n\nresponse = requests.get('https://www.example.com')\nprint(response.text)\n```\n\nThis code sends a GET request to `https://www.example.com` and prints the response content. You can also send other types of requests (POST, PUT, DELETE, etc.) by changing the method in the `requests` function. For example:\n\n```python\nimport requests\n\npayload = {'key1': 'value1', 'key2': 'value2'}\nresponse = requests.post('https://www.example.com/post', data=payload)\nprint(response.text)\n```\n\nThis code sends a POST request to `https://www.example.com/post` with a payload of `{'key1': 'value1', 'key2': 'value2'}` and prints the response content."
````

{% endtab %}
{% endtabs %}

## Make Predictions

## Perform quick and fully-managed model inference&#x20;

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

#### Request Body

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| test\_data<mark style="color:red;">\*</mark> | string | Dataset to be predicted                  |
| flow\_id                                     | String | Pipeline identifier to use for inference |

{% tabs %}
{% tab title="200: OK Inference results" %}

```
```

{% endtab %}
{% endtabs %}


# Vision AI

Fully managed production environment to create your own computer vision applications.

## Benefits

* **Accelerate Time-to-Value:** Effortlessly construct, deploy, and oversee computer vision applications tailored to your distinct business requirements. Leverage pre-trained APIs, AutoML, and custom models to streamline development and reduce complexity.
* **Versatility for Diverse Needs:** Address a range of applications and skill levels. Choose between plug-and-play analytics through APIs, custom machine learning models, or comprehensive end-to-end development environments, all available within our vision portfolio.
* **Assured quality from the leader in vision of:** Benefit from investments in vision across our portfolio. Vision offerings have received the highest ratings from several analyst firms.

## Detect Text In Images (`text_detection)`

## Text Detection (Image)

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/vision-ai/`

`TEXT_DETECTION` detects and **extracts text from any image**. For example, a photograph might contain a street sign or traffic sign. The JSON includes the entire extracted string, as well as individual words, and their bounding boxes.

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                        | Type   | Description                                 |
| ------------------------------------------- | ------ | ------------------------------------------- |
| operation<mark style="color:red;">\*</mark> | String | operation to be performed: `text_detection` |
| image<mark style="color:red;">\*</mark>     | File   | image file to be processed                  |

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

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Detect Text In Documents (`document_text_detection`)&#x20;

## Text Detection (Documents)

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/vision-ai/`

`DOCUMENT_TEXT_DETECTION` also extracts text from an image, but the response is **optimized for dense text and documents**. The JSON includes page, block, paragraph, word, and break information.

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name      | Type   | Description                                          |
| --------- | ------ | ---------------------------------------------------- |
| operation | String | operation to be performed: `document_text_detection` |
| image     | File   | image to be processed                                |

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

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Detect Labels In Images (`label_detection)`

## Label Detection

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/vision-ai/`

`LABEL_DETECTION` can identify general objects, locations, activities, animal species, products, and more.

#### Headers

| Name         | Type   | Description         |
| ------------ | ------ | ------------------- |
| Content-Type | String | multipart/form-data |

#### Request Body

| Name                                        | Type   | Description                                  |
| ------------------------------------------- | ------ | -------------------------------------------- |
| image<mark style="color:red;">\*</mark>     | File   | image to be processed                        |
| operation<mark style="color:red;">\*</mark> | String | operation to be performed: `label_detection` |

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

```json
{
    "success": true,
    "data": {
        "labelAnnotations": [
            {
                "mid": "/m/01m3v",
                "description": "Computer",
                "score": 0.9151083,
                "topicality": 0.9151083,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            },
            {
                "mid": "/m/01jwgf",
                "description": "Product",
                "score": 0.90773267,
                "topicality": 0.90773267,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            },
            {
                "mid": "/m/0j62f",
                "description": "Rectangle",
                "score": 0.8904041,
                "topicality": 0.8904041,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            },
            {
                "mid": "/m/03gq5hm",
                "description": "Font",
                "score": 0.853358,
                "topicality": 0.853358,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            },
            {
                "mid": "/m/05khh",
                "description": "Operating system",
                "score": 0.8318895,
                "topicality": 0.8318895,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            },
            {
                "mid": "/m/0643t",
                "description": "Personal computer",
                "score": 0.8156862,
                "topicality": 0.8156862,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            },
            {
                "mid": "/m/01mf0",
                "description": "Software",
                "score": 0.80540884,
                "topicality": 0.80540884,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            },
            {
                "mid": "/m/01zbnw",
                "description": "Screenshot",
                "score": 0.80162287,
                "topicality": 0.80162287,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            },
            {
                "mid": "/m/07c1v",
                "description": "Technology",
                "score": 0.77332705,
                "topicality": 0.77332705,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            },
            {
                "mid": "/m/0541p",
                "description": "Multimedia",
                "score": 0.7660149,
                "topicality": 0.7660149,
                "locale": "",
                "confidence": 0,
                "locations": [],
                "properties": []
            }
        ],
        "faceAnnotations": [],
        "landmarkAnnotations": [],
        "logoAnnotations": [],
        "localizedObjectAnnotations": [],
        "textAnnotations": []
    }
}
```

{% endtab %}
{% endtabs %}

## Detect Landmarks In Images (`landmark_detection)`

## Landmark Detection

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/vision-ai/`

`LANDMARK_DETECTION` detects popular natural and human-made structures within an image.

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                        | Type   | Description                                     |
| ------------------------------------------- | ------ | ----------------------------------------------- |
| image<mark style="color:red;">\*</mark>     | File   | image to be processed                           |
| operation<mark style="color:red;">\*</mark> | String | operation to be performed: `landmark_detection` |

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

```json
{
    "success": true,
    "data": {
        "landmarkAnnotations": [
            {
                "mid": "/m/02_2j2l",
                "description": "Charleston Park",
                "score": 0.45514682,
                "boundingPoly": {
                    "vertices": [
                        {
                            "x": 0,
                            "y": 0
                        },
                        {
                            "x": 3024,
                            "y": 0
                        },
                        {
                            "x": 3024,
                            "y": 2212
                        },
                        {
                            "y": 2212,
                            "x": 0
                        }
                    ],
                    "normalizedVertices": []
                },
                "locations": [
                    {
                        "latLng": {
                            "latitude": 37.42209959999999,
                            "longitude": -122.0819686
                        }
                    }
                ],
                "locale": "",
                "confidence": 0,
                "topicality": 0,
                "properties": []
            },
            {
                "mid": "/m/07mj0b",
                "description": "Shoreline Amphitheatre",
                "score": 0.42295343,
                "boundingPoly": {
                    "vertices": [
                        {
                            "x": 0,
                            "y": 0
                        },
                        {
                            "x": 3024,
                            "y": 0
                        },
                        {
                            "x": 3024,
                            "y": 2212
                        },
                        {
                            "y": 2212,
                            "x": 0
                        }
                    ],
                    "normalizedVertices": []
                },
                "locations": [
                    {
                        "latLng": {
                            "latitude": 37.4268342,
                            "longitude": -122.08070230000001
                        }
                    }
                ],
                "locale": "",
                "confidence": 0,
                "topicality": 0,
                "properties": []
            },
            {
                "mid": "/g/11b73jyz5y",
                "description": "Google Android Statues Square",
                "score": 0.42287928,
                "boundingPoly": {
                    "vertices": [
                        {
                            "x": 0,
                            "y": 0
                        },
                        {
                            "x": 3024,
                            "y": 0
                        },
                        {
                            "x": 3024,
                            "y": 2212
                        },
                        {
                            "y": 2212,
                            "x": 0
                        }
                    ],
                    "normalizedVertices": []
                },
                "locations": [
                    {
                        "latLng": {
                            "latitude": 37.4184266,
                            "longitude": -122.08802519999999
                        }
                    }
                ],
                "locale": "",
                "confidence": 0,
                "topicality": 0,
                "properties": []
            }
        ],
        "faceAnnotations": [],
        "logoAnnotations": [],
        "labelAnnotations": [],
        "localizedObjectAnnotations": [],
        "textAnnotations": []
    }
}
```

{% endtab %}
{% endtabs %}

## Detect Logo In Image (`logo_detection)`&#x20;

## Logo Detection

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/vision-ai/`

`LOGO_DETECTION`detects popular product logos within an image.

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                        | Type   | Description                                 |
| ------------------------------------------- | ------ | ------------------------------------------- |
| image<mark style="color:red;">\*</mark>     | File   | image to be processed                       |
| operation<mark style="color:red;">\*</mark> | String | operation to be performed: `logo_detection` |

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

```json
{
    "success": true,
    "data": {
        "logoAnnotations": [
            {
                "mid": "/m/045c7b",
                "description": "Google",
                "score": 0.9447075,
                "boundingPoly": {
                    "vertices": [
                        {
                            "x": 969,
                            "y": 677
                        },
                        {
                            "x": 1536,
                            "y": 677
                        },
                        {
                            "x": 1536,
                            "y": 1072
                        },
                        {
                            "x": 969,
                            "y": 1072
                        }
                    ],
                    "normalizedVertices": []
                },
                "locale": "",
                "confidence": 0,
                "topicality": 0,
                "locations": [],
                "properties": []
            }
        ],
        "faceAnnotations": [],
        "landmarkAnnotations": [],
        "labelAnnotations": [],
        "localizedObjectAnnotations": [],
        "textAnnotations": []
    }
}
```

{% endtab %}
{% endtabs %}

## Detect Web entities and pages (`web_detection`)  (Deprecated)

## Web Detection

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/vision-ai/`

`WEB_DETECTION` detects the most likely owners of faces in an image and also Web references to an image.

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                        | Type   | Description                                |
| ------------------------------------------- | ------ | ------------------------------------------ |
| image<mark style="color:red;">\*</mark>     | File   | image to be processed                      |
| operation<mark style="color:red;">\*</mark> | String | operation to be performed: `web_detection` |

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

```json
{
    "success": true,
    "data": {
        "webDetection": {
            "webEntities": [
                {
                    "entityId": "/g/11f53qsk8f",
                    "score": 12.1215,
                    "description": "Juice WRLD"
                },
                {
                    "entityId": "/t/24gkcc11n6yx7",
                    "score": 0.7112,
                    "description": ""
                },
                {
                    "entityId": "/g/11c2k2k6gm",
                    "score": 0.7112,
                    "description": "SoundCloud"
                },
                {
                    "entityId": "/m/04zxmr8",
                    "score": 0.7041,
                    "description": "SoundCloud"
                },
                {
                    "entityId": "/m/0glt670",
                    "score": 0.6141,
                    "description": "Hip hop music"
                },
                {
                    "entityId": "/g/11pws4_dzr",
                    "score": 0.6012,
                    "description": ""
                },
                {
                    "entityId": "/m/0rz017g",
                    "score": 0.562,
                    "description": ""
                },
                {
                    "entityId": "/m/04yhd6c",
                    "score": 0.562,
                    "description": "Spotify"
                },
                {
                    "entityId": "/m/09jcvs",
                    "score": 0.5599,
                    "description": "YouTube"
                },
                {
                    "entityId": "/m/0svml3_",
                    "score": 0.5599,
                    "description": ""
                }
            ],
            "fullMatchingImages": [
                {
                    "url": "https://oboi-download.ru/files/wallpapers/881/23989.jpg",
                    "score": 0
                },
                {
                    "url": "https://images.hdqwalls.com/download/juice-wrld-a4-3840x2160.jpg",
                    "score": 0
                },
                {
                    "url": "https://preview.redd.it/tvhbb8mo3ps71.jpg?auto=webp&s=e2af382fe56ca3ea74a1fc8783fa879c9977a0d0",
                    "score": 0
                },
                {
                    "url": "https://i.redd.it/tvhbb8mo3ps71.jpg",
                    "score": 0
                },
                {
                    "url": "https://www.pixel4k.com/preview.php?src=https://www.pixel4k.com/wp-content/uploads/2020/12/juice-wrld-4k_1607632977.jpg&w=2560&h=1440",
                    "score": 0
                },
                {
                    "url": "https://images.hdqwalls.com/download/juice-wrld-a4-2560x1440.jpg",
                    "score": 0
                },
                {
                    "url": "https://images.hdqwalls.com/download/juice-wrld-a4-2560x1080.jpg",
                    "score": 0
                },
                {
                    "url": "https://www.pixel4k.com/preview.php?src=https://www.pixel4k.com/wp-content/uploads/2020/12/juice-wrld-4k_1607632977.jpg&w=2560&h=1024",
                    "score": 0
                },
                {
                    "url": "https://wallpaperaccess.com/full/4484535.jpg",
                    "score": 0
                },
                {
                    "url": "https://images.hdqwalls.com/download/juice-wrld-a4-2048x1152.jpg",
                    "score": 0
                }
            ],
            "partialMatchingImages": [
                {
                    "url": "https://i.ytimg.com/vi/3yOXPCvZSWw/maxresdefault.jpg",
                    "score": 0
                },
                {
                    "url": "https://stream.kick.com/thumbnails/livestream/598072/thumb614/video_thumbnail/conversion/thumb614-video_thumbnail.webp",
                    "score": 0
                },
                {
                    "url": "https://cutewallpaper.org/23/american-mountain-android-cell-phone-wallpaper/3025832262.jpg",
                    "score": 0
                },
                {
                    "url": "https://www.hdwallpapers.in/download/american_rapper_juice_wrld_on_motor_bike_in_mountains_background_wearing_black_dress_4k_hd_juice_wrld-2560x1440.jpg",
                    "score": 0
                },
                {
                    "url": "https://wallpaperfordesktop.com/wp-content/uploads/2021/09/Juice-WRLD-Wallpaper-2.jpg",
                    "score": 0
                },
                {
                    "url": "https://www.hdwallpapers.in/download/american_rapper_juice_wrld_on_motor_bike_in_mountains_background_wearing_black_dress_4k_hd_juice_wrld-3840x2160.jpg",
                    "score": 0
                },
                {
                    "url": "https://www.hdwallpapers.in/download/american_rapper_juice_wrld_on_motor_bike_in_mountains_background_wearing_black_dress_4k_hd_juice_wrld-1600x900.jpg",
                    "score": 0
                },
                {
                    "url": "https://wallpapersflix.com/wp-content/uploads/2020/07/Juice-Wrld-Desktop-Wallpaper-1-1024x576.jpg",
                    "score": 0
                },
                {
                    "url": "https://wallsbazar.com/wp-content/uploads/2021/10/Juice-WRLD-Computer-Wallpaper-HD.jpg",
                    "score": 0
                },
                {
                    "url": "https://i.ytimg.com/vi/os6Q8F0_o-Y/maxresdefault.jpg",
                    "score": 0
                }
            ],
            "pagesWithMatchingImages": [
                {
                    "url": "https://www.youtube.com/watch?v=ba7wi64igHk",
                    "pageTitle": "<b>Juice WRLD</b> - Walk This Way (Music Video) - YouTube",
                    "partialMatchingImages": [
                        {
                            "url": "https://i.ytimg.com/vi/iAve0MvJISI/hqdefault.jpg?sqp=-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==&rs=AOn4CLAXqmrlYXZDXzg35ghHOHdhB8hQlA",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                },
                {
                    "url": "https://www.youtube.com/watch?v=YrBJie_A3rI",
                    "pageTitle": "<b>Juice WRLD</b> - My Flaws (Unreleased)[Prod. Red Limits] - YouTube",
                    "partialMatchingImages": [
                        {
                            "url": "https://i.ytimg.com/vi/mLDQH7tBjNU/hqdefault.jpg?sqp=-oaymwE8CKgBEF5IWvKriqkDLwgBFQAAAAAYASUAAMhCPQCAokN4AfABAfgB_gmAAtAFigIMCAAQARhOIGUoYjAP&rs=AOn4CLBsT6hWH6tYoKmxHAa1A2CsLM_MEw",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                },
                {
                    "url": "https://www.youtube.com/watch?v=V74ZFKJIT9Y",
                    "pageTitle": "<b>Juice WRLD</b> - Draco on me (Unreleased) - YouTube",
                    "partialMatchingImages": [
                        {
                            "url": "https://i.ytimg.com/vi/iAve0MvJISI/hqdefault.jpg?sqp=-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==&rs=AOn4CLAXqmrlYXZDXzg35ghHOHdhB8hQlA",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                },
                {
                    "url": "https://www.youtube.com/watch?v=os6Q8F0_o-Y",
                    "pageTitle": "<b>Juice WRLD</b> - Lonely ft. Polo G &amp; Machine Gun Kelly ... - YouTube",
                    "partialMatchingImages": [
                        {
                            "url": "https://i.ytimg.com/vi/os6Q8F0_o-Y/mqdefault.jpg",
                            "score": 0
                        },
                        {
                            "url": "https://i.ytimg.com/vi/os6Q8F0_o-Y/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLDIp1n01hbom8qjv_wh56lhLrPUxQ",
                            "score": 0
                        },
                        {
                            "url": "https://i.ytimg.com/vi/os6Q8F0_o-Y/maxresdefault.jpg",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                },
                {
                    "url": "https://soundcloud.com/user-411448275/sets/juice-wrld-studio-sessions",
                    "pageTitle": "<b>Juice Wrld</b> STUDIO SESSIONS - SoundCloud",
                    "partialMatchingImages": [
                        {
                            "url": "https://i1.sndcdn.com/artworks-PMJJQUNEBOrwDuFw-XTwXZw-t240x240.jpg",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                },
                {
                    "url": "https://open.spotify.com/playlist/0jLiasxMwWiZEDOw14Hh9j",
                    "pageTitle": "<b>Juice WRLD</b> Type Songs - playlist by @trabbey - Spotify",
                    "partialMatchingImages": [
                        {
                            "url": "https://i.scdn.co/image/ab67706c0000da848e325f487918c4e6f28c8489",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                },
                {
                    "url": "https://soundcloud.com/strmynghts2/shoot-back-w-juice-wrld",
                    "pageTitle": "Shoot Back (w/ <b>Juice WRLD</b>) - Strmy Nghts - SoundCloud",
                    "partialMatchingImages": [
                        {
                            "url": "https://i1.sndcdn.com/artworks-UnU9o0LxyhhYhxpK-GcWj9Q-t240x240.jpg",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                },
                {
                    "url": "https://soundcloud.com/user-231868378/murder-rate-1",
                    "pageTitle": "Murder Rate (Skip to :58) - <b>Juice WRLD</b> - SoundCloud",
                    "partialMatchingImages": [
                        {
                            "url": "https://i1.sndcdn.com/avatars-IMUohpyWZoigVIqx-pqiyog-t240x240.jpg",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                },
                {
                    "url": "https://unsplash.com/s/photos/juice-wrld",
                    "pageTitle": "750+ <b>Juice Wrld</b> Pictures | Download Free Images on Unsplash",
                    "partialMatchingImages": [
                        {
                            "url": "https://images.unsplash.com/photo-1575918679350-bf26b1b4da71?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8anVpY2UlMjB3cmxkfGVufDB8fDB8fA%3D%3D&w=1000&q=80",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                },
                {
                    "url": "https://soundcloud.com/vendettawrld_039/cowboy-hunt-juice-wrld-1",
                    "pageTitle": "COWBOY HUNT • <b>Juice WRLD</b> - SoundCloud",
                    "partialMatchingImages": [
                        {
                            "url": "https://i1.sndcdn.com/artworks-UnU9o0LxyhhYhxpK-GcWj9Q-t240x240.jpg",
                            "score": 0
                        }
                    ],
                    "score": 0,
                    "fullMatchingImages": []
                }
            ],
            "visuallySimilarImages": [
                {
                    "url": "https://w0.peakpx.com/wallpaper/342/806/HD-wallpaper-american-rapper-juice-wrld-on-motor-bike-in-mountains-background-wearing-black-dress-juice-wrld.jpg",
                    "score": 0
                },
                {
                    "url": "https://i.ytimg.com/vi/ICDeevqrMIs/maxresdefault.jpg",
                    "score": 0
                },
                {
                    "url": "https://i.pinimg.com/736x/2a/16/81/2a16815d3e6219a4954801cf3fc522b6.jpg",
                    "score": 0
                },
                {
                    "url": "https://images.hdqwalls.com/download/juice-wrld-5k-85-1366x768.jpg",
                    "score": 0
                },
                {
                    "url": "https://img.youtube.com/vi/xaCvFsCM3GU/0.jpg",
                    "score": 0
                },
                {
                    "url": "https://i.guim.co.uk/img/media/ecef4c321a2f47ca1788a25443a820f7ec45c012/1802_511_5069_3041/500.jpg?quality=85&auto=format&fit=max&s=fc43386beae4af2d0c91e62f78ce94f3",
                    "score": 0
                },
                {
                    "url": "https://i.redd.it/h1r304b7pkr51.jpg",
                    "score": 0
                },
                {
                    "url": "https://4kwallpapers.com/images/wallpapers/juice-wrld-fighting-2560x1440-9496.jpeg",
                    "score": 0
                },
                {
                    "url": "https://images.unsplash.com/photo-1575918620264-7f672ce5b7f6?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Nnx8anVpY2UlMjB3cmxkfGVufDB8fDB8fA%3D%3D&w=1000&q=80",
                    "score": 0
                },
                {
                    "url": "https://e1.pxfuel.com/desktop-wallpaper/414/728/desktop-wallpaper-juice-wrld-gherbo-shares-the-stage-at-isu-g-herbo-and-juice-wrld-thumbnail.jpg",
                    "score": 0
                }
            ],
            "bestGuessLabels": [
                {
                    "label": "juice wrld",
                    "languageCode": "en"
                }
            ]
        },
        "faceAnnotations": [],
        "landmarkAnnotations": [],
        "logoAnnotations": [],
        "labelAnnotations": [],
        "localizedObjectAnnotations": [],
        "textAnnotations": []
    }
}


```

{% endtab %}
{% endtabs %}

## Detect Objects in Images (object\_detection)

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/vision-ai/`

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                        | Type   | Description                                   |
| ------------------------------------------- | ------ | --------------------------------------------- |
| image<mark style="color:red;">\*</mark>     | File   | image to be processed                         |
| operation<mark style="color:red;">\*</mark> | String | Operation to be performed (object\_detection) |

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

```json
{
    "success": true,
    "data": {
        "localizedObjectAnnotations": [
            {
                "mid": "/m/01bqk0",
                "name": "Bicycle wheel",
                "score": 0.9002501,
                "boundingPoly": {
                    "normalizedVertices": [
                        {
                            "x": 0.31731018,
                            "y": 0.7903423
                        },
                        {
                            "x": 0.44589233,
                            "y": 0.7903423
                        },
                        {
                            "x": 0.44589233,
                            "y": 0.97311586
                        },
                        {
                            "x": 0.31731018,
                            "y": 0.97311586
                        }
                    ],
                    "vertices": []
                },
                "languageCode": ""
            },
            {
                "mid": "/m/0h9mv",
                "name": "Tire",
                "score": 0.8839195,
                "boundingPoly": {
                    "normalizedVertices": [
                        {
                            "x": 0.5012414,
                            "y": 0.76509905
                        },
                        {
                            "x": 0.62809473,
                            "y": 0.76509905
                        },
                        {
                            "x": 0.62809473,
                            "y": 0.94585633
                        },
                        {
                            "x": 0.5012414,
                            "y": 0.94585633
                        }
                    ],
                    "vertices": []
                },
                "languageCode": ""
            },
            {
                "mid": "/m/0199g",
                "name": "Bicycle",
                "score": 0.7687283,
                "boundingPoly": {
                    "normalizedVertices": [
                        {
                            "x": 0.3199663,
                            "y": 0.66994625
                        },
                        {
                            "x": 0.63588053,
                            "y": 0.66994625
                        },
                        {
                            "x": 0.63588053,
                            "y": 0.9711194
                        },
                        {
                            "x": 0.3199663,
                            "y": 0.9711194
                        }
                    ],
                    "vertices": []
                },
                "languageCode": ""
            },
            {
                "mid": "/m/06z37_",
                "name": "Picture frame",
                "score": 0.64136606,
                "boundingPoly": {
                    "normalizedVertices": [
                        {
                            "x": 0.78812456,
                            "y": 0.15784176
                        },
                        {
                            "x": 0.9710552,
                            "y": 0.15784176
                        },
                        {
                            "x": 0.9710552,
                            "y": 0.31219316
                        },
                        {
                            "x": 0.78812456,
                            "y": 0.31219316
                        }
                    ],
                    "vertices": []
                },
                "languageCode": ""
            }
        ],
        "faceAnnotations": [],
        "landmarkAnnotations": [],
        "logoAnnotations": [],
        "labelAnnotations": [],
        "textAnnotations": []
    }
}
```

{% endtab %}
{% endtabs %}

## Image Generation

## Creates an image given a prompt.

<mark style="color:green;">`POST`</mark> `http://api.autogon.ai/services/image-generation/`

Given a prompt and/or an input image, this endpoint will generate a new image.

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                     | Type   | Description                                                                                                 |
| ---------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------- |
| prompt<mark style="color:red;">\*</mark> | String | A text description of the desired image(s). The maximum length is 1000 characters.                          |
| output\_size                             | String | The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024, defaults to 512x512.` |

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

```json
{
    "image_url": "https://example-image-url.com",
    "date_created": "2023-04-15 10:30:49.882687"
}
```

{% endtab %}
{% endtabs %}

## License Plate Detector

Detects license plate in a given image

<mark style="color:green;">`POST`</mark> `http://api.autogon.ai/services/license-plate-detection/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body&#x20;

| Name                                          | Type  | Description                                          |
| --------------------------------------------- | ----- | ---------------------------------------------------- |
| image\_urls<mark style="color:red;">\*</mark> | Array | An array of image urls with images of license plates |
| <p></p><p>confidence\_thresh</p>              | Float | Default: 0.5                                         |
| overlap\_thresh                               | Float | Default: 0.5                                         |

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

```json
{
  "https://storage.autogon.ai/45c16e3a-924f-4db0-8db7-0b043598f093.jpg": [
    {
      "lbl_id": 0,
      "lbl": "LP",
      "bbx": {
        "x": 59.0321159362793,
        "y": 434.32745361328125,
        "w": 267.5981750488281,
        "h": 140.85491943359375
      },
      "conf": 0.9056000113487244
    },
    {
      "lbl_id": 0,
      "lbl": "LP",
      "bbx": {
        "x": 543.1251220703125,
        "y": 363.24102783203125,
        "w": 179.230224609375,
        "h": 43.1021728515625
      },
      "conf": 0.7953004240989685
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Motion Detection

Provides real time, accurate motion tracking for video streams

<mark style="color:green;">`POST`</mark> `http://api.autogon.ai/services/motion-detection/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body&#x20;

| Name                                    | Type | Description                 |
| --------------------------------------- | ---- | --------------------------- |
| video<mark style="color:red;">\*</mark> | File | video file to detect motion |

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

```json
{
  "fps": 12.0,
  "annotations": {
    "5": [
      {
        "bbx": {
          "x": 0,
          "y": 568,
          "w": 576,
          "h": 276
        }
      }
    ],
    "6": [
      {
        "bbx": {
          "x": 34,
          "y": 708,
          "w": 110,
          "h": 86
        }
      },
      {
        "bbx": {
          "x": 0,
          "y": 671,
          "w": 576,
          "h": 249
        }
      },
      {
        "bbx": {
          "x": 0,
          "y": 663,
          "w": 120,
          "h": 15
        }
      }
    ],
  }
}
```

{% endtab %}
{% endtabs %}

## Stable Diffusion (Deprecated)

Generate Images from Text

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/stable-diffusion/`

#### Headers

| Name                                           | Type | Description      |
| ---------------------------------------------- | ---- | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> |      | application/json |

#### Request Body

| Name                                   | Type   | Description                                |
| -------------------------------------- | ------ | ------------------------------------------ |
| text<mark style="color:red;">\*</mark> | String | Short description of image to be generated |

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

```json
{
    "status": true,
    "image": "https://test-image.png"
}
```

{% endtab %}
{% endtabs %}

## Image Captioning (Deprecated)

Analyzes an image and generates captions for images

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/image-captioning/`

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                         | Type   | Description                                               |
| -------------------------------------------- | ------ | --------------------------------------------------------- |
| image<mark style="color:red;">\*</mark>      | File   | image to be captioned                                     |
| image\_url<mark style="color:red;">\*</mark> | String | url of the image to be captioned (should be downloadable) |

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

```json
{
    "status": true,
    "message": "a ball with a yellow ball inside of it "
}
```

{% endtab %}
{% endtabs %}

## Document Question and Answering (Deprecated)

Leverage AI models capable of answering questions based on the content of a given document.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/document-qa/`

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| question<mark style="color:red;">\*</mark> | String |             |
| document\_url                              | String |             |
| document                                   | File   |             |

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

```json
{
    "status": True, 
    "message": answer
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "status": False, 
    "message": error message
}
```

{% endtab %}
{% endtabs %}

## Visual Question and Answering (Deprecated)

Generate accurate answers about an image based on the visual content of the image

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/vilt-vq/`

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                   | Type   | Description |
| -------------------------------------- | ------ | ----------- |
| text<mark style="color:red;">\*</mark> | String |             |
| image                                  | File   |             |
| image\_url                             | String |             |

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

```json
{
    "status": true,
    "message": "very"
}
```

{% endtab %}
{% endtabs %}


# Natural Language AI

Fully managed production environment to create your own natural language applications.

All endpoints in this collection except that of Chatbot are protected and require authentication using an `X-AUG-KEY` as the authorization header.

To authenticate your requests, include an `X-AUG-KEY` header in the following format:

```json
X-AUG-KEY: YOUR_API_KEY
```

Replace `YOUR_API_KEY` with your unique API Key created on the [Autogon Console](https://console.autogon.ai/)


# Text Classification  (Deprecated)

This classifies texts based on positivity and negativity with scores for each class.

The Text Classification API is a robust tool designed to analyze and classify textual data based on positivity and negativity. This API assigns scores to each class, indicating the degree of positivity or negativity present in the provided text.

#### Pricing

Requests made to the Text Classification API are billed. Prices are based on the number of characters sent to the service to be classified.

The pricing for API requests is as follows:

* **Per Request Cost**: 3 units base cost per request.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/text-classification/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                   | Type   | Description           |
| -------------------------------------- | ------ | --------------------- |
| text<mark style="color:red;">\*</mark> | String | Text to be classified |

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

```json
[
    {
        "label": "POSITIVE",
        "score": 0.465040385723114
    },
    {
        "label": "NEGATIVE",
        "score": 0.534959614276886
    }
]
```

{% endtab %}
{% endtabs %}


# Text Summary  (Deprecated)

Summarize natural language with pre-trained text engines.

The Text Summary API is a powerful tool designed to generate concise summaries from natural language text. This API utilizes pre-trained text summarization engines to extract essential information and condense lengthy passages into shorter, coherent summaries. The API allows developers to specify the minimum and maximum length of the generated summaries.

#### Pricing

Requests made to the Text Summary API are billed. Prices are based on the number of characters sent to the service to be summarized.

The pricing for API requests is as follows:

* **Per Request Cost**: 3 units base cost per request.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/text-summary/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                   | Type    | Description                                                   |
| -------------------------------------- | ------- | ------------------------------------------------------------- |
| text<mark style="color:red;">\*</mark> | String  | The text to be summarized                                     |
| max\_length                            | Integer | Specifies the maximum length of the summary. Defaults to 130. |
| min\_length                            | Integer | Specifies the minimum length of the summary. Defaults to 30.  |

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

```json
```

{% endtab %}
{% endtabs %}


# Ask Your Data

Query your data using natural language.

Leverage on artificial intelligence to help you work with your data, ranging from tasks such as data cleansing, data analytics, to data visualization, and more.

#### Pricing

Requests made to the Ask Your Data API are billed.

The pricing for API requests is as follows:

* **Per Request Cost**: 3 units base cost per request.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/ask-your-data/`

The Ask Your Data API empowers developers to directly query their datasets using natural language without having to use SQL or any programming language.

It is recommended you use the [upload](https://docs.autogon.ai/autogon-qore/natural-language-ai/pages/UGxplb3QjCSpqvgd4xY4#uploads-a-dataset.) endpoint with your dataset to generate a dataset URL.

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                     | Type   | Description                                               |
| ---------------------------------------- | ------ | --------------------------------------------------------- |
| data<mark style="color:red;">\*</mark>   | String | URL to dataset to be queried                              |
| prompt<mark style="color:red;">\*</mark> | String | Query text (Ex: Give me a chart of the first two columns) |

{% tabs %}
{% tab title="200: OK Signed URL to queried content" %}

```json
{
    "status": true,
    "data": ""
}

```

{% endtab %}
{% endtabs %}


# Generate Synthetic Data

This API is designed to generate synthetic datasets.

The Synthetic Data Generation API is a versatile tool designed to create synthetic datasets based on user-defined prompts and specifications regarding the number of rows required. This API allows developers to generate artificial datasets that mimic real-world data while meeting specific criteria provided by the user.

#### Pricing

Requests made to the Synthetic Data Generation API are billed.

The pricing for API requests is as follows:

* **Per Request Cost**: 3 units base cost per request.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/generate-data/`

This API endpoint takes two json parameters the "prompt", and number of rows as the "rows" parameter respectively

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                     | Type   | Description                                                                                                                                 |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| prompt<mark style="color:red;">\*</mark> | String | User-defined prompts specifying the structure and characteristics of the dataset. (Ex. "insurance dataset with the columns (name, amount)") |
| rows<mark style="color:red;">\*</mark>   | String | Number of rows needed in the generated dataset.                                                                                             |

{% tabs %}
{% tab title="200: OK Success status and message containing the dataset url" %}

```json
{
    "status": true, 
    "message": "www.generated_dataset_url"
}
```

{% endtab %}
{% endtabs %}


# Speech To Text

Convert speech into text using an API powered by the best of AI technologies.

The Speech To Text (STT) API is a robust tool designed to convert spoken language into written text. This API empowers developers to integrate speech recognition capabilities into their applications, enabling users to interact with spoken language for various purposes.

#### Pricing

Requests made to the Speech To Text (STT) API are billed. Prices are based on the number of characters sent to the service to be synthesized into audio.

The pricing for API requests is as follows:

* **Per Request Cost**: 3 units base cost per request.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/speech-to-text/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                    | Type   | Description                                                  |
| --------------------------------------- | ------ | ------------------------------------------------------------ |
| audio<mark style="color:red;">\*</mark> | File   | Audio to be processed and converted to text                  |
| language\_code                          | String | Specifies the language spoken in the audio, defaults to "en" |

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

```json
{
    "success":true,
    "data":{
        "results":[
            {
                "alternatives":[
                    {
                        "transcript":"example audio transcription by Autogon AI",
                        "confidence":0.922834,
                        "words":[]
                    }],
                "resultEndTime":"19.110s",
                "languageCode":"en-gb",
                "channelTag":0
            }],
        "totalBilledTime":"20s",
        "requestId":"7571580858796951372"
        }
}
```

{% endtab %}
{% endtabs %}


# Text To Speech

Convert text into natural-sounding speech using an API powered by the best of AI technologies.

The Text To Speech (TTS) API is a powerful tool designed to convert text-based input into natural-sounding speech. This API enables developers to integrate speech synthesis capabilities into their applications, providing users with an auditory experience for various use cases.

Text-to-Speech converts text or [Speech Synthesis Markup Language (SSML)](https://en.wikipedia.org/wiki/Speech_Synthesis_Markup_Language) input into audio data like MP3.

#### Pricing

Requests made to the Text To Speech (TTS) API are billed. Prices are based on the number of characters sent to the service to be synthesized into audio.

The pricing for API requests is as follows:

* **Per Request Cost**: 3 units base cost per request.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/text-to-speech/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                   | Type   | Description                                                                         |
| -------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| text<mark style="color:red;">\*</mark> | String | Text to be processed and converted to audio                                         |
| language\_code                         | String | Specifies the language used for speech synthesis, defaults to "en" which is English |

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

```json
{
    "success": true,
    "data": {
        "audio": "http://cloud.autogonai.s3.amazonaws.com/tts-f45a5db2-481b-442f-bb92-d16d0b3d7f72.wav"
    }
}

```

{% endtab %}
{% endtabs %}


# Sentiment Analyzer  (Deprecated)

Sentiment Analysis inspects the given text and identifies the prevailing emotional opinion within the text, especially to determine a writer's attitude as positive, negative, or neutral.

#### Pricing

Requests made to the Sentiment Analysis API are billed. Prices are based on the number of characters sent to the service to be analyzed.

The pricing for API requests is as follows:

* **Per Request Cost**: 3 units base cost per request.

## This API analyzes the sentiment of a text

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/sentiment-analysis/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                   | Type   | Description         |
| -------------------------------------- | ------ | ------------------- |
| text<mark style="color:red;">\*</mark> | String | text to be analyzed |

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

```json
{
    "success": true,
    "data": {
        "documentSentiment": {
            "magnitude": 0.6,
            "score": -0.6
        },
        "language": "en",
        "sentences": [
            {
                "text": {
                    "content": "Bad apple",
                    "beginOffset": -1
                },
                "sentiment": {
                    "magnitude": 0.6,
                    "score": -0.6
                }
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}


# Conversation with Chatbot Agent

The Chatbot Conversation API is a powerful tool designed to enable developers to integrate chatbot functionalities into their applications.

&#x20;This API allows seamless communication between a client application and a custom chatbot service agent, facilitating natural language processing and response generation.

#### Get your Chatbot Agent ID <a href="#collect-customer-information" id="collect-customer-information"></a>

A Chatbot Agent ID is gotten from the [Autogon console](https://console.autogon.ai/) after a successful creation of a chatbot agent, [see here](https://youtu.be/LE9T9K__cv8) on how to create a Chatbot Agent.&#x20;

#### Authentication <a href="#collect-customer-information" id="collect-customer-information"></a>

Requests to this API doesn't require an API Key to be included in its headers

#### Pricing

Requests made to the Chatbot Conversation API are billed. Each message - response cycle incurs a specific charge.

The pricing for API requests is as follows:

* **Per Request Cost**: 0.05 units per API request

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/chatbot/{agent_id}/chat/`

Initiates a new conversation session with the chatbot.

#### Path Parameters

| Name                                        | Type   | Description                                                         |
| ------------------------------------------- | ------ | ------------------------------------------------------------------- |
| agent\_id<mark style="color:red;">\*</mark> | String | Unique identifier for the Agent which responds to the conversation. |

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                       | Type            | Description                                      |
| ------------------------------------------ | --------------- | ------------------------------------------------ |
| question<mark style="color:red;">\*</mark> | String          | message from the user                            |
| session\_id                                | String(UUID v4) | Identifier for the ongoing conversation session. |

{% tabs %}
{% tab title="200: OK Successful Conversation " %}

```json

{
    "status": "true",
    "message": "Chat with agent: {agent_id} successful",
    "data": {
        "session_id": "cb6c2000-3231-47f1-b773-6f611bb1ea2f",
        "question": "hello chatbot",
        "bot_response": "How can I help you"
        }
}
```

{% endtab %}

{% tab title="404: Not Found Incorrect agent\_id" %}

```json
{
    "status": "false",
    "message": "Agent not found"
}
```

{% endtab %}
{% endtabs %}

### Sample request

{% tabs %}
{% tab title="Python (Requests)" %}
{% code lineNumbers="true" %}

```python
import requests
import json

url = "https://api.autogon.ai/api/v1/services/chatbot/test-agent-id-907e43cd56e7/chat/"

payload = json.dumps({
  "session_id": "test-session-id-1497505decbe",
  "question": "Hello Chatbot"
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endcode %}
{% endtab %}

{% tab title="Node.js" %}
{% code lineNumbers="true" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "session_id": "test-session-id-1497505decbe",
  "question": "Hello Chatbot"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.autogon.ai/api/v1/services/chatbot/test-agent-id-907e43cd56e7/chat/',
  headers: { 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endcode %}
{% endtab %}

{% tab title="Curl" %}
{% code overflow="wrap" %}

```json
curl --location 'https://api.autogon.ai/api/v1/services/chatbot/test-agent-id-907e43cd56e7/chat/' \
--header 'Content-Type: application/json' \
--data '{
    "session_id": "test-session-id-1497505decbe",
    "question": "Hello Chatbot"
}'
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Autogon Response

```json
{
    "status": "true",
    "message": "Chat with agent: test-agent-id-907e43cd56e7 successful",
    "data": {
        "session_id": "test-session-id-1497505decbe",
        "question": "Hello Chatbot",
        "bot_response": "How can I help you"
        }
}
```


# Conversational Interaction with GPT-4

Chat with Autogon Chat Completion API using powerful variants of the GPT models.

#### Pricing

Requests made to the Synthetic Data Generation API are billed.

The pricing for API requests is as follows:

* **Per Request Cost**: 3 units base cost per request.

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

#### Path Parameters

| Name                                      | Type   | Description                                   |
| ----------------------------------------- | ------ | --------------------------------------------- |
| message<mark style="color:red;">\*</mark> | string | The messages to generate chat completions for |

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

{% tabs %}
{% tab title="200: OK Sentences, Code blocks or both" %}

````
"To make an HTTP request in Python, you can use the built-in `requests` module. Here is an example:\n\n```python\nimport requests\n\nresponse = requests.get('https://www.example.com')\nprint(response.text)\n```\n\nThis code sends a GET request to `https://www.example.com` and prints the response content. You can also send other types of requests (POST, PUT, DELETE, etc.) by changing the method in the `requests` function. For example:\n\n```python\nimport requests\n\npayload = {'key1': 'value1', 'key2': 'value2'}\nresponse = requests.post('https://www.example.com/post', data=payload)\nprint(response.text)\n```\n\nThis code sends a POST request to `https://www.example.com/post` with a payload of `{'key1': 'value1', 'key2': 'value2'}` and prints the response content."
````

{% endtab %}
{% endtabs %}


# Essay Marker

Generates a detailed metric score for an essay

## Mark an Essay

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/essay-marker/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                                          | Type    | Description                               |
| ------------------------------------------------------------- | ------- | ----------------------------------------- |
| essay<mark style="color:red;">\*</mark>                       | String  | Candidate's essay answer                  |
| question<mark style="color:red;">\*</mark>                    | String  | essay question                            |
| answer                                                        | String  | Reference answer for evaluation. Optional |
| required\_number\_of\_words<mark style="color:red;">\*</mark> | Integer | Required word count for the essay.        |

{% tabs %}
{% tab title="200: OK Successful request" %}

```json
{
  "response_id": "b54021b9-dba9-4132-aabb-31a48318931b",
  "data": {
    "grammatically_correct_score": 95,
    "meaning_score": 90,
    "structure_score": 93,
    "average_score_w4": 93,
    "known_history_score": 0
  }
}
```

{% endtab %}

{% tab title="400: Bad Request" %}
{% code fullWidth="true" %}

```json
{
    "response_id": "b54021b9-dba9-4132-aabb-31a48318931b",
    "error":"Error occurred while marking the essay"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


# Resume Ranker

Ranks a resume if its a best fit for a job description

## Rank Resume

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/rank-resume/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                               | Type   | Description     |
| -------------------------------------------------- | ------ | --------------- |
| job\_description<mark style="color:red;">\*</mark> | String | job description |
| resume\_file<mark style="color:red;">\*</mark>     | File   | resume file     |

{% tabs %}
{% tab title="200: OK Successful request" %}

```json
{
  "status": true,
  "message": "Candidates ranked successfully",
  "data": "53.67%"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}
{% code fullWidth="true" %}

```json
{
    "error":"Job description is required"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


# Translator

Translates a text from one language to another

## Translate

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/text-translation/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

<table><thead><tr><th width="187">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>text<mark style="color:red;">*</mark></td><td>String</td><td>text to translate</td></tr><tr><td>source_language<mark style="color:red;">*</mark></td><td>String</td><td>language to be  translated from</td></tr><tr><td>target_language<mark style="color:red;">*</mark></td><td>String</td><td>language to be translated to</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK Successful request" %}

```json
{
    "success":true,
    "data":"你好"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}
{% code fullWidth="true" %}

```json
{
    "status": False, 
    "data": ""
}

```

{% endcode %}
{% endtab %}
{% endtabs %}


# Voice Cloning

This API enables users to create, manage, and utilize voices for text-to-speech applications. It provides endpoints for creating, retrieving voices, and text to speech using a specific voice.

All endpoints related to dataset management are protected and require authentication using an `X-AUG-KEY` as the authorization header.

To authenticate your requests, include an `X-AUG-KEY` header in the following format:

```json
X-AUG-KEY: YOUR_API_KEY
```

Replace `YOUR_API_KEY` with your unique API Key created on the [Autogon Console](https://console.autogon.ai/)


# Create a Voice

This allows users to create voices, adds a new voice to your collection of voices.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/voice-cloning/voices/`

Creates a new voice and adds it to the user's collection of voices.

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                                 | Type   | Description |
| ---------------------------------------------------- | ------ | ----------- |
| audio<mark style="color:red;">\*</mark>              | File   |             |
| voice\_description<mark style="color:red;">\*</mark> | String |             |
| voice\_name<mark style="color:red;">\*</mark>        | String |             |

{% tabs %}
{% tab title="201: Created " %}

```json
{
    "status": "success",
    "message": "Voice created successfully."
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "status": "error",
    "message": "Error creating voice." {error_message}   
}
```

{% endtab %}
{% endtabs %}


# Get Voices

Retrieves a list of created voices for a user.

## Retrieves a list of created voices for a user.

<mark style="color:blue;">`GET`</mark> `https://api.autogon.ai/api/v1/services/voice-cloning/voices/list/`

#### Headers

| Name                                           | Type | Description      |
| ---------------------------------------------- | ---- | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> |      | application/json |

{% tabs %}
{% tab title="200: OK Paginated List of Voices" %}

```json
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 001,
            "user": "test-user@email.com",
            "audio_url": "https://storage.autogon.ai/test-voice.mp3",
            "voice_name": "Test Voice 1",
            "voice_description": "Test Voice Desc 1",
            "date_created": "2023-11-22T12:13:16.820943Z"
        },
        {
            "id": 002,
            "user": "test-user@email.com",
            "audio_url": "https://storage.autogon.ai/test-voice.mp3",
            "voice_name": "Test Voice 2",
            "voice_description": "Test Voice Desc 2",
            "date_created": "2023-11-22T12:13:16.820943Z"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Text-To-Speech

Converts text into speech using a voice of your choice and returns audio.

## The API responds with the synthesized speech audio file.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/services/voice-cloning/tts/`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                        | Type   | Description                                                         |
| ------------------------------------------- | ------ | ------------------------------------------------------------------- |
| text<mark style="color:red;">\*</mark>      | String | The text that will get converted into speech.                       |
| voice\_id<mark style="color:red;">\*</mark> | String | Unique voice ID to be used, can be gotten from Get voices endpoint. |

{% tabs %}
{% tab title="200: OK Successful request" %}

```json
{
    "success": true,
    "audio_url": "https://demo-voice.mp3"
}
```

{% endtab %}

{% tab title="400: Bad Request Voice ID not found" %}

```json
{
    "error": "An error occured, wrong voice ID"
}
```

{% endtab %}
{% endtabs %}


# Project

Projects serve as the foundation for building on Autogon. It provides endpoints to manage projects, including creating new projects, retrieving project details, updating and deleting projects.

All endpoints related to dataset management are protected and require authentication using an `X-AUG-KEY` as the authorization header.

To authenticate your requests, include an `X-AUG-KEY` header in the following format:

```json
X-AUG-KEY: YOUR_API_KEY
```

Replace `YOUR_API_KEY` with your unique API Key created on the [Autogon Console](https://console.autogon.ai/)


# List all projects

Retrieves a list of all available projects for a specific Autogon user.

## Lists all projects.

<mark style="color:blue;">`GET`</mark> `https://autogon.ai/api/v1/engine/project/`

Returns a list of available projects for a specific user.

#### Headers

| Name                                          | Type   | Description      |
| --------------------------------------------- | ------ | ---------------- |
| Content-Type                                  | String | application/json |
| X-AUG-TOKEN<mark style="color:red;">\*</mark> | String | YOUR\_API\_KEY   |

{% tabs %}
{% tab title="200: OK Projects details" %}

```javascript
[
    {
	    "id": 0,
	    "app_id": "",
	    "project_name": "",
	    "project_description": "",
	    "project_compiled_models": null,
	    "updated_at": "",
	    "created_at": ""
    },
    {
	    "id": 1,
	    "app_id": "",
	    "project_name": "",
	    "project_description": "",
	    "project_compiled_models": null,
	    "updated_at": "",
	    "created_at": ""
    },
    {
	    "id": 2,
	    "app_id": "",
	    "project_name": "",
	    "project_description": "",
	    "project_compiled_models": null,
	    "updated_at": "",
	    "created_at": ""
    },
    {
	    "id": 3,
	    "app_id": "",
	    "project_name": "",
	    "project_description": "",
	    "project_compiled_models": null,
	    "updated_at": "",
	    "created_at": ""
    },
    ...
]
```

{% endtab %}
{% endtabs %}


# Create a New Project

Creates a new project.

## Creates a new project.

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

Creates a new project.

#### Request Body

| Name                                                   | Type   | Description                   |
| ------------------------------------------------------ | ------ | ----------------------------- |
| project\_name<mark style="color:red;">\*</mark>        | string | Unique name of project        |
| project\_description<mark style="color:red;">\*</mark> | String | short description for project |

{% tabs %}
{% tab title="200 Project successfully created" %}

```javascript
{
    "id": 1,
    "app_id": "",
    "project_name": "",
    "project_description": "",
    "project_compiled_models": null,
    "created_at": ""
}
```

{% endtab %}

{% tab title="401 Project already exists" %}

```
{
    "status": "false",
    "message": "This project name already exists"
}
```

{% endtab %}
{% endtabs %}


# Get Project Details

Retrieves details of a specific project by its ID.

## Get project details.

<mark style="color:blue;">`GET`</mark> `https://autogon.ai/api/v1/engine/project/{app_id}/`

Returns details for the specified project by it's App ID

#### Path Parameters

| Name                                      | Type   | Description                                |
| ----------------------------------------- | ------ | ------------------------------------------ |
| app\_id<mark style="color:red;">\*</mark> | string | The `app_id` of the current project (UUID) |

#### Headers

| Name                                        | Type   | Description    |
| ------------------------------------------- | ------ | -------------- |
| X-AUG-KEY<mark style="color:red;">\*</mark> | String | YOUR\_API\_KEY |

{% tabs %}
{% tab title="200: OK Project Details" %}

```javascript
{
    "id": 0,
    "app_id": "",
    "project_name": "",
    "project_description": "",
    "project_compiled_models": null,
    "updated_at": "",
    "created_at": ""
}
```

{% endtab %}

{% tab title="400: Bad Request Project Not Found" %}

```json
{
    "status": "false", 
    "message": "Project does not exist"
}
```

{% endtab %}
{% endtabs %}




---

[Next Page](/llms-full.txt/1)

