Condividi tramite


AnomalyDetectorClient.GetMultivariateBatchDetectionResult Method

Definition

Overloads

GetMultivariateBatchDetectionResult(String, RequestContext)

[Protocol Method] Get Multivariate Anomaly Detection Result

GetMultivariateBatchDetectionResult(String, CancellationToken)

Get Multivariate Anomaly Detection Result.

GetMultivariateBatchDetectionResult(String, RequestContext)

Source:
AnomalyDetectorClient.cs

[Protocol Method] Get Multivariate Anomaly Detection Result

public virtual Azure.Response GetMultivariateBatchDetectionResult (string resultId, Azure.RequestContext context);
abstract member GetMultivariateBatchDetectionResult : string * Azure.RequestContext -> Azure.Response
override this.GetMultivariateBatchDetectionResult : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetMultivariateBatchDetectionResult (resultId As String, context As RequestContext) As 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 GetMultivariateBatchDetectionResult 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 = client.GetMultivariateBatchDetectionResult("<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

GetMultivariateBatchDetectionResult(String, CancellationToken)

Source:
AnomalyDetectorClient.cs

Get Multivariate Anomaly Detection Result.

public virtual Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult> GetMultivariateBatchDetectionResult (string resultId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetMultivariateBatchDetectionResult : string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult>
override this.GetMultivariateBatchDetectionResult : string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult>
Public Overridable Function GetMultivariateBatchDetectionResult (resultId As String, Optional cancellationToken As CancellationToken = Nothing) As 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 GetMultivariateBatchDetectionResult 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 = client.GetMultivariateBatchDetectionResult("<resultId>");

Remarks

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

Applies to