Skip to content

Commit d068b0e

Browse files
committed
small fixes
1 parent b16f322 commit d068b0e

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

articles/cognitive-services/Anomaly-Detector/How-to/batch-inference.md

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,25 @@ ms.author: mbullwin
1414

1515
# Trigger batch inference with trained model
1616

17+
You could choose the batch inference API, or the streaming inference API for detection.
1718

18-
You could choose the batch inference API, or the streaming inference API for detection.
19-
20-
| Batch inference API | Streaming inference API |
21-
| ------------- | ---------------- |
22-
| More suitable for batch use cases when customers don’t need to get inference results immediately and want to detect anomalies and get results over a longer time period.| When customers want to get inference immediately and want to detect multivariate anomalies in real time, this API is recommended. Also suitable for customers having difficulties conducting the previous compressing and uploading process for inference. |
19+
| Batch inference API | Streaming inference API |
20+
| ------------- | ---------------- |
21+
| More suitable for batch use cases when customers don’t need to get inference results immediately and want to detect anomalies and get results over a longer time period.| When customers want to get inference immediately and want to detect multivariate anomalies in real-time, this API is recommended. Also suitable for customers having difficulties conducting the previous compressing and uploading process for inference. |
2322

2423
|API Name| Method | Path | Description |
2524
| ------ | ---- | ----------- | ------ |
26-
|**Batch Inference**| POST | `{endpoint}`/anomalydetector/v1.1/multivariate/models/`{modelId}`:detect-batch | Trigger an asynchronous inference with `modelId` which works in a batch scenario |
25+
|**Batch Inference**| POST | `{endpoint}`/anomalydetector/v1.1/multivariate/models/`{modelId}`: detect-batch | Trigger an asynchronous inference with `modelId`, which works in a batch scenario |
2726
|**Get Batch Inference Results**| GET | `{endpoint}`/anomalydetector/v1.1/multivariate/detect-batch/`{resultId}` | Get batch inference results with `resultId` |
28-
|**Streaming Inference**| POST | `{endpoint}`/anomalydetector/v1.1/multivariate/models/`{modelId}`:detect-last | Trigger a synchronous inference with `modelId` which works in a streaming scenario |
29-
27+
|**Streaming Inference**| POST | `{endpoint}`/anomalydetector/v1.1/multivariate/models/`{modelId}`: detect-last | Trigger a synchronous inference with `modelId`, which works in a streaming scenario |
3028

3129
## Trigger a batch inference
3230

3331
To perform batch inference, provide the blob URL containing the inference data, the start time, and end time. For inference data volume, at least `1 sliding window` length and at most **20000** timestamps.
3432

35-
This inference is asynchronous, so the results are not returned immediately. Notice that you need to save in a variable the link of the results in the **response header** which contains the `resultId`, so that you may know where to get the results afterwards.
33+
This inference is asynchronous, so the results aren't returned immediately. Notice that you need to save in a variable the link of the results in the **response header** which contains the `resultId`, so that you may know where to get the results afterwards.
3634

37-
Failures are usually caused by model issues or data issues. You cannot perform inference if the model is not ready or the data link is invalid. Make sure that the training data and inference data are consistent, which means they should be **exactly** the same variables but with different timestamps. More variables, fewer variables, or inference with a different set of variables will not pass the data verification phase and errors will occur. Data verification is deferred so that you will get error message only when you query the results.
35+
Failures are usually caused by model issues or data issues. You can't perform inference if the model isn't ready or the data link is invalid. Make sure that the training data and inference data are consistent, meaning they should be **exactly** the same variables but with different timestamps. More variables, fewer variables, or inference with a different set of variables won't pass the data verification phase and errors will occur. Data verification is deferred so that you'll get error messages only when you query the results.
3836

3937
### Request
4038

