POST
/
api
/
{projectId}
/
impulse
/
{impulseId}
/
set-thresholds
Set thresholds
curl --request POST \
  --url https://studio.edgeimpulse.com/v1/api/{projectId}/impulse/{impulseId}/set-thresholds \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "thresholds": [
    {
      "blockId": 123,
      "key": "<string>",
      "value": 123
    }
  ],
  "allowCreatingRegenerateModelTestingJobs": true,
  "forceRunRegenerateModelTestingInJob": true
}'
{
  "success": true,
  "error": "<string>",
  "hadModelTestingResults": true,
  "regenerateModelTestingStatus": "not_regenerated",
  "regenerateModelTestingResultsJobId": 123
}

Authorizations

x-api-key
string
header
required

Path Parameters

projectId
integer
required

Project ID

impulseId
integer
required

Impulse ID

Body

application/json
thresholds
object[]
required
allowCreatingRegenerateModelTestingJobs
boolean
required

Whether a call to this function is allowed to create jobs to regenerate model testing results (e.g. object detection datasets, or large datasets). This option is here because further calls to setImpulseThresholds are blocked while model testing jobs are running (so e.g. live classification has this to FALSE).

forceRunRegenerateModelTestingInJob
boolean

If set, this'll force the creation of a job to regenerate the model testing results.

Response

200 - application/json

OK

success
boolean
required

Whether the operation succeeded

hadModelTestingResults
boolean
required

Whether there were model testing results available before calling this function.

regenerateModelTestingStatus
enum<string>
required

Altering thresholds invalidates model testing results. We try to regenerate the results where possible. You'll get either "not_regenerated" (e.g. no model testing results, or dataset does not support fast regeneration, like for object detection models); "regenerated" (regeneration successful); "started_job" (regenerate is possible, but requires a job, that was kicked off - e.g. for large test sets); "requires_job" (requires a job, but "allowCreatingRegenerateModelTestingJobs" was false - start a new job manually via regenerateModelTestingSummary). If a job was started then "regenerateModelTestingResultsJobId" is set.

Available options:
not_regenerated,
regenerated,
started_job,
requires_job
error
string

Optional error description (set if 'success' was false)

regenerateModelTestingResultsJobId
integer

If there previously were model testing results, and your dataset supports fast re-generation of model testing results (e.g. no object detection blocks), but your dataset is too big to re-generate results inline (e.g. >20K test set samples) - then a job is kicked off to regenerate the results. This field contains the job ID.