Share via


AnomalyDetectorClient.GetMultivariateBatchDetectionResultAsync Method

Definition

Overloads

GetMultivariateBatchDetectionResultAsync(String, RequestContext)

[Protocol Method] Get Multivariate Anomaly Detection Result

GetMultivariateBatchDetectionResultAsync(String, CancellationToken)

Get Multivariate Anomaly Detection Result.

GetMultivariateBatchDetectionResultAsync(String, RequestContext)

Source:
AnomalyDetectorClient.cs

[Protocol Method] Get Multivariate Anomaly Detection Result

public virtual System.Threading.Tasks.Task<Azure.Response> GetMultivariateBatchDetectionResultAsync (string resultId, Azure.RequestContext context);
abstract member GetMultivariateBatchDetectionResultAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetMultivariateBatchDetectionResultAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetMultivariateBatchDetectionResultAsync (resultId As String, context As RequestContext) As Task(Of Response)

Parameters

resultId
String

ID of a batch detection result.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

resultId is null.

resultId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetMultivariateBatchDetectionResultAsync with required parameters and parse the result.

var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new AnomalyDetectorClient(endpoint, credential);

Response response = await client.GetMultivariateBatchDetectionResultAsync("<resultId>", new RequestContext());

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("resultId").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("variableStates")[0].GetProperty("variable").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("variableStates")[0].GetProperty("filledNARatio").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("variableStates")[0].GetProperty("effectiveCount").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("variableStates")[0].GetProperty("firstTimestamp").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("variableStates")[0].GetProperty("lastTimestamp").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("setupInfo").GetProperty("dataSource").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("setupInfo").GetProperty("topContributorCount").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("setupInfo").GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("summary").GetProperty("setupInfo").GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("results")[0].GetProperty("timestamp").ToString());
Console.WriteLine(result.GetProperty("results")[0].GetProperty("value").GetProperty("isAnomaly").ToString());
Console.WriteLine(result.GetProperty("results")[0].GetProperty("value").GetProperty("severity").ToString());
Console.WriteLine(result.GetProperty("results")[0].GetProperty("value").GetProperty("score").ToString());
Console.WriteLine(result.GetProperty("results")[0].GetProperty("value").GetProperty("interpretation")[0].GetProperty("variable").ToString());
Console.WriteLine(result.GetProperty("results")[0].GetProperty("value").GetProperty("interpretation")[0].GetProperty("contributionScore").ToString());
Console.WriteLine(result.GetProperty("results")[0].GetProperty("value").GetProperty("interpretation")[0].GetProperty("correlationChanges").GetProperty("changedVariables")[0].ToString());
Console.WriteLine(result.GetProperty("results")[0].GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("results")[0].GetProperty("errors")[0].GetProperty("message").ToString());

Remarks

For asynchronous inference, get multivariate anomaly detection result based on resultId returned by the BatchDetectAnomaly api.

Below is the JSON schema for the response payload.

Response Body:

Schema for MultivariateDetectionResult:

{
  resultId: string, # Required.
  summary: {
    status: "CREATED" | "RUNNING" | "READY" | "FAILED", # Required.
    errors: [ErrorResponse], # Optional.
    variableStates: [VariableState], # Optional.
    setupInfo: {
      dataSource: string, # Required.
      topContributorCount: number, # Required.
      startTime: string (date & time), # Required.
      endTime: string (date & time), # Required.
    }, # Required.
  }, # Required.
  results: [
    {
      timestamp: string (date & time), # Required.
      value: {
        isAnomaly: boolean, # Required.
        severity: number, # Required.
        score: number, # Required.
        interpretation: [AnomalyInterpretation], # Optional.
      }, # Optional.
      errors: [ErrorResponse], # Optional.
    }
  ], # Required.
}

Applies to

GetMultivariateBatchDetectionResultAsync(String, CancellationToken)

Source:
AnomalyDetectorClient.cs

Get Multivariate Anomaly Detection Result.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult>> GetMultivariateBatchDetectionResultAsync (string resultId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetMultivariateBatchDetectionResultAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult>>
override this.GetMultivariateBatchDetectionResultAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult>>
Public Overridable Function GetMultivariateBatchDetectionResultAsync (resultId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of MultivariateDetectionResult))

Parameters

resultId
String

ID of a batch detection result.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

resultId is null.

resultId is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetMultivariateBatchDetectionResultAsync with required parameters.

var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new AnomalyDetectorClient(endpoint, credential);

var result = await client.GetMultivariateBatchDetectionResultAsync("<resultId>");

Remarks

For asynchronous inference, get a multivariate anomaly detection result based on the resultId value that the BatchDetectAnomaly API returns.

Applies to