@@ -50,22 +48,21 @@ A sample request:
5048
```
5149
#### Required parameters
5250

53-
* **dataSource**: This is the Blob URL that linked to your folder or CSV file located in the Azure Blob Storage. The schema should be the same with training data, either OneTable or MultiTable, and the variable number and name should be exactly the same as well.
51+
* **dataSource**: This is the Blob URL that linked to your folder or CSV file located in Azure Blob Storage. The schema should be the same as your training data, either OneTable or MultiTable, and the variable number and name should be exactly the same as well.
5452
* **startTime**: The start time of data used for inference. If it's earlier than the actual earliest timestamp in the data, the actual earliest timestamp will be used as the starting point.
55-
* **endTime**: The end time of data used for inference which must be later than or equal to `startTime`. If `endTime` is later than the actual latest timestamp in the data, the actual latest timestamp will be used as the ending point.
53+
* **endTime**: The end time of data used for inference, which must be later than or equal to `startTime`. If `endTime` is later than the actual latest timestamp in the data, the actual latest timestamp will be used as the ending point.
5654

5755
#### Optional parameters
5856

59-
* **topContributorCount**: This is a number that you could specify N from **1 to 30**, which will give you the details of top N contributed variables in the anomaly results. For example, if you have 100 variables in the model, but you only care the top 5 contributed variables in detection results, than you should fill this field with 5. The default number is **10**.
60-
57+
* **topContributorCount**: This is a number that you could specify N from **1 to 30**, which will give you the details of top N contributed variables in the anomaly results. For example, if you have 100 variables in the model, but you only care the top five contributed variables in detection results, then you should fill this field with 5. The default number is **10**.
6158

6259
### Response
6360

6461
A sample response:
6562

6663
```json
6764
{
68-
"resultId": "f5c8c004-555b-11ed-85c0-36f8cdfb3365",
65+
"resultId": "aaaaaaaa-5555-1111-85bb-36f8cdfb3365",
6966
"summary": {
7067
"status": "CREATED",
7168
"errors": [],
@@ -80,7 +77,7 @@ A sample response:
8077
"results": []
8178
}
8279
```
83-
* **resultId**: This is the information that you will need to trigger **Get Batch Inference Results API**.
80+
* **resultId**: This is the information that you'll need to trigger **Get Batch Inference Results API**.
8481
* **status**: This indicates whether you trigger a batch inference task successfully. If you see **CREATED**, then you don't need to trigger this API again, you should use the **Get Batch Inference Results API** to get the detection status and anomaly results.
8582

8683
## Get batch detection results
@@ -94,7 +91,7 @@ A sample response:
9491

9592
```json
9693
{
97-
"resultId": "f5c8c004-555b-11ed-85c0-36f8cdfb3365",
94+
"resultId": "aaaaaaaa-5555-1111-85bb-36f8cdfb3365",
9895
"summary": {
9996
"status": "READY",
10097
"errors": [],
@@ -257,10 +254,10 @@ The response contains the result status, variable information, inference paramet
257254
* **setupInfo**: This is the request body submitted for this inference.
258255
* **results**: This contains the detection results. There are three typical types of detection results.
259256

260-
* Error code `InsufficientHistoricalData`. This usually happens only with the first few timestamps because the model inferences data in a window-based manner and it needs historical data to make a decision. For the first few timestamps, there is insufficient historical data, so inference cannot be performed on them. In this case, the error message can be ignored.
257+
* Error code `InsufficientHistoricalData`. This usually happens only with the first few timestamps because the model inferences data in a window-based manner and it needs historical data to make a decision. For the first few timestamps, there's insufficient historical data, so inference can't be performed on them. In this case, the error message can be ignored.
261258

262-
* **isAnomaly**: `false` indicates the current timestamp is not an anomaly.`true` indicates an anomaly at the current timestamp.
263-
* `severity` indicates the relative severity of the anomaly and for abnormal data it is always greater than 0.
259+
* **isAnomaly**: `false` indicates the current timestamp isn't an anomaly.`true` indicates an anomaly at the current timestamp.
260+
* `severity` indicates the relative severity of the anomaly and for abnormal data it's always greater than 0.
264261
* `score` is the raw output of the model on which the model makes a decision. `severity` is a derived value from `score`. Every data point has a `score`.
265262

266263
* **interpretation**: This field only appears when a timestamp is detected as anomalous, which contains `variables`, `contributionScore`, `correlationChanges`.
@@ -269,13 +266,13 @@ The response contains the result status, variable information, inference paramet
269266

270267
* **correlationChanges**: This field only appears when a timestamp is detected as anomalous, which included in interpretation. It contains `changedVariables` and `changedValues` that interpret which correlations between variables changed.
271268

272-
* **changedVariables**: This field will show which variables that have significant change in correlation with `variable`. The variables in this list is ranked by the extent of correlation changes.
269+
* **changedVariables**: This field will show which variables that have significant change in correlation with `variable`. The variables in this list are ranked by the extent of correlation changes.
273270

274271
> [!NOTE]
275272
> A common pitfall is taking all data points with `isAnomaly`=`true` as anomalies. That may end up with too many false positives.
276273
> You should use both `isAnomaly` and `severity` (or `score`) to sift out anomalies that are not severe and (optionally) use grouping to check the duration of the anomalies to suppress random noise.
277-
> Please refer to the [FAQ](../../concepts/best-practices-multivariate.md#faq) in the best practices document for the difference between `severity` and `score`.
274+
> Please refer to the [FAQ](../concepts/best-practices-multivariate.md#faq) in the best practices document for the difference between `severity` and `score`.
278275
279276
## Next steps
280277

281-
* [Best practices of multivariate anomaly detection](../../concepts/best-practices-multivariate.md)
278+
* [Best practices of multivariate anomaly detection](../concepts/best-practices-multivariate.md)

0 commit comments

Comments
 (0)