> For the complete documentation index, see [llms.txt](https://emotiv.gitbook.io/cortex-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emotiv.gitbook.io/cortex-api/advanced-bci/mentalcommandtrainingthreshold.md).

# mentalCommandTrainingThreshold

This method returns the training threshold of the mental command detection. It also returns the score of the last mental command training.

The training threshold provides an indication of minimum threshold that you should target for when training the action, and it changes according to number of total actions that you have currently activated. Any training score above the threshold is very likely to improve your profile. Any training significantly below the threshold is likely to reduce the quality of your profile.

Check out the usage in our [BCI](https://emotiv.gitbook.io/emotivbci/mental-commands/training-feedback) app.

## Parameters

| Name        | Type     | Required | Description                                                                     |
| ----------- | -------- | -------- | ------------------------------------------------------------------------------- |
| cortexToken | `string` | yes      | A token returned by [authorize](/cortex-api/authentication/authorize.md).       |
| profile     | `string` | no       | A profile name                                                                  |
| session     | `string` | no       | A session id returned by [createSession](/cortex-api/session/createsession.md). |

You must set one of these 2 parameters: **profile** or **session**. [Read this](/cortex-api/advanced-bci.md#profile-name-or-session-id) for details.

## Result

The result is an object containing these fields:

| Name              | Type     | Description                                    |
| ----------------- | -------- | ---------------------------------------------- |
| currentThreshold  | `number` | The threshold of the mental command detection. |
| lastTrainingScore | `number` | The score of the last mental command training. |

## Examples

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

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "mentalCommandTrainingThreshold",
    "params": {
        "cortexToken": "xxx",
        "session": "xxx"
    }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "currentThreshold": 0.83,
        "lastTrainingScore": 0.40
    }
}
```

{% endtab %}
{% endtabs %}
