Classify

Classify sample by learn block

This API is deprecated, use classifySampleByLearnBlockV2 (/v1/api/{projectId}/classify/anomaly-gmm/v2/{blockId}/{sampleId}) instead. Classify a complete file against the specified learn block. This will move the sliding window (dependent on the sliding window length and the sliding window increase parameters in the impulse) over the complete file, and classify for every window that is extracted.

get/api/{projectId}/classify/anomaly-gmm/{blockId}/{sampleId}

Request

Path parameters

projectIdinteger required

Project ID

sampleIdinteger required

Sample ID

blockIdinteger required

Block ID

Response

OK

successboolean required

Whether the operation succeeded

errorstring

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

windowSizeMsinteger required

Size of the sliding window (as set by the impulse) in milliseconds.

windowIncreaseMsinteger required

Number of milliseconds that the sliding window increased with (as set by the impulse)

alreadyInDatabaseboolean required

Whether this sample is already in the training database

warningstring

Example response

{
  "classifications": [
    {
      "learnBlock": {
        "name": "NN Classifier",
        "dsp": [
          27
        ],
        "title": "Classification (Keras)",
        "createdBy": "createImpulse"
      },
      "result": [
        {
          "idle": 0.0002,
          "wave": 0.9998,
          "anomaly": -0.42
        }
      ],
      "structuredResult": [
        {
          "debugInfoJson": "{\n    \"y_trues\": [\n        {\"x\": 0.854, \"y\": 0.453125, \"label\": 1},\n        {\"x\": 0.197, \"y\": 0.53125, \"label\": 2}\n    ],\n    \"y_preds\": [\n        {\"x\": 0.916, \"y\": 0.875, \"label\": 1},\n        {\"x\": 0.25, \"y\": 0.541, \"label\": 2}\n    ],\n    \"assignments\": [\n        {\"yp\": 1, \"yt\": 1, \"label\": 2, \"distance\": 0.053}\n    ],\n    \"normalised_min_distance\": 0.2,\n    \"all_pairwise_distances\": [\n        [0, 0, 0.426],\n        [1, 1, 0.053]\n    ],\n    \"unassigned_y_true_idxs\": [0],\n    \"unassigned_y_pred_idxs\": [0]\n}\n"
        }
      ],
      "thresholds": [
        {
          "key": "min_score",
          "description": "Score threshold",
          "helpText": "Threshold score for bounding boxes. If the score for a bounding box is below this the box will be discarded."
        }
      ]
    }
  ],
  "sample": {
    "sample": {
      "id": 2,
      "filename": "idle01.d8Ae",
      "signatureValidate": true,
      "signatureMethod": "HS256",
      "label": "healthy-machine",
      "intervalMs": 16,
      "frequency": 62.5,
      "originalIntervalMs": 16,
      "originalFrequency": 62.5,
      "sensors": [
        {
          "name": "accX"
        }
      ],
      "datastreams": [
        {
          "sensors": [
            {
              "name": "accX"
            }
          ]
        }
      ]
    },
    "payload": {
      "device_name": "ac:87:a3:0a:2d:1b",
      "device_type": "DISCO-L475VG-IOT01A",
      "sensors": [
        {
          "name": "accX"
        }
      ],
      "cropEnd": 128,
      "intervalMs": 16,
      "frequencyHz": 62.5
    },
    "datastreamPayloads": [
      {
        "payload": {
          "device_name": "ac:87:a3:0a:2d:1b",
          "device_type": "DISCO-L475VG-IOT01A",
          "sensors": [
            {
              "name": "accX"
            }
          ],
          "cropEnd": 128,
          "intervalMs": 16,
          "frequencyHz": 62.5
        }
      }
    ]
  },
  "windowSizeMs": 2996,
  "windowIncreaseMs": 10
}

Changes

No recorded changes to this operation across all 1 revision of this API.