Skip to content

Commit 7346146

Browse files
authored
Merge pull request #213809 from spelluru/asabuild1005
absolute link -> relative link
2 parents 76eadfe + 4385229 commit 7346146

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

articles/stream-analytics/stream-analytics-machine-learning-anomaly-detection.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ description: This article describes how to use Azure Stream Analytics and Azure
44
ms.service: stream-analytics
55
ms.custom: ignite-2022
66
ms.topic: how-to
7-
ms.date: 06/21/2019
7+
ms.date: 10/05/2022
88
---
99

1010
# Anomaly detection in Azure Stream Analytics
1111

1212
Available in both the cloud and Azure IoT Edge, Azure Stream Analytics offers built-in machine learning based anomaly detection capabilities that can be used to monitor the two most commonly occurring anomalies: temporary and persistent. With the **AnomalyDetection_SpikeAndDip** and **AnomalyDetection_ChangePoint** functions, you can perform anomaly detection directly in your Stream Analytics job.
1313

14-
The machine learning models assume a uniformly sampled time series. If the time series is not uniform, you may insert an aggregation step with a tumbling window prior to calling anomaly detection.
14+
The machine learning models assume a uniformly sampled time series. If the time series isn't uniform, you may insert an aggregation step with a tumbling window prior to calling anomaly detection.
1515

16-
The machine learning operations do not support seasonality trends or multi-variate correlations at this time.
16+
The machine learning operations don't support seasonality trends or multi-variate correlations at this time.
1717

1818
## Anomaly detection using machine learning in Azure Stream Analytics
1919

@@ -25,9 +25,9 @@ The following video demonstrates how to detect an anomaly in real time using mac
2525

2626
Generally, the model's accuracy improves with more data in the sliding window. The data in the specified sliding window is treated as part of its normal range of values for that time frame. The model only considers event history over the sliding window to check if the current event is anomalous. As the sliding window moves, old values are evicted from the model's training.
2727

28-
The functions operate by establishing a certain normal based on what they have seen so far. Outliers are identified by comparing against the established normal, within the confidence level. The window size should be based on the minimum events required to train the model for normal behavior so that when an anomaly occurs, it would be able to recognize it.
28+
The functions operate by establishing a certain normal based on what they've seen so far. Outliers are identified by comparing against the established normal, within the confidence level. The window size should be based on the minimum events required to train the model for normal behavior so that when an anomaly occurs, it would be able to recognize it.
2929

30-
The model's response time increases with history size because it needs to compare against a higher number of past events. It is recommended to only include the necessary number of events for better performance.
30+
The model's response time increases with history size because it needs to compare against a higher number of past events. It's recommended to only include the necessary number of events for better performance.
3131

3232
Gaps in the time series can be a result of the model not receiving events at certain points in time. This situation is handled by Stream Analytics using imputation logic. The history size, as well as a time duration, for the same sliding window is used to calculate the average rate at which events are expected to arrive.
3333

@@ -69,7 +69,7 @@ FROM AnomalyDetectionStep
6969

7070
Persistent anomalies in a time series event stream are changes in the distribution of values in the event stream, like level changes and trends. In Stream Analytics, such anomalies are detected using the Machine Learning based [AnomalyDetection_ChangePoint](/stream-analytics-query/anomalydetection-changepoint-azure-stream-analytics) operator.
7171

72-
Persistent changes last much longer than spikes and dips and could indicate catastrophic event(s). Persistent changes are not usually visible to the naked eye, but can be detected with the **AnomalyDetection_ChangePoint** operator.
72+
Persistent changes last much longer than spikes and dips and could indicate catastrophic event(s). Persistent changes aren't usually visible to the naked eye, but can be detected with the **AnomalyDetection_ChangePoint** operator.
7373

7474
The following image is an example of a level change:
7575

@@ -115,22 +115,22 @@ The performance of these models depends on the history size, window duration, ev
115115
### Relationship
116116
The history size, window duration, and total event load are related in the following way:
117117

118-
windowDuration (in ms) = 1000 * historySize / (Total Input Events Per Sec / Input Partition Count)
118+
windowDuration (in ms) = 1000 * historySize / (total input events per second / Input Partition Count)
119119

120120
When partitioning the function by deviceId, add "PARTITION BY deviceId" to the anomaly detection function call.
121121

122122
### Observations
123123
The following table includes the throughput observations for a single node (6 SU) for the non-partitioned case:
124124

125-
| History size (events) | Window duration (ms) | Total input events per sec |
125+
| History size (events) | Window duration (ms) | Total input events per second |
126126
| --------------------- | -------------------- | -------------------------- |
127127
| 60 | 55 | 2,200 |
128128
| 600 | 728 | 1,650 |
129129
| 6,000 | 10,910 | 1,100 |
130130

131131
The following table includes the throughput observations for a single node (6 SU) for the partitioned case:
132132

133-
| History size (events) | Window duration (ms) | Total input events per sec | Device count |
133+
| History size (events) | Window duration (ms) | Total input events per second | Device count |
134134
| --------------------- | -------------------- | -------------------------- | ------------ |
135135
| 60 | 1,091 | 1,100 | 10 |
136136
| 600 | 10,910 | 1,100 | 10 |
@@ -139,7 +139,7 @@ The following table includes the throughput observations for a single node (6 SU
139139
| 600 | 218,182 | 550 | 100 |
140140
| 6,000 | 2,181,819 | <550 | 100 |
141141

142-
Sample code to run the non-partitioned configurations above is located in the [Streaming At Scale repo](https://github.com/Azure-Samples/streaming-at-scale/blob/f3e66fa9d8c344df77a222812f89a99b7c27ef22/eventhubs-streamanalytics-eventhubs/anomalydetection/create-solution.sh) of Azure Samples. The code creates a stream analytics job with no function level partitioning, which uses Event Hub as input and output. The input load is generated using test clients. Each input event is a 1KB json document. Events simulate an IoT device sending JSON data (for up to 1K devices). The history size, window duration, and total event load are varied over 2 input partitions.
142+
Sample code to run the non-partitioned configurations above is located in the [Streaming At Scale repo](https://github.com/Azure-Samples/streaming-at-scale/blob/f3e66fa9d8c344df77a222812f89a99b7c27ef22/eventhubs-streamanalytics-eventhubs/anomalydetection/create-solution.sh) of Azure Samples. The code creates a stream analytics job with no function level partitioning, which uses Event Hubs as input and output. The input load is generated using test clients. Each input event is a 1KB json document. Events simulate an IoT device sending JSON data (for up to 1K devices). The history size, window duration, and total event load are varied over 2 input partitions.
143143

144144
> [!Note]
145145
> For a more accurate estimate, customize the samples to fit your scenario.

0 commit comments

Comments
 (0)