# Resampler (DP\_RES)

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       |
