แก้ไข

แชร์ผ่าน


Quickstart: Use the Univariate Anomaly Detector client library

Important

Starting on the 20th of September, 2023 you won’t be able to create new Anomaly Detector resources. The Anomaly Detector service is being retired on the 1st of October, 2026.

Library reference documentation |Library source code | Package (NuGet) |Find the sample code on GitHub

Get started with the Anomaly Detector client library for C#. Follow these steps to install the package start using the algorithms provided by the service. The Anomaly Detector service enables you to find abnormalities in your time series data by automatically using the best-fitting models on it, regardless of industry, scenario, or data volume.

Use the Anomaly Detector client library for C# to:

  • Detect anomalies throughout your time series data set, as a batch request
  • Detect the anomaly status of the latest data point in your time series
  • Detect trend change points in your data set.

Prerequisites

  • An Azure subscription - Create one for free
  • The current version of .NET Core
  • Once you have your Azure subscription, create an Anomaly Detector resource in the Azure portal to get your key and endpoint. Wait for it to deploy and select the Go to resource button. You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.

Set up

Create a new .NET Core application

In a console window (such as cmd, PowerShell, or Bash), use the dotnet new command to create a new console app with the name anomaly-detector-quickstart. This command creates a simple "Hello World" project with a single C# source file: Program.cs.

dotnet new console -n anomaly-detector-quickstart

Change your directory to the newly created app folder. You can build the application with:

dotnet build

The build output should contain no warnings or errors.

...
Build succeeded.
 0 Warning(s)
 0 Error(s)
...

Install the client library

Within the application directory, install the Anomaly Detector client library for .NET with the following command:

dotnet add package Azure.AI.AnomalyDetector --prerelease

Retrieve key and endpoint

To successfully make a call against the Anomaly Detector service, you'll need the following values:

Variable name Value
ANOMALY_DETECTOR_ENDPOINT This value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. Example endpoint: https://YOUR_RESOURCE_NAME.cognitiveservices.azure.com/
ANOMALY_DETECTOR_API_KEY The API key value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. You can use either KEY1 or KEY2.
DATA_PATH This quickstart uses the request-data.csv file that can be downloaded from our GitHub sample data. Example path: c:\\test\\request-data.csv

Go to your resource in the Azure portal. The Endpoint and Keys can be found in the Resource Management section. Copy your endpoint and access key as you'll need both for authenticating your API calls. You can use either KEY1 or KEY2. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.

Create environment variables

Create and assign persistent environment variables for your key and endpoint.

Important

If you use an API key, store it securely somewhere else, such as in Azure Key Vault. Don't include the API key directly in your code, and never post it publicly.

For more information about AI services security, see Authenticate requests to Azure AI services.

setx ANOMALY_DETECTOR_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
setx ANOMALY_DETECTOR_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"

Download sample data

This quickstart uses the request-data.csv file that can be downloaded from our GitHub sample data

You can also download the sample data by running:

curl "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/anomalydetector/azure-ai-anomalydetector/samples/sample_data/request-data.csv" --output request-data.csv

Detect anomalies

From the project directory, open the program.cs file and replace with the following code:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Azure;
using Azure.AI.AnomalyDetector;
using static System.Environment;

namespace anomaly_detector_quickstart
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string endpoint = GetEnvironmentVariable("ANOMALY_DETECTOR_ENDPOINT");
            string apiKey = GetEnvironmentVariable("ANOMALY_DETECTOR_API_KEY");

            var endpointUri = new Uri(endpoint);
            var credential = new AzureKeyCredential(apiKey);

            //create client
            AnomalyDetectorClient client = new AnomalyDetectorClient(endpointUri, credential);

            //read data
            //example: string datapath = @"c:\test\request-data.csv";
            string datapath = @"REPLACE_WITH_YOUR_LOCAL_SAMPLE_REQUEST_DATA_PATH";

            List<TimeSeriesPoint> list = File.ReadAllLines(datapath, Encoding.UTF8)
                .Where(e => e.Trim().Length != 0)
                .Select(e => e.Split(','))
                .Where(e => e.Length == 2)
                .Select(e => new TimeSeriesPoint(float.Parse(e[1])) { Timestamp = DateTime.Parse(e[0]) }).ToList();

              //create request
            UnivariateDetectionOptions request = new UnivariateDetectionOptions(list)
            {
                Granularity = TimeGranularity.Daily
            };

            UnivariateEntireDetectionResult result = client.DetectUnivariateEntireSeries(request);

            bool hasAnomaly = false;
            for (int i = 0; i < request.Series.Count; ++i)
            {
                if (result.IsAnomaly[i])
                {
                    Console.WriteLine("Anomaly detected at index: {0}.", i);
                    hasAnomaly = true;
                }
            }
            if (!hasAnomaly)
            {
                Console.WriteLine("No anomalies detected in the series.");
            }
        }
    }
}


