[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-1c2c595d-8f66-4043-a384-9936d3f75399":3,"$fHyFVi2A2f5pUPWNhdruqrI1swDat8VYQcOCZDiOcRl0":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"1c2c595d-8f66-4043-a384-9936d3f75399","azure-ai-anomalydetector-java","使用Azure AI Anomaly Detector SDK for Java构建异常检测应用程序。在实现单变量\u002F多变量异常检测、时间序列分析或AI监控时使用。","cat_coding_devops","mod_coding","sickn33,coding","---\nname: azure-ai-anomalydetector-java\ndescription: \"Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate\u002Fmultivariate anomaly detection, time-series analysis, or AI-powered monitoring.\"\nrisk: unknown\nsource: community\ndate_added: \"2026-02-27\"\n---\n\n# Azure AI Anomaly Detector SDK for Java\n\nBuild anomaly detection applications using the Azure AI Anomaly Detector SDK for Java.\n\n## Installation\n\n```xml\n\u003Cdependency>\n  \u003CgroupId>com.azure\u003C\u002FgroupId>\n  \u003CartifactId>azure-ai-anomalydetector\u003C\u002FartifactId>\n  \u003Cversion>3.0.0-beta.6\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\n## Client Creation\n\n### Sync and Async Clients\n\n```java\nimport com.azure.ai.anomalydetector.AnomalyDetectorClientBuilder;\nimport com.azure.ai.anomalydetector.MultivariateClient;\nimport com.azure.ai.anomalydetector.UnivariateClient;\nimport com.azure.core.credential.AzureKeyCredential;\n\nString endpoint = System.getenv(\"AZURE_ANOMALY_DETECTOR_ENDPOINT\");\nString key = System.getenv(\"AZURE_ANOMALY_DETECTOR_API_KEY\");\n\n\u002F\u002F Multivariate client for multiple correlated signals\nMultivariateClient multivariateClient = new AnomalyDetectorClientBuilder()\n    .credential(new AzureKeyCredential(key))\n    .endpoint(endpoint)\n    .buildMultivariateClient();\n\n\u002F\u002F Univariate client for single variable analysis\nUnivariateClient univariateClient = new AnomalyDetectorClientBuilder()\n    .credential(new AzureKeyCredential(key))\n    .endpoint(endpoint)\n    .buildUnivariateClient();\n```\n\n### With DefaultAzureCredential\n\n```java\nimport com.azure.identity.DefaultAzureCredentialBuilder;\n\nMultivariateClient client = new AnomalyDetectorClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .endpoint(endpoint)\n    .buildMultivariateClient();\n```\n\n## Key Concepts\n\n### Univariate Anomaly Detection\n- **Batch Detection**: Analyze entire time series at once\n- **Streaming Detection**: Real-time detection on latest data point\n- **Change Point Detection**: Detect trend changes in time series\n\n### Multivariate Anomaly Detection\n- Detect anomalies across 300+ correlated signals\n- Uses Graph Attention Network for inter-correlations\n- Three-step process: Train → Inference → Results\n\n## Core Patterns\n\n### Univariate Batch Detection\n\n```java\nimport com.azure.ai.anomalydetector.models.*;\nimport java.time.OffsetDateTime;\nimport java.util.List;\n\nList\u003CTimeSeriesPoint> series = List.of(\n    new TimeSeriesPoint(OffsetDateTime.parse(\"2023-01-01T00:00:00Z\"), 1.0),\n    new TimeSeriesPoint(OffsetDateTime.parse(\"2023-01-02T00:00:00Z\"), 2.5),\n    \u002F\u002F ... more data points (minimum 12 points required)\n);\n\nUnivariateDetectionOptions options = new UnivariateDetectionOptions(series)\n    .setGranularity(TimeGranularity.DAILY)\n    .setSensitivity(95);\n\nUnivariateEntireDetectionResult result = univariateClient.detectUnivariateEntireSeries(options);\n\n\u002F\u002F Check for anomalies\nfor (int i = 0; i \u003C result.getIsAnomaly().size(); i++) {\n    if (result.getIsAnomaly().get(i)) {\n        System.out.printf(\"Anomaly detected at index %d with value %.2f%n\",\n            i, series.get(i).getValue());\n    }\n}\n```\n\n### Univariate Last Point Detection (Streaming)\n\n```java\nUnivariateLastDetectionResult lastResult = univariateClient.detectUnivariateLastPoint(options);\n\nif (lastResult.isAnomaly()) {\n    System.out.println(\"Latest point is an anomaly!\");\n    System.out.printf(\"Expected: %.2f, Upper: %.2f, Lower: %.2f%n\",\n        lastResult.getExpectedValue(),\n        lastResult.getUpperMargin(),\n        lastResult.getLowerMargin());\n}\n```\n\n### Change Point Detection\n\n```java\nUnivariateChangePointDetectionOptions changeOptions = \n    new UnivariateChangePointDetectionOptions(series, TimeGranularity.DAILY);\n\nUnivariateChangePointDetectionResult changeResult = \n    univariateClient.detectUnivariateChangePoint(changeOptions);\n\nfor (int i = 0; i \u003C changeResult.getIsChangePoint().size(); i++) {\n    if (changeResult.getIsChangePoint().get(i)) {\n        System.out.printf(\"Change point at index %d with confidence %.2f%n\",\n            i, changeResult.getConfidenceScores().get(i));\n    }\n}\n```\n\n### Multivariate Model Training\n\n```java\nimport com.azure.ai.anomalydetector.models.*;\nimport com.azure.core.util.polling.SyncPoller;\n\n\u002F\u002F Prepare training request with blob storage data\nModelInfo modelInfo = new ModelInfo()\n    .setDataSource(\"https:\u002F\u002Fstorage.blob.core.windows.net\u002Fcontainer\u002Fdata.zip?sasToken\")\n    .setStartTime(OffsetDateTime.parse(\"2023-01-01T00:00:00Z\"))\n    .setEndTime(OffsetDateTime.parse(\"2023-06-01T00:00:00Z\"))\n    .setSlidingWindow(200)\n    .setDisplayName(\"MyMultivariateModel\");\n\n\u002F\u002F Train model (long-running operation)\nAnomalyDetectionModel trainedModel = multivariateClient.trainMultivariateModel(modelInfo);\n\nString modelId = trainedModel.getModelId();\nSystem.out.println(\"Model ID: \" + modelId);\n\n\u002F\u002F Check training status\nAnomalyDetectionModel model = multivariateClient.getMultivariateModel(modelId);\nSystem.out.println(\"Status: \" + model.getModelInfo().getStatus());\n```\n\n### Multivariate Batch Inference\n\n```java\nMultivariateBatchDetectionOptions detectionOptions = new MultivariateBatchDetectionOptions()\n    .setDataSource(\"https:\u002F\u002Fstorage.blob.core.windows.net\u002Fcontainer\u002Finference-data.zip?sasToken\")\n    .setStartTime(OffsetDateTime.parse(\"2023-07-01T00:00:00Z\"))\n    .setEndTime(OffsetDateTime.parse(\"2023-07-31T00:00:00Z\"))\n    .setTopContributorCount(10);\n\nMultivariateDetectionResult detectionResult = \n    multivariateClient.detectMultivariateBatchAnomaly(modelId, detectionOptions);\n\nString resultId = detectionResult.getResultId();\n\n\u002F\u002F Poll for results\nMultivariateDetectionResult result = multivariateClient.getBatchDetectionResult(resultId);\nfor (AnomalyState state : result.getResults()) {\n    if (state.getValue().isAnomaly()) {\n        System.out.printf(\"Anomaly at %s, severity: %.2f%n\",\n            state.getTimestamp(),\n            state.getValue().getSeverity());\n    }\n}\n```\n\n### Multivariate Last Point Detection\n\n```java\nMultivariateLastDetectionOptions lastOptions = new MultivariateLastDetectionOptions()\n    .setVariables(List.of(\n        new VariableValues(\"variable1\", List.of(\"timestamp1\"), List.of(1.0f)),\n        new VariableValues(\"variable2\", List.of(\"timestamp1\"), List.of(2.5f))\n    ))\n    .setTopContributorCount(5);\n\nMultivariateLastDetectionResult lastResult = \n    multivariateClient.detectMultivariateLastAnomaly(modelId, lastOptions);\n\nif (lastResult.getValue().isAnomaly()) {\n    System.out.println(\"Anomaly detected!\");\n    \u002F\u002F Check contributing variables\n    for (AnomalyContributor contributor : lastResult.getValue().getInterpretation()) {\n        System.out.printf(\"Variable: %s, Contribution: %.2f%n\",\n            contributor.getVariable(),\n            contributor.getContributionScore());\n    }\n}\n```\n\n### Model Management\n\n```java\n\u002F\u002F List all models\nPagedIterable\u003CAnomalyDetectionModel> models = multivariateClient.listMultivariateModels();\nfor (AnomalyDetectionModel m : models) {\n    System.out.printf(\"Model: %s, Status: %s%n\",\n        m.getModelId(),\n        m.getModelInfo().getStatus());\n}\n\n\u002F\u002F Delete a model\nmultivariateClient.deleteMultivariateModel(modelId);\n```\n\n## Error Handling\n\n```java\nimport com.azure.core.exception.HttpResponseException;\n\ntry {\n    univariateClient.detectUnivariateEntireSeries(options);\n} catch (HttpResponseException e) {\n    System.out.println(\"Status code: \" + e.getResponse().getStatusCode());\n    System.out.println(\"Error: \" + e.getMessage());\n}\n```\n\n## Environment Variables\n\n```bash\nAZURE_ANOMALY_DETECTOR_ENDPOINT=https:\u002F\u002F\u003Cresource>.cognitiveservices.azure.com\u002F\nAZURE_ANOMALY_DETECTOR_API_KEY=\u003Cyour-api-key>\n```\n\n## Best Practices\n\n1. **Minimum Data Points**: Univariate requires at least 12 points; more data improves accuracy\n2. **Granularity Alignment**: Match `TimeGranularity` to your actual data frequency\n3. **Sensitivity Tuning**: Higher values (0-99) detect more anomalies\n4. **Multivariate Training**: Use 200-1000 sliding window based on pattern complexity\n5. **Error Handling**: Always handle `HttpResponseException` for API errors\n\n## Trigger Phrases\n\n- \"anomaly detection Java\"\n- \"detect anomalies time series\"\n- \"multivariate anomaly Java\"\n- \"univariate anomaly detection\"\n- \"streaming anomaly detection\"\n- \"change point detection\"\n- \"Azure AI Anomaly Detector\"\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,146,1837,"2026-05-16 13:05:05",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"e546d20c-b5b9-468a-963f-2df44d6b1186","1.0.0","azure-ai-anomalydetector-java.zip",2891,"uploads\u002Fskills\u002F1c2c595d-8f66-4043-a384-9936d3f75399\u002Fazure-ai-anomalydetector-java.zip","a79c890451e8fda7e9039c580b5ee36bd9f793a665ff633f92aef05015f35447","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":8731}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]