# Feature Scaling (DP\_5)

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