Package com.azure.ai.anomalydetector
Class AnomalyDetectorClient
java.lang.Object
com.azure.ai.anomalydetector.AnomalyDetectorClient
Initializes a new instance of the synchronous AnomalyDetectorClient type.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteMultivariateModel
(UUID modelId) Delete an existing multivariate model according to the modelId.deleteMultivariateModelWithResponse
(UUID modelId, Context context) Delete an existing multivariate model according to the modelId.void
detectAnomaly
(UUID modelId, DetectionRequest body) Submit detection multivariate anomaly task with the trained model of modelId, the input schema should be the same with the training request.detectAnomalyWithResponse
(UUID modelId, DetectionRequest body, Context context) Submit detection multivariate anomaly task with the trained model of modelId, the input schema should be the same with the training request.Evaluate change point score of every series point.detectChangePointWithResponse
(ChangePointDetectRequest body, Context context) Evaluate change point score of every series point.This operation generates a model with an entire series, each point is detected with the same model.detectEntireSeriesWithResponse
(DetectRequest body, Context context) This operation generates a model with an entire series, each point is detected with the same model.detectLastPoint
(DetectRequest body) This operation generates a model using the data points that you sent to the API, and based on all data to determine whether the last point is anomalous.detectLastPointWithResponse
(DetectRequest body, Context context) This operation generates a model using the data points that you sent to the API, and based on all data to determine whether the last point is anomalous.exportModel
(UUID modelId) Export multivariate anomaly detection model based on modelId.exportModelWithResponse
(UUID modelId, Context context) Export multivariate anomaly detection model based on modelId.getDetectionResult
(UUID resultId) Get multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.getDetectionResultWithResponse
(UUID resultId, Context context) Get multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.getMultivariateModel
(UUID modelId) Get detailed information of multivariate model, including the training status and variables used in the model.getMultivariateModelWithResponse
(UUID modelId, Context context) Get detailed information of multivariate model, including the training status and variables used in the model.lastDetectAnomaly
(UUID modelId, LastDetectionRequest body) Synchronized API for anomaly detection.lastDetectAnomalyWithResponse
(UUID modelId, LastDetectionRequest body, Context context) Synchronized API for anomaly detection.listMultivariateModel
(Integer skip, Integer top) List models of a subscription.listMultivariateModel
(Integer skip, Integer top, Context context) List models of a subscription.void
Create and train a multivariate anomaly detection model.trainMultivariateModelWithResponse
(ModelInfo body, Context context) Create and train a multivariate anomaly detection model.
-
Method Details
-
detectEntireSeries
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:
body
- Time series points and period if needed. Advanced model parameters can also be set in the request.- Returns:
- the response of entire anomaly detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectEntireSeriesWithResponse
public Response<EntireDetectResponse> detectEntireSeriesWithResponse(DetectRequest body, Context context) 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:
body
- Time series points and period if needed. Advanced model parameters can also be set in the request.context
- The context to associate with this operation.- Returns:
- the response of entire anomaly detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectLastPoint
This operation generates a model using the data points that you sent to the API, and based on all data to determine whether the last point is anomalous. The latest point detecting operation matches the scenario of real-time monitoring of business metrics.- Parameters:
body
- Time series points and period if needed. Advanced model parameters can also be set in the request.- Returns:
- the response of last anomaly detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectLastPointWithResponse
public Response<LastDetectResponse> detectLastPointWithResponse(DetectRequest body, Context context) This operation generates a model using the data points that you sent to the API, and based on all data to determine whether the last point is anomalous. The latest point detecting operation matches the scenario of real-time monitoring of business metrics.- Parameters:
body
- Time series points and period if needed. Advanced model parameters can also be set in the request.context
- The context to associate with this operation.- Returns:
- the response of last anomaly detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectChangePoint
Evaluate change point score of every series point.- Parameters:
body
- Time series points and granularity is needed. Advanced model parameters can also be set in the request if needed.- Returns:
- the response of change point detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectChangePointWithResponse
public Response<ChangePointDetectResponse> detectChangePointWithResponse(ChangePointDetectRequest body, Context context) Evaluate change point score of every series point.- Parameters:
body
- Time series points and granularity is needed. Advanced model parameters can also be set in the request if needed.context
- The context to associate with this operation.- Returns:
- the response of change point detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
trainMultivariateModel
Create and train a multivariate anomaly detection model. The request must include a source parameter to indicate an externally accessible Azure storage Uri (preferably a Shared Access Signature Uri). All time-series used in generate the model must be zipped into one single file. Each time-series will be in a single CSV file in which the first column is timestamp and the second column is value.- Parameters:
body
- Training request.- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
trainMultivariateModelWithResponse
public TrainMultivariateModelResponse trainMultivariateModelWithResponse(ModelInfo body, Context context) Create and train a multivariate anomaly detection model. The request must include a source parameter to indicate an externally accessible Azure storage Uri (preferably a Shared Access Signature Uri). All time-series used in generate the model must be zipped into one single file. Each time-series will be in a single CSV file in which the first column is timestamp and the second column is value.- Parameters:
body
- Training request.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
listMultivariateModel
List models of a subscription.- Parameters:
skip
- $skip indicates how many models will be skipped.top
- $top indicates how many models will be fetched.- Returns:
- response of listing models.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
listMultivariateModel
public PagedIterable<ModelSnapshot> listMultivariateModel(Integer skip, Integer top, Context context) List models of a subscription.- Parameters:
skip
- $skip indicates how many models will be skipped.top
- $top indicates how many models will be fetched.context
- The context to associate with this operation.- Returns:
- response of listing models.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getMultivariateModel
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.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getMultivariateModelWithResponse
Get detailed information of multivariate model, including the training status and variables used in the model.- Parameters:
modelId
- Model identifier.context
- The context to associate with this operation.- Returns:
- detailed information of multivariate model, including the training status and variables used in the model.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
deleteMultivariateModel
Delete an existing multivariate model according to the modelId.- Parameters:
modelId
- Model identifier.- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
deleteMultivariateModelWithResponse
Delete an existing multivariate model according to the modelId.- Parameters:
modelId
- Model identifier.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectAnomaly
Submit detection multivariate anomaly task with the trained model of modelId, the input schema should be the same with the training request. Thus request will be complete asynchronously and will return a resultId for querying the detection result.The request should be a source link to indicate an externally accessible Azure storage Uri (preferably a Shared Access Signature Uri). All time-series used in generate the model must be zipped into one single file. Each time-series will be as follows: the first column is timestamp and the second column is value.- Parameters:
modelId
- Model identifier.body
- Detect anomaly request.- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectAnomalyWithResponse
public DetectAnomalyResponse detectAnomalyWithResponse(UUID modelId, DetectionRequest body, Context context) Submit detection multivariate anomaly task with the trained model of modelId, the input schema should be the same with the training request. Thus request will be complete asynchronously and will return a resultId for querying the detection result.The request should be a source link to indicate an externally accessible Azure storage Uri (preferably a Shared Access Signature Uri). All time-series used in generate the model must be zipped into one single file. Each time-series will be as follows: the first column is timestamp and the second column is value.- Parameters:
modelId
- Model identifier.body
- Detect anomaly request.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getDetectionResult
Get multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.- Parameters:
resultId
- Result identifier.- Returns:
- multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getDetectionResultWithResponse
Get multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.- Parameters:
resultId
- Result identifier.context
- The context to associate with this operation.- Returns:
- multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
exportModel
Export multivariate anomaly detection model based on modelId.- Parameters:
modelId
- Model identifier.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
exportModelWithResponse
Export multivariate anomaly detection model based on modelId.- Parameters:
modelId
- Model identifier.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
lastDetectAnomaly
Synchronized API for anomaly detection.- Parameters:
modelId
- Model identifier.body
- Request for last detection.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
lastDetectAnomalyWithResponse
public Response<LastDetectionResult> lastDetectAnomalyWithResponse(UUID modelId, LastDetectionRequest body, Context context) Synchronized API for anomaly detection.- Parameters:
modelId
- Model identifier.body
- Request for last detection.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-