Quickstart: Use the Anomaly Detector univariate client library

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.

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

Prerequisites

  • 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 click the Go to resource button.
    • You will need the key and endpoint from the resource you create to connect your application to the Anomaly Detector API. You'll paste your key and endpoint into the code below later in the quickstart. You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.

Setting 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 --version 3.0.0-preview.5

Detect an anomaly from an entire time series

You will need to update the code below and provide your own values for the following variables.

Variable name Value
your-endpoint This value can be found in the Keys & Endpoint section when examining your resource from the Azure portal.An example endpoint is: https://contoso-new-001.cognitiveservices.azure.com/
your-apikey This value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. You can use either Key1 or Key2. Always having two valid keys allows for secure key rotation with zero downtime.
request-data.csv You need to provide a path to your own sample data stored in csv format to detect an anomaly from. If you would like to use our sample data you can download sample data here

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

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Azure.AI.AnomalyDetector;
using Azure.AI.AnomalyDetector.Models;
using Azure.Core.TestFramework;
using NUnit.Framework;

namespace Azure.AI.AnomalyDetector.Tests.Samples
{
    public partial class AnomalyDetectorSamples : SamplesBase<AnomalyDetectorTestEnvironment>
    {
        [Test]
        public async Task DetectEntireSeriesAnomaly()
        {
            //read endpoint and apiKey
            string endpoint = "your-endpoint";
            string apiKey = "your-apikey";

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

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

            //read data
            string datapath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "samples", "data", "request-data.csv");

            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
            DetectRequest request = new DetectRequest(list)
            {
                Granularity = TimeGranularity.Daily
            };

            //detect
            Console.WriteLine("Detecting anomalies in the entire time series.");

            try
            {
                EntireDetectResponse result = await client.DetectEntireSeriesAsync(request).ConfigureAwait(false);

                bool hasAnomaly = false;
                for (int i = 0; i < request.Series.Count; ++i)
                {
                    if (result.IsAnomaly[i])
                    {
                        Console.WriteLine("An anomaly was detected at index: {0}.", i);
                        hasAnomaly = true;
                    }
                }
                if (!hasAnomaly)
                {
                    Console.WriteLine("No anomalies detected in the series.");
                }
            }
            catch (RequestFailedException ex)
            {
                Console.WriteLine(String.Format("Entire detection failed: {0}", ex.Message));
                throw;
            }
            catch (Exception ex)
            {
                Console.WriteLine(String.Format("Detection error. {0}", ex.Message));
                throw;
            }
        }
    }
}

Code details

Load time series and create DetectRequest

You could download our sample data, read in the time series data and add it to a DetectRequest object.

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.

Make a DetectRequest object with the series of points, and TimeGranularity.Daily for the granularity (or periodicity) of the data points.

//read data
string datapath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "samples", "data", "request-data.csv");

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
DetectRequest request = new DetectRequest(list)
{
    Granularity = TimeGranularity.Daily
};

Detect anomalies of the entire series

Call the client's DetectEntireSeriesAsync method with the DetectRequest object and await the response as an EntireDetectResponse object. 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.

//detect
Console.WriteLine("Detecting anomalies in the entire time series.");

try
{
    EntireDetectResponse result = await client.DetectEntireSeriesAsync(request).ConfigureAwait(false);

    bool hasAnomaly = false;
    for (int i = 0; i < request.Series.Count; ++i)
    {
        if (result.IsAnomaly[i])
        {
            Console.WriteLine("An anomaly was detected at index: {0}.", i);
            hasAnomaly = true;
        }
    }
    if (!hasAnomaly)
    {
        Console.WriteLine("No anomalies detected in the series.");
    }
}
catch (RequestFailedException ex)
{
    Console.WriteLine(String.Format("Entire detection failed: {0}", ex.Message));
    throw;
}
catch (Exception ex)
{
    Console.WriteLine(String.Format("Detection error. {0}", ex.Message));
    throw;
}

Clean up resources

If you want to clean up and remove a Cognitive 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:

Get started with the Anomaly Detector client library for JavaScript. 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 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.

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

Prerequisites

  • 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 click the Go to resource button.
    • You will need the key and endpoint from the resource you create to connect your application to the Anomaly Detector API. You'll paste your key and endpoint into the code below later in the quickstart. You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.

Setting up

Create an environment variable

Note

The endpoints for non-trial resources created after July 1, 2019 use the custom subdomain format shown below. For more information and a complete list of regional endpoints, see Custom subdomain names for Cognitive Services.

