Train model (Anomaly)

Train model (Anomaly)

Take the output from a DSP block and train an anomaly detection model using K-means or GMM. Updates are streamed over the websocket API.

POSThttps://studio.edgeimpulse.com/v1/api/{projectId}/jobs/train/anomaly/{learnId}
Path parameters
projectId*integer

Project ID

learnId*integer

Learn Block ID, use the impulse functions to retrieve the ID

Body
axes*array of integer

Which axes (indexes from DSP script) to include in the training set

clusterCountinteger

Number of clusters for K-means, or number of components for GMM

Example: 32
minimumConfidenceRating*number

Minimum confidence rating required before tagging as anomaly

Example: 0.3
skipEmbeddingsAndMemoryboolean

If set, skips creating embeddings and measuring memory (used in tests)

Response

OK

Body
success*boolean

Whether the operation succeeded

errorstring

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

id*integer

Job identifier. Status updates will include this identifier.

Example: 12873488112
Request
const response = await fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/jobs/train/anomaly/{learnId}', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "axes": [
        0,
        11,
        22
      ],
      "minimumConfidenceRating": 0.3
    }),
});
const data = await response.json();
Response
{
  "success": false,
  "error": "text",
  "id": 12873488112
}

Last updated