You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Azure AnomalyDetectorRest REST client library for JavaScript
2
2
3
-
AnomalyDetector Rest Client
3
+
[Anomaly Detector](https://learn.microsoft.com/azure/cognitive-services/Anomaly-Detector/overview) is an AI service with a set of APIs, which enables you to monitor and detect anomalies in your time series data with little machine learning (ML) knowledge, either batch validation or real-time inference.
4
4
5
-
**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library**
Please refer to our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library.
13
6
14
7
## Getting started
15
8
16
-
### Currently supported environments
17
-
18
-
- LTS versions of Node.js
19
-
20
9
### Prerequisites
21
10
22
-
- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.
11
+
- LTS versions of Node.js
12
+
- You need an [Azure subscription][azure_sub] to use this package.
13
+
- An existing Cognitive Services Anomaly Detector instance.
23
14
24
15
### Install the `@azure-rest/ai-anomaly-detector` package
25
16
@@ -29,6 +20,10 @@ Install the Azure AnomalyDetectorRest REST client REST client library for JavaSc
29
20
npm install @azure-rest/ai-anomaly-detector
30
21
```
31
22
23
+
|SDK version|Supported API version of service |
24
+
|-------------|---------------|
25
+
|1.0.0-beta.1| 1.1|
26
+
32
27
### Create and authenticate a `AnomalyDetectorRestClient`
33
28
34
29
To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
@@ -44,8 +39,208 @@ can be used to authenticate the client.
44
39
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
With the Anomaly Detector, you can either detect anomalies in one variable using **Univariate Anomaly Detection**, or detect anomalies in multiple variables with **Multivariate Anomaly Detection**.
45
+
46
+
|Feature |Description |
47
+
|---------|---------|
48
+
|Univariate Anomaly Detection | Detect anomalies in one variable, like revenue, cost, etc. The model was selected automatically based on your data pattern. |
49
+
|Multivariate Anomaly Detection| Detect anomalies in multiple variables with correlations, which are usually gathered from equipment or other complex system. The underlying model used is Graph attention network.|
50
+
51
+
### Univariate Anomaly Detection
52
+
53
+
The Univariate Anomaly Detection API enables you to monitor and detect abnormalities in your time series data without having to know machine learning. The algorithms adapt by automatically identifying and applying the best-fitting models to your data, regardless of industry, scenario, or data volume. Using your time series data, the API determines boundaries for anomaly detection, expected values, and which data points are anomalies.
54
+
55
+
Using the Anomaly Detector doesn't require any prior experience in machine learning, and the REST API enables you to easily integrate the service into your applications and processes.
56
+
57
+
With the Univariate Anomaly Detection, you can automatically detect anomalies throughout your time series data, or as they occur in real-time.
58
+
59
+
|Feature |Description |
60
+
|---------|---------|
61
+
| Streaming detection| Detect anomalies in your streaming data by using previously seen data points to determine if your latest one is an anomaly. This operation generates a model using the data points you send, and determines if the target point is an anomaly. By calling the API with each new data point you generate, you can monitor your data as it's created. |
62
+
| Batch detection | Use your time series to detect any anomalies that might exist throughout your data. This operation generates a model using your entire time series data, with each point analyzed with the same model. |
63
+
| Change points detection | Use your time series to detect any trend change points that exist in your data. This operation generates a model using your entire time series data, with each point analyzed with the same model. |
64
+
65
+
### Multivariate Anomaly Detection
66
+
67
+
The **Multivariate Anomaly Detection** APIs further enable developers by easily integrating advanced AI for detecting anomalies from groups of metrics, without the need for machine learning knowledge or labeled data. Dependencies and inter-correlations between up to 300 different signals are now automatically counted as key factors. This new capability helps you to proactively protect your complex systems such as software applications, servers, factory machines, spacecraft, or even your business, from failures.
68
+
69
+
With the Multivariate Anomaly Detection, you can automatically detect anomalies throughout your time series data, or as they occur in real-time. There are three processes to use Multivariate Anomaly Detection.
70
+
71
+
-**Training**: Use Train Model API to create and train a model, then use Get Model Status API to get the status and model metadata.
72
+
-**Inference**:
73
+
- Use Async Inference API to trigger an asynchronous inference process and use Get Inference results API to get detection results on a batch of data.
74
+
- You could also use Sync Inference API to trigger a detection on one timestamp every time.
75
+
-**Other operations**: List Model API and Delete Model API are supported in Multivariate Anomaly Detection model for model management.
76
+
77
+
### Thread safety
78
+
79
+
We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads.
80
+
81
+
## Examples
82
+
83
+
The following section provides several code snippets covering some of the most common Anomaly Detector service tasks, including:
console.log("There is no change point detected from the series.");
233
+
}
234
+
```
235
+
236
+
### Multivariate Anomaly Detection Sample
237
+
238
+
To see how to use Anomaly Detector library to conduct Multivariate Anomaly Detection, see this [sample](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/anomalydetector/ai-anomaly-detector-rest/samples/v1-beta/typescript/src/sample_multivariate_detection.ts).
239
+
47
240
## Troubleshooting
48
241
242
+
### General
243
+
49
244
### Logging
50
245
51
246
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
@@ -57,3 +252,37 @@ setLogLevel("info");
57
252
```
58
253
59
254
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
255
+
256
+
## Next steps
257
+
258
+
These code samples show common scenario operations with the Azure Anomaly Detector library. More samples can be found under the [samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/anomalydetector/Azure.AI.AnomalyDetector/tests/samples/) directory.
For more extensive documentation on Azure Anomaly Detector, see the [Anomaly Detector documentation](https://learn.microsoft.com/azure/cognitive-services/anomaly-detector/overview) on docs.microsoft.com.
271
+
272
+
## Contributing
273
+
274
+
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla].
275
+
276
+
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
277
+
278
+
This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [[email protected]][coc_contact] with any additional questions or comments.
0 commit comments