Share via


AnomalyDetectorClient.GetMultivariateModelAsync Method

Definition

Overloads

GetMultivariateModelAsync(String, RequestContext)

[Protocol Method] Get Multivariate Model

GetMultivariateModelAsync(String, CancellationToken)

Get Multivariate Model.

GetMultivariateModelAsync(String, RequestContext)

Source:
AnomalyDetectorClient.cs

[Protocol Method] Get Multivariate Model

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

Parameters

modelId
String

Model identifier.

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

modelId is null.

modelId 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 GetMultivariateModelAsync 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.GetMultivariateModelAsync("<modelId>", new RequestContext());

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("modelId").ToString());
Console.WriteLine(result.GetProperty("createdTime").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedTime").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("dataSource").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("dataSchema").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("slidingWindow").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("alignPolicy").GetProperty("alignMode").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("alignPolicy").GetProperty("fillNAMethod").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("alignPolicy").GetProperty("paddingValue").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("diagnosticsInfo").GetProperty("modelState").GetProperty("epochIds")[0].ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("diagnosticsInfo").GetProperty("modelState").GetProperty("trainLosses")[0].ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("diagnosticsInfo").GetProperty("modelState").GetProperty("validationLosses")[0].ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("diagnosticsInfo").GetProperty("modelState").GetProperty("latenciesInSeconds")[0].ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("diagnosticsInfo").GetProperty("variableStates")[0].GetProperty("variable").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("diagnosticsInfo").GetProperty("variableStates")[0].GetProperty("filledNARatio").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("diagnosticsInfo").GetProperty("variableStates")[0].GetProperty("effectiveCount").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("diagnosticsInfo").GetProperty("variableStates")[0].GetProperty("firstTimestamp").ToString());
Console.WriteLine(result.GetProperty("modelInfo").GetProperty("diagnosticsInfo").GetProperty("variableStates")[0].GetProperty("lastTimestamp").ToString());

Remarks

Get detailed information of multivariate model, including the training status and variables used in the model.

Below is the JSON schema for the response payload.

Response Body:

Schema for AnomalyDetectionModel:

{
  modelId: string, # Required.
  createdTime: string (date & time), # Required.
  lastUpdatedTime: string (date & time), # Required.
  modelInfo: {
    dataSource: string, # Required.
    dataSchema: "OneTable" | "MultiTable", # Optional.
    startTime: string (date & time), # Required.
    endTime: string (date & time), # Required.
    displayName: string, # Optional.
    slidingWindow: number, # Optional.
    alignPolicy: {
      alignMode: "Inner" | "Outer", # Optional.
      fillNAMethod: "Previous" | "Subsequent" | "Linear" | "Zero" | "Fixed", # Optional.
      paddingValue: number, # Optional.
    }, # Optional.
    status: "CREATED" | "RUNNING" | "READY" | "FAILED", # Optional.
    errors: [
      {
        code: string, # Required.
        message: string, # Required.
      }
    ], # Optional.
    diagnosticsInfo: {
      modelState: {
        epochIds: [number], # Optional.
        trainLosses: [number], # Optional.
        validationLosses: [number], # Optional.
        latenciesInSeconds: [number], # Optional.
      }, # Optional.
      variableStates: [VariableState], # Optional.
    }, # Optional.
  }, # Optional.
}

Applies to

GetMultivariateModelAsync(String, CancellationToken)

Source:
AnomalyDetectorClient.cs

Get Multivariate Model.

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

Parameters

modelId
String

Model identifier.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

modelId is null.

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

Examples

This sample shows how to call GetMultivariateModelAsync 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.GetMultivariateModelAsync("<modelId>");

Remarks

Get detailed information about the multivariate model, including the training status and variables used in the model.

Applies to