Run the application with the following command:

dotnet run program.cs

Output

Anomaly detected at index:      3
Anomaly detected at index:      18
Anomaly detected at index:      21
Anomaly detected at index:      22
Anomaly detected at index:      23
Anomaly detected at index:      24
Anomaly detected at index:      25
Anomaly detected at index:      28
Anomaly detected at index:      29
Anomaly detected at index:      30
Anomaly detected at index:      31
Anomaly detected at index:      32
Anomaly detected at index:      35
Anomaly detected at index:      44

Code details

Understanding your results

In the code above, the sample data is read and converted to a DetectRequest object. We call File.ReadAllLines with the file path and create a list of TimeSeriesPoint objects, and strip any new line characters. Extract the values and separate the timestamp from its numerical value, and add them to a new TimeSeriesPoint object. The DetectRequest object consists of a series of data points, with TimeGranularity.Daily for the granularity (or periodicity) of the data points. Next we call the client's DetectEntireSeriesAsync method with the DetectRequest object and await the response as an EntireDetectResponse object. We then, iterate through the response's IsAnomaly values and print any that are true. These values correspond to the index of anomalous data points, if any were found.

Clean up resources

If you want to clean up and remove an Anomaly Detector resource, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it. You also may want to consider deleting the environment variables you created if you no longer intend to use them.

Library reference documentation |Library source code | Package (npm) |Find the sample code on GitHub

Get started with the Anomaly Detector client library for JavaScript. Follow these steps to install the package, and start using the algorithms provided by the service. The Anomaly Detector service enables you to find abnormalities in your time series data by automatically using the best-fitting model on it, regardless of industry, scenario, or data volume.

Use the Anomaly Detector client library for JavaScript to:

  • Detect anomalies throughout your time series data set, as a batch request
  • Detect the anomaly status of the latest data point in your time series
  • Detect trend change points in your data set.

Prerequisites

  • An Azure subscription - Create one for free
  • The current version of Node.js
  • Once you have your Azure subscription, create an Anomaly Detector resource in the Azure portal to get your key and endpoint. Wait for it to deploy and select the Go to resource button. You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.

Set up

Create a new Node.js application

In a console window (such as cmd, PowerShell, or Bash), create a new directory for your app, and navigate to it.

mkdir myapp && cd myapp

Create a package.json file with the following contents:

{
  "dependencies": {
    "@azure/ai-anomaly-detector": "next",
    "@azure-rest/ai-anomaly-detector": "next",
    "@azure/core-auth": "^1.3.0",
    "csv-parse": "^5.3.0"
  }
}

Install the client library

Install the required npm packages by running the following from the same directory as your package.json file:

npm install

Retrieve key and endpoint

To successfully make a call against the Anomaly Detector service, you'll need the following values:

Variable name Value
ANOMALY_DETECTOR_ENDPOINT This value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. Example endpoint: https://YOUR_RESOURCE_NAME.cognitiveservices.azure.com/
ANOMALY_DETECTOR_API_KEY The API key value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. You can use either KEY1 or KEY2.
datapath This quickstart uses the request-data.csv file that can be downloaded from our GitHub sample data.

Go to your resource in the Azure portal. The Endpoint and Keys can be found in the Resource Management section. Copy your endpoint and access key as you'll need both for authenticating your API calls. You can use either KEY1 or KEY2. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.

Create environment variables

Create and assign persistent environment variables for your key and endpoint.

Important

If you use an API key, store it securely somewhere else, such as in Azure Key Vault. Don't include the API key directly in your code, and never post it publicly.

For more information about AI services security, see Authenticate requests to Azure AI services.

setx ANOMALY_DETECTOR_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
setx ANOMALY_DETECTOR_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"

Download sample data

This quickstart uses the request-data.csv file that can be downloaded from our GitHub sample data

You can also download the sample data by running:

curl "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/anomalydetector/azure-ai-anomalydetector/samples/sample_data/request-data.csv" --output request-data.csv

Detect anomalies

Create a file named index.js and replace with the following code:

const AnomalyDetector = require("@azure-rest/ai-anomaly-detector").default,
  { isUnexpected } = require("@azure-rest/ai-anomaly-detector");
const { AzureKeyCredential } = require("@azure/core-auth");

const { parse } = require("csv-parse/sync");
const fs = require("fs");

// Retrieve the endpoint and key from the environment variables.
const apiKey = process.env["ANOMALY_DETECTOR_API_KEY"] || "";
const endpoint = process.env["ANOMALY_DETECTOR_ENDPOINT"] || "";
const timeSeriesDataPath = "./request-data.csv";

function read_series_from_file(path) {
  let result = Array();
  let input = fs.readFileSync(path).toString();
  let parsed = parse(input, { skip_empty_lines: true });
  parsed.forEach(function (e) {
    result.push({ timestamp: new Date(e[0]), value: Number(e[1]) });
  });
  return result;
}

async function main() {
  // create client
  const credential = new AzureKeyCredential(apiKey);
  const client = AnomalyDetector(endpoint, credential);

  // construct request
  const options = {
    body: {
      granularity: "daily",
      imputeMode: "auto",
      maxAnomalyRatio: 0.25,
      sensitivity: 95,
      series: read_series_from_file(timeSeriesDataPath),
    },
    headers: { "Content-Type": "application/json" },
  };

  // get last detect result
  const result = await client.path("/timeseries/entire/detect").post(options);
  if (isUnexpected(result)) {
    throw result;
  }

  if (result.body.isAnomaly) {
    result.body.isAnomaly.forEach(function (anomaly, index) {
      if (anomaly === true) {
        console.log(index);
      }
    });
  } else {
    console.log("There is no anomaly detected from the series.");
  }

}

main().catch((err) => {
  console.error("The sample encountered an error:", err);
});

module.exports = { main };

Run the application

Run the application with the node command on your quickstart file.

node index.js

Output

Anomalies were detected from the series at index:
3
18
21
22
23
24
25
28
29
30
31
32
35
44

Understanding your results

In the code above, we call the Anomaly Detector API to detect anomalies through the entire time series as a batch with the client's detectEntireSeries() method. We store the returned AnomalyDetectorDetectEntireSeriesResponse object. Then we iterate through the response's isAnomaly list, and print the index of any true values. These values correspond to the index of anomalous data points, if any were found.

Clean up resources

If you want to clean up and remove an Anomaly Detector resource, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it. You also may want to consider deleting the environment variables you created if you no longer intend to use them.

Library reference documentation |Library source code | Package (PyPi) |Find the sample code on GitHub

Get started with the Anomaly Detector client library for Python. Follow these steps to install the package and start using the algorithms provided by the service. The Anomaly Detector service enables you to find abnormalities in your time series data by automatically using the best-fitting models on it, regardless of industry, scenario, or data volume.

Use the Anomaly Detector client library for Python to:

  • Detect anomalies throughout your time series data set, as a batch request
  • Detect the anomaly status of the latest data point in your time series
  • Detect trend change points in your data set.

Prerequisites

Set up

Install the client library. You can install the client library with:

pip install --upgrade azure.ai.anomalydetector

Retrieve key and endpoint

To successfully make a call against the Anomaly Detector service, you'll need the following values:

Variable name Value
ANOMALY_DETECTOR_ENDPOINT This value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. Example endpoint: https://YOUR_RESOURCE_NAME.cognitiveservices.azure.com/
ANOMALY_DETECTOR_API_KEY The API key value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. You can use either KEY1 or KEY2.
DATA_PATH This quickstart uses the request-data.csv file that can be downloaded from our GitHub sample data. Example path: c:\\test\\request-data.csv

Go to your resource in the Azure portal. The Endpoint and Keys can be found in the Resource Management section. Copy your endpoint and access key as you'll need both for authenticating your API calls. You can use either KEY1 or KEY2. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.

Create environment variables

Create and assign persistent environment variables for your key and endpoint.

Important

If you use an API key, store it securely somewhere else, such as in Azure Key Vault. Don't include the API key directly in your code, and never post it publicly.

For more information about AI services security, see Authenticate requests to Azure AI services.

setx ANOMALY_DETECTOR_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
setx ANOMALY_DETECTOR_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"

Download sample data

This quickstart uses the request-data.csv file that can be downloaded from our GitHub sample data

You can also download the sample data by running:

curl "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/anomalydetector/azure-ai-anomalydetector/samples/sample_data/request-data.csv" --output request-data.csv

Detect anomalies

  1. Create a new Python file called quickstart.py. Then open it up in your preferred editor or IDE.

  2. Replace the contents of quickstart.py with the following code. Modify the code to add the environment variable names for your key, endpoint, and the time series data path:

    from azure.ai.anomalydetector import AnomalyDetectorClient
    from azure.ai.anomalydetector.models import *
    from azure.core.credentials import AzureKeyCredential
    import pandas as pd
    import os
    
    API_KEY = os.environ['ANOMALY_DETECTOR_API_KEY']
    ENDPOINT = os.environ['ANOMALY_DETECTOR_ENDPOINT']
    DATA_PATH = "REPLACE_WITH_YOUR_LOCAL_SAMPLE_REQUEST_DATA_PATH" #example: c:\\test\\request-data.csv
    
    client = AnomalyDetectorClient(ENDPOINT, AzureKeyCredential(API_KEY))
    
    series = []
    data_file = pd.read_csv(DATA_PATH, header=None, encoding='utf-8', date_parser=[0])
    for index, row in data_file.iterrows():
        series.append(TimeSeriesPoint(timestamp=row[0], value=row[1]))
    
    request = UnivariateDetectionOptions(series=series, granularity=TimeGranularity.DAILY)
    
    change_point_response = client.detect_univariate_change_point(request)
    anomaly_response = client.detect_univariate_entire_series(request)
    
    for i in range(len(data_file.values)):
        if (change_point_response.is_change_point[i]):
            print("Change point detected at index: "+ str(i))
        elif (anomaly_response.is_anomaly[i]):
            print("Anomaly detected at index:      "+ str(i))
    

    Important

    For production, use a secure way of storing and accessing your credentials like Azure Key Vault. For more information about credential security, see the Azure AI services security article.

  3. Run the application with the python command on your quickstart file

    python quickstart.py
    

Output

Anomaly detected at index:      3
Anomaly detected at index:      18
Change point detected at index: 20
Anomaly detected at index:      21
Anomaly detected at index:      22
Anomaly detected at index:      23
Anomaly detected at index:      24
Anomaly detected at index:      25
Change point detected at index: 27
Anomaly detected at index:      28
Anomaly detected at index:      29
Anomaly detected at index:      30
Anomaly detected at index:      31
Anomaly detected at index:      32
Anomaly detected at index:      35
Anomaly detected at index:      44

Understanding your results

In our code above, we call the Anomaly Detector API twice. The first call checks for trend change points across our sample data series with the detect_change_point method. This call returns a ChangePointDetectResponse that we stored in a variable we named change_point_request. We then iterate through the response's is_change_point list, and print the index of any values with a boolean of true.

The second call checks the entire sample data series for anomalies using the detect_entire_series method. This call returns a EntireDetectResponse that we stored in a variable we named anomaly_response. We iterate through the response's is_anomaly list, and print the index of any values with a boolean of true. Alternatively, we could have used the detect_last_point method, which is more appropriate for detecting anomalies in real-time data. To learn more, consult the best practices guide.

Visualize results

To visualize the anomalies and change points in relation to the sample data series, we'll use the popular open-source library matplotlib.

  1. Install the library.

    pip install matplotlib
    
  2. Modify your quickstart.py file with the following code:

    from azure.ai.anomalydetector import AnomalyDetectorClient
    from azure.ai.anomalydetector.models import *
    from azure.core.credentials import AzureKeyCredential
    import pandas as pd
    import matplotlib.pyplot as plt
    import matplotlib.dates as mdates
    import os
    
    API_KEY = os.environ['ANOMALY_DETECTOR_API_KEY']
    ENDPOINT = os.environ['ANOMALY_DETECTOR_ENDPOINT']
    DATA_PATH = "REPLACE_WITH_YOUR_LOCAL_SAMPLE_REQUEST_DATA_PATH" #example: c:\\test\\request-data.csv
    
    client = AnomalyDetectorClient(ENDPOINT, AzureKeyCredential(API_KEY))
    
    series = []
    data_file = pd.read_csv(DATA_PATH, header=None, encoding='utf-8', date_parser=[0])
    for index, row in data_file.iterrows():
        series.append(TimeSeriesPoint(timestamp=row[0], value=row[1]))
    
    request = UnivariateDetectionOptions(series=series, granularity=TimeGranularity.DAILY)
    
    change_point_response = client.detect_univariate_change_point(request)
    anomaly_response = client.detect_univariate_entire_series(request)
    
    for i in range(len(data_file.values)):
        temp_date_to_num = mdates.date2num(data_file.values[i])
        date= temp_date_to_num[0]
        if (change_point_response.is_change_point[i]):
            plt.plot(date,data_file.values[i][1], 's', color ='blue')
            print("Change point detected at index: "+ str(i))
        elif (anomaly_response.is_anomaly[i]):
            plt.plot(date,data_file.values[i][1], '^', color="red")
            print("Anomaly detected at index:      "+ str(i))
        else:
            plt.plot(date,data_file.values[i][1], 'o', color ='green')
    plt.show()
    

    Important

    For production, use a secure way of storing and accessing your credentials like Azure Key Vault. for more information about credential security, see the Azure AI services security article.

  3. Run the application with the python command on your quickstart file

    python quickstart.py
    

Output

In this code example, we've added the matplotlib library to allow us to visualize and easily distinguish normal data points from change points and anomalies. Change points are represented by blue squares, anomalies are red triangles, and normal data points are green circles. Dates are converted to numbers using matplotlib's date2num method to provide graph friendly values for the charts y-axis.

Screenshot of results with indexes of anomalies and change points on a scatter plot. Different shapes and colors are used for different data types..

Clean up resources

If you want to clean up and remove an Anomaly Detector resource, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it. You also may want to consider deleting the environment variables you created if you no longer intend to use them.

In this quickstart, you learn how to detect anomalies in a batch of time series data using the Anomaly Detector service and cURL.

For a high-level look at Anomaly Detector concepts, see the overview article.

Prerequisites

  • An Azure subscription - Create one for free
  • Once you have your Azure subscription, create an Anomaly Detector resource in the Azure portal to get your key and endpoint. Wait for it to deploy and select the Go to resource button. You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.
  • A valid JSON file of time series data to test for anomalies. If you don't have your own file, you can create a sample.json file from the Request body sample

Retrieve key and endpoint

To successfully make a call against the Anomaly Detector service, you'll need the following values:

Variable name Value
ANOMALY_DETECTOR_ENDPOINT This value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. Example endpoint: https://YOUR_RESOURCE_NAME.cognitiveservices.azure.com/
ANOMALY_DETECTOR_API_KEY The API key value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. You can use either KEY1 or KEY2.

Go to your resource in the Azure portal. The Endpoint and Keys can be found in the Resource Management section. Copy your endpoint and access key as you'll need both for authenticating your API calls. You can use either KEY1 or KEY2. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.

Create environment variables

Create and assign persistent environment variables for your key and endpoint.

Important

If you use an API key, store it securely somewhere else, such as in Azure Key Vault. Don't include the API key directly in your code, and never post it publicly.

For more information about AI services security, see Authenticate requests to Azure AI services.

setx ANOMALY_DETECTOR_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE" 
setx ANOMALY_DETECTOR_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE" 

Detect anomalies

At a command prompt, run the following command. You'll need to insert the following values into the command.

  • Your Anomaly detector service subscription key.
  • Your Anomaly detector endpoint address.
  • A valid JSON file of time series data to test for anomalies. If you don't have your own file, you can create a sample.json file from the Request body sample.
curl -v POST "%ANOMALY_DETECTOR_ENDPOINT%/anomalydetector/v1.0/timeseries/entire/detect"
-H "Content-Type: application/json"
-H "Ocp-Apim-Subscription-Key: %ANOMALY_DETECTOR_API_KEY%"
-d "@path_to_sample_file.json" 

An example of the full command as a single line:

curl -v POST "%ANOMALY_DETECTOR_ENDPOINT%/anomalydetector/v1.0/timeseries/entire/detect" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: %ANOMALY_DETECTOR_API_KEY%" -d "@c:\test\rest.json"

Alternatively if you're running the cURL command from a Bash shell your command would be slightly different:

curl -v POST "$ANOMALY_DETECTOR_ENDPOINT/anomalydetector/v1.0/timeseries/entire/detect" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: $ANOMALY_DETECTOR_API_KEY" -d "@c:\test\rest.json"

If you used the sample data from the pre-requisites, you should receive a response 200 with the following results:

{
  "expectedValues": [
    827.7940908243968,
    798.9133774671927,
    888.6058431807189,
    900.5606407986661,
    962.8389426378304,
    933.2591606306954,
    891.0784104799666,
    856.1781601363697,
    809.8987227908941,
    807.375129007505,
    764.3196682448518,
    803.933498594564,
    823.5900620883058,
    794.0905641334288,
    883.164245249282,
    894.8419000690953,
    956.8430591101258,
    927.6285055190114,
    885.812983784303,
    851.6424797402517,
    806.0927886943216,
    804.6826815312029,
    762.74070738882,
    804.0251702513732,
    825.3523662579559,
    798.0404188724976,
    889.3016505577698,
    902.4226124345937,
    965.867078532635,
    937.3200495736695,
    896.1720524711102,
    862.0087368413656,
    816.4662342097423,
    814.4297745524709,
    771.8614479159354,
    811.859271346729,
    831.8998279215521,
    802.947544797165,
    892.5684407435083,
    904.5488214533809,
    966.8527063844707,
    937.3168391003043,
    895.180003672544,
    860.3649596356635,
    814.1707285969043,
    811.9054862686213,
    769.1083769610742,
    809.2328084659704
  ],
  "upperMargins": [
    41.389704541219835,
    39.94566887335964,
    44.43029215903594,
    45.02803203993331,
    48.14194713189152,
    46.66295803153477,
    44.55392052399833,
    42.808908006818484,
    40.494936139544706,
    40.36875645037525,
    38.215983412242586,
    40.196674929728196,
    41.17950310441529,
    39.70452820667144,
    44.1582122624641,
    44.74209500345477,
    47.84215295550629,
    46.38142527595057,
    44.290649189215145,
    42.58212398701258,
    40.30463943471608,
    40.234134076560146,
    38.137035369441,
    40.201258512568664,
    41.267618312897795,
    39.90202094362488,
    44.46508252788849,
    45.121130621729684,
    48.29335392663175,
    46.86600247868348,
    44.80860262355551,
    43.100436842068284,
    40.82331171048711,
    40.721488727623544,
    38.593072395796774,
    40.59296356733645,
    41.5949913960776,
    40.14737723985825,
    44.62842203717541,
    45.227441072669045,
    48.34263531922354,
    46.86584195501521,
    44.759000183627194,
    43.01824798178317,
    40.70853642984521,
    40.59527431343106,
    38.45541884805371,
    40.46164042329852
  ],
  "lowerMargins": [
    41.389704541219835,
    39.94566887335964,
    44.43029215903594,
    45.02803203993331,
    48.14194713189152,
    46.66295803153477,
    44.55392052399833,
    42.808908006818484,
    40.494936139544706,
    40.36875645037525,
    38.215983412242586,
    40.196674929728196,
    41.17950310441529,
    39.70452820667144,
    44.1582122624641,
    44.74209500345477,
    47.84215295550629,
    46.38142527595057,
    44.290649189215145,
    42.58212398701258,
    40.30463943471608,
    40.234134076560146,
    38.137035369441,
    40.201258512568664,
    41.267618312897795,
    39.90202094362488,
    44.46508252788849,
    45.121130621729684,
    48.29335392663175,
    46.86600247868348,
    44.80860262355551,
    43.100436842068284,
    40.82331171048711,
    40.721488727623544,
    38.593072395796774,
    40.59296356733645,
    41.5949913960776,
    40.14737723985825,
    44.62842203717541,
    45.227441072669045,
    48.34263531922354,
    46.86584195501521,
    44.759000183627194,
    43.01824798178317,
    40.70853642984521,
    40.59527431343106,
    38.45541884805371,
    40.46164042329852
  ],
  "isAnomaly": [
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    true,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false
  ],
  "isPositiveAnomaly": [
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    true,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false
  ],
  "isNegativeAnomaly": [
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false
  ],
  "period": 12
}

For more information, see the Anomaly Detection REST reference.

Clean up resources

If you want to clean up and remove an Azure AI services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with the resource group.

Next steps

Concepts:

Tutorials: