# Feature Sampling (DP\_FSP)

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