AnomalyDetectorClient Class
- java.
lang. Object - com.
azure. ai. anomalydetector. AnomalyDetectorClient
- com.
public final class AnomalyDetectorClient
Initializes a new instance of the synchronous AnomalyDetectorClient type.
Method Summary
Methods inherited from java.lang.Object
Method Details
deleteMultivariateModel
public void deleteMultivariateModel(String modelId)
Delete Multivariate Model
Delete an existing multivariate model according to the modelId.
Parameters:
deleteMultivariateModelWithResponse
public Response
Delete Multivariate Model
Delete an existing multivariate model according to the modelId.
Parameters:
Returns:
detectMultivariateBatchAnomaly
public MultivariateDetectionResult 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:
Returns:
detectMultivariateBatchAnomalyWithResponse
public Response
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:
Returns:
detectMultivariateLastAnomaly
public MultivariateLastDetectionResult 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:
Returns:
detectMultivariateLastAnomalyWithResponse
public Response
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:
Returns:
detectUnivariateChangePoint
public UnivariateChangePointDetectionResult detectUnivariateChangePoint(UnivariateChangePointDetectionOptions options)
Detect change point for the entire series
Evaluate change point score of every series point.
Parameters:
Returns:
detectUnivariateChangePointWithResponse
public Response
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:
Returns:
detectUnivariateEntireSeries
public UnivariateEntireDetectionResult 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:
Returns:
detectUnivariateEntireSeriesWithResponse
public Response
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:
Returns:
detectUnivariateLastPoint
public UnivariateLastDetectionResult 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:
Returns:
detectUnivariateLastPointWithResponse
public Response
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:
Returns:
getMultivariateBatchDetectionResult
public MultivariateDetectionResult 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:
Returns:
getMultivariateBatchDetectionResultWithResponse
public Response
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:
Returns:
getMultivariateModel
public AnomalyDetectionModel getMultivariateModel(String modelId)
Get Multivariate Model
Get detailed information of multivariate model, including the training status and variables used in the model.
Parameters:
Returns:
getMultivariateModelWithResponse
public Response
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:
Returns:
listMultivariateModels
public PagedIterable
List Multivariate Models
List models of a resource.
Returns:
listMultivariateModels
public PagedIterable
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:
Returns:
trainMultivariateModel
public AnomalyDetectionModel 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:
Returns:
trainMultivariateModelWithResponse
public Response
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:
Returns: