Links

Train Model Anomaly

Take the output from a DSP block and train an anomaly detection model using K-means. Updates are streamed over the websocket API.
post
https://studio.edgeimpulse.com/v1
/api/{projectId}/jobs/train/anomaly/{learnId}
Train model (Anomaly)

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

Parameters
Path
projectId*
integer
Project ID
learnId*
integer
Learn Block ID, use the impulse functions to retrieve the ID
Body
Example
Schema
{
"axes": [
0,
11,
22
],
"clusterCount": 32,
"minimumConfidenceRating": 0.3
}
Responses
200: OK
OK
cURL
Python
Node.js
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/jobs/train/anomaly/{learnId} \
--header 'content-type: application/json' \
--header 'x-jwt-token: REPLACE_KEY_VALUE' \
--data '{"axes":[0,11,22],"clusterCount":32,"minimumConfidenceRating":0.3}'
import http.client
conn = http.client.HTTPSConnection("studio.edgeimpulse.com")
payload = "{\"axes\":[0,11,22],\"clusterCount\":32,\"minimumConfidenceRating\":0.3}"
headers = {
'content-type': "application/json",
'x-jwt-token': "REPLACE_KEY_VALUE"
}
conn.request("POST", "/v1/api/{projectId}/jobs/train/anomaly/{learnId}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const request = require('request');
const options = {
method: 'POST',
url: 'https://studio.edgeimpulse.com/v1/api/{projectId}/jobs/train/anomaly/{learnId}',
headers: {'content-type': 'application/json', 'x-jwt-token': 'REPLACE_KEY_VALUE'},
body: {axes: [0, 11, 22], clusterCount: 32, minimumConfidenceRating: 0.3},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});