Search code examples
azureazure-cognitive-servicesazure-anomaly-detectionazure-anomaly-detectorazure-ai

How to use the Multi-variate Anomaly Detection Cognitive Service by Azure?


In the latest version of the Anomaly Detection Service by Azure which supports the Multi-variate Cognitive Service, we need to train a model and then consume it.

The quickstart documentation for Python mentions a few libraries which are not getting imported:

from azure.ai.anomalydetector.models import DetectionRequest, ModelInfo

Both these libraries are throwing import errors. How can we use the Multivariate Anomaly Detection Service using the Python SDK?


Solution

  • This error was with version azure-ai-anomalydetector==3.0.0b2. With version azure-ai-anomalydetector==3.0.0b3, this has been addressed.

    The problem is because of the change of the response format recently. To solve that issue, you can change the line with error to

    model_status = self.ad_client.get_multivariate_model(trained_model_id).model_info.status