08 Multivariate anomaly detection - gloveboxes/HealthySpacesAnomalyDetection GitHub Wiki
Detecting anomalies with Azure Anomaly Detection Multivariate API
In this unit you will run the climate anomaly BASIC application, create an Azure Anomaly Detection API service, and install support for Jupyter Notebooks.
To learn more about Azure Anomaly Detector API, refer to the Anomaly Detector API Documentation.
Generate climate data with anomalies
Climate change is gradual. To generate a climate change data set run the following BASIC application from the Altair web terminal for at least two hours. The anomaly application will generate climate data, injecting some some random temperate data which will be detected by the Azure Anomaly Detector API service.
mbasic anomaly
Create an Anomaly Detector resource in Azure portal
- Create an Azure subscription if you don't have one - Create one for free
- Once you have your Azure subscription, create an Anomaly Detector resource in the Azure portal to get your API key and API endpoint.
Install Jupyter notebook support
Ensure that you have the latest pip; older versions may have trouble with some dependencies:
-
Download and install Python3 from python.org
-
Update to the latest pip
pip3 install --upgrade pip -
Install required Python libraries
pip3 install jupyter pandas numpy bokeh ipywidgets azure.storage.blob matplotlib -
Install Visual Studio Code Python Extension
References:
Open the Anomaly Detector Jupyter Notebook
From Visual Studio Code, open the Altair8800/AnomalyDetector/AnomalyDetection.ipynb file.
Configure the Anomaly Detector Jupyter Notebook
You need to update the following variables in the first Jupyter Notebook cell.
apikey = "REPLACE_WITH_YOUR_AZURE_ANOMALY_DETECTOR_API_KEY"
endpoint = "REPLACE_WITH_YOUR_AZURE_ANOMALY_DETECTOR_API_ENDPOINT"
device_id = "REPLACE_WITH_YOUR_IOT_CENTRAL_DEVICE_ID"
blob_conn_str="REPLACE_WITH_YOUR_STORAGE_ACCOUNT_CONNECTION_STRING"
Run the Anomaly Detector Jupyter Notebook
Select Run All from the Jupyter Notebook memu.

The Jupyter Notebook will take approx 2 to 5 minutes to execute depending on how long you have been running the anomaly BASIC application.
When the Jupyter Notebook has completed, a chart similar to the following image will be displayed.

References
Install Azure Storage Explorer
- Install Azure Storage Explorer.
- Sign in to Storage Explorer