Compartir a través de


AnomalyDetectorAsyncClient Class

  • java.lang.Object
    • com.azure.ai.anomalydetector.AnomalyDetectorAsyncClient

public final class AnomalyDetectorAsyncClient

Initializes a new instance of the asynchronous AnomalyDetectorClient type.

Method Summary

Modifier and Type Method and Description
Mono<Void> deleteMultivariateModel(String modelId)

Delete Multivariate Model

Mono<Response<Void>> deleteMultivariateModelWithResponse(String modelId, RequestOptions requestOptions)

Delete Multivariate Model

Mono<MultivariateDetectionResult> detectMultivariateBatchAnomaly(String modelId, MultivariateBatchDetectionOptions options)

Detect Multivariate Anomaly

Mono<Response<BinaryData>> detectMultivariateBatchAnomalyWithResponse(String modelId, BinaryData options, RequestOptions requestOptions)

Detect Multivariate Anomaly

Mono<MultivariateLastDetectionResult> detectMultivariateLastAnomaly(String modelId, MultivariateLastDetectionOptions options)

Detect anomalies in the last point of the request body

Mono<Response<BinaryData>> detectMultivariateLastAnomalyWithResponse(String modelId, BinaryData options, RequestOptions requestOptions)

Detect anomalies in the last point of the request body

Mono<UnivariateChangePointDetectionResult> detectUnivariateChangePoint(UnivariateChangePointDetectionOptions options)

Detect change point for the entire series

Mono<Response<BinaryData>> detectUnivariateChangePointWithResponse(BinaryData options, RequestOptions requestOptions)

Detect change point for the entire series

Mono<UnivariateEntireDetectionResult> detectUnivariateEntireSeries(UnivariateDetectionOptions options)

Detect anomalies for the entire series in batch.

Mono<Response<BinaryData>> detectUnivariateEntireSeriesWithResponse(BinaryData options, RequestOptions requestOptions)

Detect anomalies for the entire series in batch.

Mono<UnivariateLastDetectionResult> detectUnivariateLastPoint(UnivariateDetectionOptions options)

Detect anomaly status of the latest point in time series.

Mono<Response<BinaryData>> detectUnivariateLastPointWithResponse(BinaryData options, RequestOptions requestOptions)

Detect anomaly status of the latest point in time series.

Mono<MultivariateDetectionResult> getMultivariateBatchDetectionResult(String resultId)

Get Multivariate Anomaly Detection Result

Mono<Response<BinaryData>> getMultivariateBatchDetectionResultWithResponse(String resultId, RequestOptions requestOptions)

Get Multivariate Anomaly Detection Result

Mono<AnomalyDetectionModel> getMultivariateModel(String modelId)

Get Multivariate Model

Mono<Response<BinaryData>> getMultivariateModelWithResponse(String modelId, RequestOptions requestOptions)

Get Multivariate Model

PagedFlux<AnomalyDetectionModel> listMultivariateModels()

List Multivariate Models

PagedFlux<BinaryData> listMultivariateModels(RequestOptions requestOptions)

List Multivariate Models

Mono<AnomalyDetectionModel> trainMultivariateModel(ModelInfo modelInfo)

Train a Multivariate Anomaly Detection Model

Mono<Response<BinaryData>> trainMultivariateModelWithResponse(BinaryData modelInfo, RequestOptions requestOptions)

Train a Multivariate Anomaly Detection Model

Methods inherited from java.lang.Object

Method Details

deleteMultivariateModel

public Mono deleteMultivariateModel(String modelId)

Delete Multivariate Model

Delete an existing multivariate model according to the modelId.

Parameters:

modelId - Model identifier.

Returns:

A Mono that completes when a successful response is received.

deleteMultivariateModelWithResponse

public Mono> deleteMultivariateModelWithResponse(String modelId, RequestOptions requestOptions)

Delete Multivariate Model

Delete an existing multivariate model according to the modelId.

Parameters:

modelId - Model identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the Response<T> on successful completion of Mono.

detectMultivariateBatchAnomaly

public Mono detectMultivariateBatchAnomaly(String modelId, MultivariateBatchDetectionOptions options)

Detect Multivariate Anomaly

Submit multivariate anomaly detection task with the modelId of trained model and inference data, the input schema should be the same with the training request. The request will complete asynchronously and return a resultId to query the detection result.The request should be a source link to indicate an externally accessible Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob storage.

Parameters:

modelId - Model identifier.
options - Request of multivariate anomaly detection.

Returns:

detection results for the given resultId on successful completion of Mono.

detectMultivariateBatchAnomalyWithResponse

public Mono> detectMultivariateBatchAnomalyWithResponse(String modelId, BinaryData options, RequestOptions requestOptions)

Detect Multivariate Anomaly

Submit multivariate anomaly detection task with the modelId of trained model and inference data, the input schema should be the same with the training request. The request will complete asynchronously and return a resultId to query the detection result.The request should be a source link to indicate an externally accessible Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob storage.

Request Body Schema

{
     dataSource: String (Required)
     topContributorCount: int (Required)
     startTime: OffsetDateTime (Required)
     endTime: OffsetDateTime (Required)
 }

Response Body Schema

{
     resultId: String (Required)
     summary (Required): {
         status: String(CREATED/RUNNING/READY/FAILED) (Required)
         errors (Optional): [
              (Optional){
                 code: String (Required)
                 message: String (Required)
             }
         ]
         variableStates (Optional): [
              (Optional){
                 variable: String (Optional)
                 filledNARatio: Double (Optional)
                 effectiveCount: Integer (Optional)
                 firstTimestamp: OffsetDateTime (Optional)
                 lastTimestamp: OffsetDateTime (Optional)
             }
         ]
         setupInfo (Required): {
             dataSource: String (Required)
             topContributorCount: int (Required)
             startTime: OffsetDateTime (Required)
             endTime: OffsetDateTime (Required)
         }
     }
     results (Required): [
          (Required){
             timestamp: OffsetDateTime (Required)
             value (Optional): {
                 isAnomaly: boolean (Required)
                 severity: double (Required)
                 score: double (Required)
                 interpretation (Optional): [
                      (Optional){
                         variable: String (Optional)
                         contributionScore: Double (Optional)
                         correlationChanges (Optional): {
                             changedVariables (Optional): [
                                 String (Optional)
                             ]
                         }
                     }
                 ]
             }
             errors (Optional): [
                 (recursive schema, see above)
             ]
         }
     ]
 }

Parameters:

modelId - Model identifier.
options - Request of multivariate anomaly detection.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

detection results for the given resultId along with Response<T> on successful completion of Mono.

detectMultivariateLastAnomaly

public Mono detectMultivariateLastAnomaly(String modelId, MultivariateLastDetectionOptions options)

Detect anomalies in the last point of the request body

Submit multivariate anomaly detection task with the modelId of trained model and inference data, and the inference data should be put into request body in a JSON format. The request will complete synchronously and return the detection immediately in the response body.

Parameters:

modelId - Model identifier.
options - Request of last detection.

Returns:

results of last detection on successful completion of Mono.

detectMultivariateLastAnomalyWithResponse

public Mono> detectMultivariateLastAnomalyWithResponse(String modelId, BinaryData options, RequestOptions requestOptions)

Detect anomalies in the last point of the request body

Submit multivariate anomaly detection task with the modelId of trained model and inference data, and the inference data should be put into request body in a JSON format. The request will complete synchronously and return the detection immediately in the response body.

Request Body Schema

{
     variables (Required): [
          (Required){
             variable: String (Required)
             timestamps (Required): [
                 String (Required)
             ]
             values (Required): [
                 double (Required)
             ]
         }
     ]
     topContributorCount: int (Required)
 }

Response Body Schema

{
     variableStates (Optional): [
          (Optional){
             variable: String (Optional)
             filledNARatio: Double (Optional)
             effectiveCount: Integer (Optional)
             firstTimestamp: OffsetDateTime (Optional)
             lastTimestamp: OffsetDateTime (Optional)
         }
     ]
     results (Optional): [
          (Optional){
             timestamp: OffsetDateTime (Required)
             value (Optional): {
                 isAnomaly: boolean (Required)
                 severity: double (Required)
                 score: double (Required)
                 interpretation (Optional): [
                      (Optional){
                         variable: String (Optional)
                         contributionScore: Double (Optional)
                         correlationChanges (Optional): {
                             changedVariables (Optional): [
                                 String (Optional)
                             ]
                         }
                     }
                 ]
             }
             errors (Optional): [
                  (Optional){
                     code: String (Required)
                     message: String (Required)
                 }
             ]
         }
     ]
 }

Parameters:

modelId - Model identifier.
options - Request of last detection.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

results of last detection along with Response<T> on successful completion of Mono.

detectUnivariateChangePoint

public Mono detectUnivariateChangePoint(UnivariateChangePointDetectionOptions options)

Detect change point for the entire series

Evaluate change point score of every series point.

Parameters:

options - Method of univariate anomaly detection.

Returns:

the response of change point detection on successful completion of Mono.

detectUnivariateChangePointWithResponse

public Mono> detectUnivariateChangePointWithResponse(BinaryData options, RequestOptions requestOptions)

Detect change point for the entire series

Evaluate change point score of every series point.

Request Body Schema

{
     series (Required): [
          (Required){
             timestamp: OffsetDateTime (Optional)
             value: double (Required)
         }
     ]
     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Required)
     customInterval: Integer (Optional)
     period: Integer (Optional)
     stableTrendWindow: Integer (Optional)
     threshold: Double (Optional)
 }

Response Body Schema

{
     period: Integer (Optional)
     isChangePoint (Optional): [
         boolean (Optional)
     ]
     confidenceScores (Optional): [
         double (Optional)
     ]
 }

Parameters:

options - Method of univariate anomaly detection.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the response of change point detection along with Response<T> on successful completion of Mono.

detectUnivariateEntireSeries

public Mono detectUnivariateEntireSeries(UnivariateDetectionOptions options)

Detect anomalies for the entire series in batch.

This operation generates a model with an entire series, each point is detected with the same model. With this method, points before and after a certain point are used to determine whether it is an anomaly. The entire detection can give user an overall status of the time series.

Parameters:

options - Method of univariate anomaly detection.

Returns:

the response of entire anomaly detection on successful completion of Mono.

detectUnivariateEntireSeriesWithResponse

public Mono> detectUnivariateEntireSeriesWithResponse(BinaryData options, RequestOptions requestOptions)

Detect anomalies for the entire series in batch.

This operation generates a model with an entire series, each point is detected with the same model. With this method, points before and after a certain point are used to determine whether it is an anomaly. The entire detection can give user an overall status of the time series.

Request Body Schema

{
     series (Required): [
          (Required){
             timestamp: OffsetDateTime (Optional)
             value: double (Required)
         }
     ]
     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
     customInterval: Integer (Optional)
     period: Integer (Optional)
     maxAnomalyRatio: Double (Optional)
     sensitivity: Integer (Optional)
     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
     imputeFixedValue: Double (Optional)
 }

Response Body Schema

{
     period: int (Required)
     expectedValues (Required): [
         double (Required)
     ]
     upperMargins (Required): [
         double (Required)
     ]
     lowerMargins (Required): [
         double (Required)
     ]
     isAnomaly (Required): [
         boolean (Required)
     ]
     isNegativeAnomaly (Required): [
         boolean (Required)
     ]
     isPositiveAnomaly (Required): [
         boolean (Required)
     ]
     severity (Optional): [
         double (Optional)
     ]
 }

Parameters:

options - Method of univariate anomaly detection.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the response of entire anomaly detection along with Response<T> on successful completion of Mono.

detectUnivariateLastPoint

public Mono detectUnivariateLastPoint(UnivariateDetectionOptions options)

Detect anomaly status of the latest point in time series.

This operation generates a model using the points that you sent into the API, and based on all data to determine whether the last point is anomalous.

Parameters:

options - Method of univariate anomaly detection.

Returns:

the response of last anomaly detection on successful completion of Mono.

detectUnivariateLastPointWithResponse

public Mono> detectUnivariateLastPointWithResponse(BinaryData options, RequestOptions requestOptions)

Detect anomaly status of the latest point in time series.

This operation generates a model using the points that you sent into the API, and based on all data to determine whether the last point is anomalous.

Request Body Schema

{
     series (Required): [
          (Required){
             timestamp: OffsetDateTime (Optional)
             value: double (Required)
         }
     ]
     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
     customInterval: Integer (Optional)
     period: Integer (Optional)
     maxAnomalyRatio: Double (Optional)
     sensitivity: Integer (Optional)
     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
     imputeFixedValue: Double (Optional)
 }

Response Body Schema

{
     period: int (Required)
     suggestedWindow: int (Required)
     expectedValue: double (Required)
     upperMargin: double (Required)
     lowerMargin: double (Required)
     isAnomaly: boolean (Required)
     isNegativeAnomaly: boolean (Required)
     isPositiveAnomaly: boolean (Required)
     severity: Double (Optional)
 }

Parameters:

options - Method of univariate anomaly detection.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the response of last anomaly detection along with Response<T> on successful completion of Mono.

getMultivariateBatchDetectionResult

public Mono getMultivariateBatchDetectionResult(String resultId)

Get Multivariate Anomaly Detection Result

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

Parameters:

resultId - ID of a batch detection result.

Returns:

detection results for the given resultId on successful completion of Mono.

getMultivariateBatchDetectionResultWithResponse

public Mono> getMultivariateBatchDetectionResultWithResponse(String resultId, RequestOptions requestOptions)

Get Multivariate Anomaly Detection Result

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

Response Body Schema

{
     resultId: String (Required)
     summary (Required): {
         status: String(CREATED/RUNNING/READY/FAILED) (Required)
         errors (Optional): [
              (Optional){
                 code: String (Required)
                 message: String (Required)
             }
         ]
         variableStates (Optional): [
              (Optional){
                 variable: String (Optional)
                 filledNARatio: Double (Optional)
                 effectiveCount: Integer (Optional)
                 firstTimestamp: OffsetDateTime (Optional)
                 lastTimestamp: OffsetDateTime (Optional)
             }
         ]
         setupInfo (Required): {
             dataSource: String (Required)
             topContributorCount: int (Required)
             startTime: OffsetDateTime (Required)
             endTime: OffsetDateTime (Required)
         }
     }
     results (Required): [
          (Required){
             timestamp: OffsetDateTime (Required)
             value (Optional): {
                 isAnomaly: boolean (Required)
                 severity: double (Required)
                 score: double (Required)
                 interpretation (Optional): [
                      (Optional){
                         variable: String (Optional)
                         contributionScore: Double (Optional)
                         correlationChanges (Optional): {
                             changedVariables (Optional): [
                                 String (Optional)
                             ]
                         }
                     }
                 ]
             }
             errors (Optional): [
                 (recursive schema, see above)
             ]
         }
     ]
 }

Parameters:

resultId - ID of a batch detection result.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

detection results for the given resultId along with Response<T> on successful completion of Mono.

getMultivariateModel

public Mono getMultivariateModel(String modelId)

Get Multivariate Model

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

Parameters:

modelId - Model identifier.

Returns:

detailed information of multivariate model, including the training status and variables used in the model on successful completion of Mono.

getMultivariateModelWithResponse

public Mono> getMultivariateModelWithResponse(String modelId, RequestOptions requestOptions)

Get Multivariate Model

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

Response Body Schema

{
     modelId: String (Required)
     createdTime: OffsetDateTime (Required)
     lastUpdatedTime: OffsetDateTime (Required)
     modelInfo (Optional): {
         dataSource: String (Required)
         dataSchema: String(OneTable/MultiTable) (Optional)
         startTime: OffsetDateTime (Required)
         endTime: OffsetDateTime (Required)
         displayName: String (Optional)
         slidingWindow: Integer (Optional)
         alignPolicy (Optional): {
             alignMode: String(Inner/Outer) (Optional)
             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
             paddingValue: Double (Optional)
         }
         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
         errors (Optional): [
              (Optional){
                 code: String (Required)
                 message: String (Required)
             }
         ]
         diagnosticsInfo (Optional): {
             modelState (Optional): {
                 epochIds (Optional): [
                     int (Optional)
                 ]
                 trainLosses (Optional): [
                     double (Optional)
                 ]
                 validationLosses (Optional): [
                     double (Optional)
                 ]
                 latenciesInSeconds (Optional): [
                     double (Optional)
                 ]
             }
             variableStates (Optional): [
                  (Optional){
                     variable: String (Optional)
                     filledNARatio: Double (Optional)
                     effectiveCount: Integer (Optional)
                     firstTimestamp: OffsetDateTime (Optional)
                     lastTimestamp: OffsetDateTime (Optional)
                 }
             ]
         }
     }
 }

Parameters:

modelId - Model identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

detailed information of multivariate model, including the training status and variables used in the model along with Response<T> on successful completion of Mono.

listMultivariateModels

public PagedFlux listMultivariateModels()

List Multivariate Models

List models of a resource.

Returns:

response of listing models as paginated response with PagedFlux<T>.

listMultivariateModels

public PagedFlux listMultivariateModels(RequestOptions requestOptions)

List Multivariate Models

List models of a resource.

Query Parameters

| ---- | ------- | -------- | ----------------------------------------------- |
| Name | Type    | Required | Description                                     |
| skip | Integer | No       | Skip indicates how many models will be skipped. |
| top  | Integer | No       | Top indicates how many models will be fetched.  |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     modelId: String (Required)
     createdTime: OffsetDateTime (Required)
     lastUpdatedTime: OffsetDateTime (Required)
     modelInfo (Optional): {
         dataSource: String (Required)
         dataSchema: String(OneTable/MultiTable) (Optional)
         startTime: OffsetDateTime (Required)
         endTime: OffsetDateTime (Required)
         displayName: String (Optional)
         slidingWindow: Integer (Optional)
         alignPolicy (Optional): {
             alignMode: String(Inner/Outer) (Optional)
             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
             paddingValue: Double (Optional)
         }
         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
         errors (Optional): [
              (Optional){
                 code: String (Required)
                 message: String (Required)
             }
         ]
         diagnosticsInfo (Optional): {
             modelState (Optional): {
                 epochIds (Optional): [
                     int (Optional)
                 ]
                 trainLosses (Optional): [
                     double (Optional)
                 ]
                 validationLosses (Optional): [
                     double (Optional)
                 ]
                 latenciesInSeconds (Optional): [
                     double (Optional)
                 ]
             }
             variableStates (Optional): [
                  (Optional){
                     variable: String (Optional)
                     filledNARatio: Double (Optional)
                     effectiveCount: Integer (Optional)
                     firstTimestamp: OffsetDateTime (Optional)
                     lastTimestamp: OffsetDateTime (Optional)
                 }
             ]
         }
     }
 }

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

response of listing models as paginated response with PagedFlux<T>.

trainMultivariateModel

public Mono trainMultivariateModel(ModelInfo modelInfo)

Train a Multivariate Anomaly Detection Model

Create and train a multivariate anomaly detection model. The request must include a source parameter to indicate an externally accessible Azure blob storage URI.There are two types of data input: An URI pointed to an Azure blob storage folder which contains multiple CSV files, and each CSV file contains two columns, timestamp and variable. Another type of input is an URI pointed to a CSV file in Azure blob storage, which contains all the variables and a timestamp column.

Parameters:

modelInfo - Model information.

Returns:

response of getting a model on successful completion of Mono.

trainMultivariateModelWithResponse

public Mono> trainMultivariateModelWithResponse(BinaryData modelInfo, RequestOptions requestOptions)

Train a Multivariate Anomaly Detection Model

Create and train a multivariate anomaly detection model. The request must include a source parameter to indicate an externally accessible Azure blob storage URI.There are two types of data input: An URI pointed to an Azure blob storage folder which contains multiple CSV files, and each CSV file contains two columns, timestamp and variable. Another type of input is an URI pointed to a CSV file in Azure blob storage, which contains all the variables and a timestamp column.

Request Body Schema

{
     dataSource: String (Required)
     dataSchema: String(OneTable/MultiTable) (Optional)
     startTime: OffsetDateTime (Required)
     endTime: OffsetDateTime (Required)
     displayName: String (Optional)
     slidingWindow: Integer (Optional)
     alignPolicy (Optional): {
         alignMode: String(Inner/Outer) (Optional)
         fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
         paddingValue: Double (Optional)
     }
     status: String(CREATED/RUNNING/READY/FAILED) (Optional)
     errors (Optional): [
          (Optional){
             code: String (Required)
             message: String (Required)
         }
     ]
     diagnosticsInfo (Optional): {
         modelState (Optional): {
             epochIds (Optional): [
                 int (Optional)
             ]
             trainLosses (Optional): [
                 double (Optional)
             ]
             validationLosses (Optional): [
                 double (Optional)
             ]
             latenciesInSeconds (Optional): [
                 double (Optional)
             ]
         }
         variableStates (Optional): [
              (Optional){
                 variable: String (Optional)
                 filledNARatio: Double (Optional)
                 effectiveCount: Integer (Optional)
                 firstTimestamp: OffsetDateTime (Optional)
                 lastTimestamp: OffsetDateTime (Optional)
             }
         ]
     }
 }

Response Body Schema

{
     modelId: String (Required)
     createdTime: OffsetDateTime (Required)
     lastUpdatedTime: OffsetDateTime (Required)
     modelInfo (Optional): {
         dataSource: String (Required)
         dataSchema: String(OneTable/MultiTable) (Optional)
         startTime: OffsetDateTime (Required)
         endTime: OffsetDateTime (Required)
         displayName: String (Optional)
         slidingWindow: Integer (Optional)
         alignPolicy (Optional): {
             alignMode: String(Inner/Outer) (Optional)
             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
             paddingValue: Double (Optional)
         }
         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
         errors (Optional): [
              (Optional){
                 code: String (Required)
                 message: String (Required)
             }
         ]
         diagnosticsInfo (Optional): {
             modelState (Optional): {
                 epochIds (Optional): [
                     int (Optional)
                 ]
                 trainLosses (Optional): [
                     double (Optional)
                 ]
                 validationLosses (Optional): [
                     double (Optional)
                 ]
                 latenciesInSeconds (Optional): [
                     double (Optional)
                 ]
             }
             variableStates (Optional): [
                  (Optional){
                     variable: String (Optional)
                     filledNARatio: Double (Optional)
                     effectiveCount: Integer (Optional)
                     firstTimestamp: OffsetDateTime (Optional)
                     lastTimestamp: OffsetDateTime (Optional)
                 }
             ]
         }
     }
 }

Parameters:

modelInfo - Model information.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

response of getting a model along with Response<T> on successful completion of Mono.

Applies to