Using your key and endpoint from the resource you created, create two environment variables for authentication:

  • ANOMALY_DETECTOR_KEY - The resource key for authenticating your requests.
  • ANOMALY_DETECTOR_ENDPOINT - The resource endpoint for sending API requests. It will look like this:
    • https://<your-custom-subdomain>.api.cognitive.microsoft.com

Use the instructions for your operating system.

setx ANOMALY_DETECTOR_KEY <replace-with-your-anomaly-detector-key>
setx ANOMALY_DETECTOR_ENDPOINT <replace-with-your-anomaly-detector-endpoint>

After you add the environment variable, restart the console window.

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

Run the npm init command to create a node application with a package.json file.

npm init

Create a file named index.js and import the following libraries:

'use strict'

const fs = require('fs');
const parse = require("csv-parse/lib/sync");
const { AnomalyDetectorClient } = require('@azure/ai-anomaly-detector');
const { AzureKeyCredential } = require('@azure/core-auth');

Create variables your resource's Azure endpoint and key. If you created the environment variable after you launched the application, you will need to close and reopen the editor, IDE, or shell running it to access the variable. Create another variable for the example data file you will download in a later step, and an empty list for the data points. Then create a ApiKeyCredentials object to contain the key.

// Spreadsheet with 2 columns and n rows.
let CSV_FILE = './request-data.csv';

// Authentication variables
let key = 'PASTE_YOUR_ANOMALY_DETECTOR_SUBSCRIPTION_KEY_HERE';
let endpoint = 'PASTE_YOUR_ANOMALY_DETECTOR_ENDPOINT_HERE';

// Points array for the request body
let points = [];

Install the client library

Install the ms-rest-azure and azure-cognitiveservices-anomalydetector NPM packages. The csv-parse library is also used in this quickstart:

npm install @azure/ai-anomaly-detector @azure/ms-rest-js csv-parse

Your app's package.json file will be updated with the dependencies.

Object model

The Anomaly Detector client is an AnomalyDetectorClient object that authenticates to Azure using your key. The client can do anomaly detection on an entire dataset using entireDetect(), or on the latest data point using LastDetect(). The ChangePointDetectAsync method detects points that mark changes in a trend.

Time series data is sent as series of Points in a Request object. The Request object contains properties to describe the data (Granularity for example), and parameters for the anomaly detection.

The Anomaly Detector response is a LastDetectResponse, EntireDetectResponse, or ChangePointDetectResponse object depending on the method used.

Code examples

These code snippets show you how to do the following with the Anomaly Detector client library for Node.js:

Authenticate the client

Instantiate a AnomalyDetectorClient object with your endpoint and credentials.

let anomalyDetectorClient = new AnomalyDetectorClient(endpoint, new AzureKeyCredential(key));

Load time series data from a file

Download the example data for this quickstart from GitHub:

  1. In your browser, right-click Raw.
  2. Click Save link as.
  3. Save the file to your application directory, as a .csv file.

This time series data is formatted as a .csv file, and will be sent to the Anomaly Detector API.

Read your data file with the csv-parse library's readFileSync() method, and parse the file with parse(). For each line, push a Point object containing the timestamp, and the numeric value.

function readFile() {
    let input = fs.readFileSync(CSV_FILE).toString();
    let parsed = parse(input, { skip_empty_lines: true });
    parsed.forEach(function (e) {
        points.push({ timestamp: new Date(e[0]), value: parseFloat(e[1]) });
    });
}
readFile()

Detect anomalies in the entire data set

Call the API to detect anomalies through the entire time series as a batch with the client's entireDetect() method. Store the returned EntireDetectResponse object. 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.

async function batchCall() {
    // Create request body for API call
    let body = { series: points, granularity: 'daily' }
    // Make the call to detect anomalies in whole series of points
    await anomalyDetectorClient.detectEntireSeries(body)
        .then((response) => {
            console.log("Batch (entire) anomaly detection):")
            for (let item = 0; item < response.isAnomaly.length; item++) {
                if (response.isAnomaly[item]) {
                    console.log("An anomaly was detected from the series, at row " + item)
                }
            }
        }).catch((error) => {
            console.log(error)
        })

}
batchCall()

Detect the anomaly status of the latest data point

Call the Anomaly Detector API to determine if your latest data point is an anomaly using the client's lastDetect() method, and store the returned LastDetectResponse object. The response's isAnomaly value is a boolean that specifies that point's anomaly status.

async function lastDetection() {

    let body = { series: points, granularity: 'daily' }
    // Make the call to detect anomalies in the latest point of a series
    await anomalyDetectorClient.detectLastPoint(body)
        .then((response) => {
            console.log("Latest point anomaly detection:")
            if (response.isAnomaly) {
                console.log("The latest point, in row " + points.length + ", is detected as an anomaly.")
            } else {
                console.log("The latest point, in row " + points.length + ", is not detected as an anomaly.")
            }
        }).catch((error) => {
            console.log(error)
        })
}
lastDetection()

Detect change points in the data set

Call the API to detect change points in the time series with the client's detectChangePoint() method. Store the returned ChangePointDetectResponse object. Iterate through the response's isChangePoint list, and print the index of any true values. These values correspond to the indices of trend change points, if any were found.

async function changePointDetection() {

    let body = { series: points, granularity: 'daily' }
    // get change point detect results
    await anomalyDetectorClient.detectChangePoint(body)
        .then((response) => {
            if (
                response.isChangePoint.some(function (changePoint) {
                    return changePoint === true;
                })
            ) {
                console.log("Change points were detected from the series at index:");
                response.isChangePoint.forEach(function (changePoint, index) {
                    if (changePoint === true) {
                        console.log(index);
                    }
                });
            } else {
                console.log("There is no change point detected from the series.");
            }
        }).catch((error) => {
            console.log(error)
        })
}

Run the application

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

node index.js

Clean up resources

If you want to clean up and remove a Cognitive 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:

Get started with the Anomaly Detector client library for Python. 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 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.

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

Prerequisites

  • Python 3.x
  • The Pandas data analysis library
  • 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 click the Go to resource button.
    • You will need the key and endpoint from the resource you create to connect your application to the Anomaly Detector API. You'll paste your key and endpoint into the code below later in the quickstart. You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.

Setting up

Create an environment variable

Note

The endpoints for non-trial resources created after July 1, 2019 use the custom subdomain format shown below. For more information and a complete list of regional endpoints, see Custom subdomain names for Cognitive Services.

Using your key and endpoint from the resource you created, create two environment variables for authentication:

  • ANOMALY_DETECTOR_KEY - The resource key for authenticating your requests.
  • ANOMALY_DETECTOR_ENDPOINT - The resource endpoint for sending API requests. It will look like this:
    • https://<your-custom-subdomain>.api.cognitive.microsoft.com

Use the instructions for your operating system.

setx ANOMALY_DETECTOR_KEY <replace-with-your-anomaly-detector-key>
setx ANOMALY_DETECTOR_ENDPOINT <replace-with-your-anomaly-detector-endpoint>

After you add the environment variable, restart the console window.

Create a new python application

Create a new Python file and import the following libraries.

import os
from azure.ai.anomalydetector import AnomalyDetectorClient
from azure.ai.anomalydetector.models import DetectRequest, TimeSeriesPoint, TimeGranularity, \
    AnomalyDetectorError
from azure.core.credentials import AzureKeyCredential
import pandas as pd

Create variables for your key as an environment variable, the path to a time series data file, and the Azure location of your subscription. For example, westus2.

SUBSCRIPTION_KEY = os.environ["ANOMALY_DETECTOR_KEY"]
ANOMALY_DETECTOR_ENDPOINT = os.environ["ANOMALY_DETECTOR_ENDPOINT"]
TIME_SERIES_DATA_PATH = os.path.join("./sample_data", "request-data.csv")

Install the client library

After installing Python, you can install the client library with:

pip install --upgrade azure-ai-anomalydetector

Object model

The Anomaly Detector client is a AnomalyDetectorClient object that authenticates to Azure using your key. The client can do anomaly detection an entire dataset using detect_entire_series, or on the latest data point using detect_last_point. The detect_change_point function detects points that mark changes in a trend.

Time series data is sent as a series of TimeSeriesPoints object. The DetectRequest object contains properties to describe the data TimeGranularity for example, and parameters for the anomaly detection.

The Anomaly Detector response is a LastDetectResponse, EntireDetectResponse, or ChangePointDetectResponse object depending on the method used.

Code examples

These code snippets show you how to do the following with the Anomaly Detector client library for Python:

Authenticate the client

Add your Azure location variable to the endpoint, and authenticate the client with your key.

client = AnomalyDetectorClient(AzureKeyCredential(SUBSCRIPTION_KEY), ANOMALY_DETECTOR_ENDPOINT)

Load time series data from a file

Download the example data for this quickstart from GitHub:

  1. In your browser, right-click Raw.
  2. Click Save link as.
  3. Save the file to your application directory, as a .csv file.

This time series data is formatted as a .csv file, and will be sent to the Anomaly Detector API.

Load your data file with the Pandas library's read_csv() method, and make an empty list variable to store your data series. Iterate through the file, and append the data as a TimeSeriesPoint object. This object will contain the timestamp and numerical value from the rows of your .csv data file.

series = []
data_file = pd.read_csv(TIME_SERIES_DATA_PATH, header=None, encoding='utf-8', parse_dates=[0])
for index, row in data_file.iterrows():
    series.append(TimeSeriesPoint(timestamp=row[0], value=row[1]))

Create a DetectRequest object with your time series, and the TimeGranularity (or periodicity) of its data points. For example, TimeGranularity.daily.

request = DetectRequest(series=series, granularity=TimeGranularity.daily)

Input argument descriptions: 'series': required in request. must be array/list type, and have more than 12 points and no more than 8640 points. must sorted by timestamp in ascending order and cannot have duplicated timestamp. 'granularity': required in request. can only be one of the following: ['daily', 'minutely', 'hourly', 'weekly', 'monthly', 'yearly', 'secondly']. 'customInterval': must be an integer > 0. 'period': must be an integer >= 0. 'maxAnomalyRatio': must be less than 50% of the series points (0 < maxAnomalyRatio < 0.5). 'sensitivity': must be an integer between 0 and 99.

Detect anomalies in the entire data set

Call the API to detect anomalies through the entire time series data using the client's detect_entire_series method. Store the returned EntireDetectResponse object. Iterate through the response's is_anomaly list, and print the index of any true values. These values correspond to the index of anomalous data points, if any were found.

print('Detecting anomalies in the entire time series.')

try:
    response = client.detect_entire_series(request)
except AnomalyDetectorError as e:
    print('Error code: {}'.format(e.error.code), 'Error message: {}'.format(e.error.message))
except Exception as e:
    print(e)

if any(response.is_anomaly):
    print('An anomaly was detected at index:')
    for i, value in enumerate(response.is_anomaly):
        if value:
            print(i)
else:
    print('No anomalies were detected in the time series.')

Detect the anomaly status of the latest data point

Call the Anomaly Detector API to determine if your latest data point is an anomaly using the client's detect_last_point method, and store the returned LastDetectResponse object. The response's is_anomaly value is a boolean that specifies that point's anomaly status.

print('Detecting the anomaly status of the latest data point.')

try:
    response = client.detect_last_point(request)
except AnomalyDetectorError as e:
    print('Error code: {}'.format(e.error.code), 'Error message: {}'.format(e.error.message))
except Exception as e:
    print(e)

if response.is_anomaly:
    print('The latest point is detected as anomaly.')
else:
    print('The latest point is not detected as anomaly.')

Detect change points in the data set

Call the API to detect change points in the time series data using the client's detect_change_point method. Store the returned ChangePointDetectResponse object. Iterate through the response's is_change_point list, and print the index of any true values. These values correspond to the indices of trend change points, if any were found.

print('Detecting change points in the entire time series.')

try:
    response = client.detect_change_point(request)
except AnomalyDetectorError as e:
    print('Error code: {}'.format(e.error.code), 'Error message: {}'.format(e.error.message))
except Exception as e:
    print(e)

if any(response.is_change_point):
    print('An change point was detected at index:')
    for i, value in enumerate(response.is_change_point):
        if value:
            print(i)
else:
    print('No change point were detected in the time series.')

Run the application

Run the application with the python command and your file name.

Clean up resources

If you want to clean up and remove a Cognitive 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:

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

  • 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 will need the key and endpoint address from the resource you create to use the REST API. You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.

Detect anomalies for an entire series

At a command prompt, run the following command. You will 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 -X POST "https://{endpointresourcename.cognitive.microsoft.com}/anomalydetector/v1.0/timeseries/entire/detect"
-H "Content-Type: application/json"
-H "Ocp-Apim-Subscription-Key: {subscription key}"
-d "@{path_to_file.json}" 

For an example with all values populated:

curl -v -X POST "https://my-resource-name.cognitiveservices.azure.com/anomalydetector/v1.0/timeseries/entire/detect" -H  "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key:1111112222222ed333333ab333333333" -d "@test.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 a Cognitive 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: