diff --git a/specification/cognitiveservices/AnomalyDetector/cadl-project.yaml b/specification/cognitiveservices/AnomalyDetector/cadl-project.yaml new file mode 100644 index 000000000000..6846bae39980 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/cadl-project.yaml @@ -0,0 +1,39 @@ +parameters: + "python-sdk-folder": + default: "{cwd}/azure-sdk-for-python/" + "java-sdk-folder": + default: "{cwd}/azure-sdk-for-java/" + "js-sdk-folder": + default: "{cwd}/azure-sdk-for-js/" + "csharp-sdk-folder": + default: "{cwd}/azure-sdk-for-net/" + "service-directory-name": + default: "anomalydetector" +emit: + - "@azure-tools/cadl-autorest" + +options: + "@azure-tools/cadl-autorest": + "output-file": "openapi.json" + "examples-directory": ./examples + azure-resource-provider-folder: ../../../../data-plane + "yyc-test": + "package-mode": "dataplane" + "package-name": "azure-ai-anomalydetector" + "emitter-output-dir": "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" + "@azure-tools/cadl-csharp": + namespace: Azure.AI.AnomalyDetector + clear-output-folder: true + model-namespace: false + "emitter-output-dir": "{csharp-sdk-folder}/sdk/{service-directory-name}/{namespace}/src" + "@azure-tools/cadl-typescript": + "emitter-output-dir": "{js-sdk-folder}/sdk/{service-directory-name}/ai-anomaly-detector-rest" + generateMetadata: true + generateTest: true + azureSdkForJs: true + packageDetails: + name: "@azure-rest/ai-anomaly-detector" + description: "A generated SDK for AnomalyDetectorRest." + "@azure-tools/cadl-java": + "emitter-output-dir": "{java-sdk-folder}/sdk/{service-directory-name}/azure-ai-anomalydetector" + namespace: com.azure.ai.anomalydetector diff --git a/specification/cognitiveservices/AnomalyDetector/client.cadl b/specification/cognitiveservices/AnomalyDetector/client.cadl new file mode 100644 index 000000000000..0db812a98b05 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/client.cadl @@ -0,0 +1,17 @@ +import "@azure-tools/cadl-dpg"; +import "./main.cadl"; + +using Azure.DPG; + +@@convenienceAPI(AnomalyDetector.Multivariate.GetMultivariateBatchDetectionResult +); +@@convenienceAPI(AnomalyDetector.Multivariate.TrainMultivariateModel); +@@convenienceAPI(AnomalyDetector.Multivariate.ListMultivariateModels); +@@convenienceAPI(AnomalyDetector.Multivariate.DeleteMultivariateModel); +@@convenienceAPI(AnomalyDetector.Multivariate.GetMultivariateModel); +@@convenienceAPI(AnomalyDetector.Multivariate.DetectMultivariateBatchAnomaly); +@@convenienceAPI(AnomalyDetector.Multivariate.DetectMultivariateLastAnomaly); + +@@convenienceAPI(AnomalyDetector.Univariate.DetectUnivariateEntireSeries); +@@convenienceAPI(AnomalyDetector.Univariate.DetectUnivariateLastPoint); +@@convenienceAPI(AnomalyDetector.Univariate.DetectUnivariateChangePoint); diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/ChangePointDetect.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/ChangePointDetect.json new file mode 100644 index 000000000000..961b008f896a --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/ChangePointDetect.json @@ -0,0 +1,1572 @@ +{ + "operationId": "Univariate_DetectUnivariateChangePoint", + "title": "Univariate detection of a change point", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "series": [ + { + "timestamp": "2017-01-01T06:45:00Z", + "value": 1639196 + }, + { + "timestamp": "2017-01-01T06:50:00Z", + "value": 1639290 + }, + { + "timestamp": "2017-01-01T06:55:00Z", + "value": 1667293 + }, + { + "timestamp": "2017-01-01T07:00:00Z", + "value": 1703130 + }, + { + "timestamp": "2017-01-01T07:05:00Z", + "value": 1650912 + }, + { + "timestamp": "2017-01-01T07:10:00Z", + "value": 1653596 + }, + { + "timestamp": "2017-01-01T07:15:00Z", + "value": 1653793 + }, + { + "timestamp": "2017-01-01T07:20:00Z", + "value": 1653795 + }, + { + "timestamp": "2017-01-01T07:25:00Z", + "value": 1663471 + }, + { + "timestamp": "2017-01-01T07:30:00Z", + "value": 1662358 + }, + { + "timestamp": "2017-01-01T07:35:00Z", + "value": 1664320 + }, + { + "timestamp": "2017-01-01T07:40:00Z", + "value": 1664942 + }, + { + "timestamp": "2017-01-01T07:45:00Z", + "value": 1664966 + }, + { + "timestamp": "2017-01-01T07:50:00Z", + "value": 1724271 + }, + { + "timestamp": "2017-01-01T07:55:00Z", + "value": 1678720 + }, + { + "timestamp": "2017-01-01T08:00:00Z", + "value": 1672536 + }, + { + "timestamp": "2017-01-01T08:05:00Z", + "value": 1672544 + }, + { + "timestamp": "2017-01-01T08:10:00Z", + "value": 1672364 + }, + { + "timestamp": "2017-01-01T08:15:00Z", + "value": 1672912 + }, + { + "timestamp": "2017-01-01T08:20:00Z", + "value": 1672736 + }, + { + "timestamp": "2017-01-01T08:25:00Z", + "value": 1672725 + }, + { + "timestamp": "2017-01-01T08:30:00Z", + "value": 1673247 + }, + { + "timestamp": "2017-01-01T08:35:00Z", + "value": 1673109 + }, + { + "timestamp": "2017-01-01T08:40:00Z", + "value": 1690088 + }, + { + "timestamp": "2017-01-01T08:45:00Z", + "value": 1703865 + }, + { + "timestamp": "2017-01-01T08:50:00Z", + "value": 1703865 + }, + { + "timestamp": "2017-01-01T08:55:00Z", + "value": 1786581 + }, + { + "timestamp": "2017-01-01T09:00:00Z", + "value": 1800945 + }, + { + "timestamp": "2017-01-01T09:05:00Z", + "value": 1800957 + }, + { + "timestamp": "2017-01-01T09:10:00Z", + "value": 1801191 + }, + { + "timestamp": "2017-01-01T09:15:00Z", + "value": 1801412 + }, + { + "timestamp": "2017-01-01T09:20:00Z", + "value": 1801621 + }, + { + "timestamp": "2017-01-01T09:25:00Z", + "value": 1801621 + }, + { + "timestamp": "2017-01-01T09:30:00Z", + "value": 1801654 + }, + { + "timestamp": "2017-01-01T09:35:00Z", + "value": 1802105 + }, + { + "timestamp": "2017-01-01T09:40:00Z", + "value": 1801800 + }, + { + "timestamp": "2017-01-01T09:45:00Z", + "value": 1803040 + }, + { + "timestamp": "2017-01-01T09:50:00Z", + "value": 1803672 + }, + { + "timestamp": "2017-01-01T09:55:00Z", + "value": 1803535 + }, + { + "timestamp": "2017-01-01T10:00:00Z", + "value": 1803541 + }, + { + "timestamp": "2017-01-01T10:05:00Z", + "value": 1803545 + }, + { + "timestamp": "2017-01-01T10:10:00Z", + "value": 1803599 + }, + { + "timestamp": "2017-01-01T10:15:00Z", + "value": 1803616 + }, + { + "timestamp": "2017-01-01T10:20:00Z", + "value": 1803619 + }, + { + "timestamp": "2017-01-01T10:25:00Z", + "value": 1809942 + }, + { + "timestamp": "2017-01-01T10:30:00Z", + "value": 1802720 + }, + { + "timestamp": "2017-01-01T10:35:00Z", + "value": 1802720 + }, + { + "timestamp": "2017-01-01T10:40:00Z", + "value": 1802888 + }, + { + "timestamp": "2017-01-01T10:45:00Z", + "value": 1809574 + }, + { + "timestamp": "2017-01-01T10:50:00Z", + "value": 1803896 + }, + { + "timestamp": "2017-01-01T10:55:00Z", + "value": 1803850 + }, + { + "timestamp": "2017-01-01T11:00:00Z", + "value": 1803854 + }, + { + "timestamp": "2017-01-01T11:05:00Z", + "value": 1803854 + }, + { + "timestamp": "2017-01-01T11:10:00Z", + "value": 1803797 + }, + { + "timestamp": "2017-01-01T11:15:00Z", + "value": 1803921 + }, + { + "timestamp": "2017-01-01T11:20:00Z", + "value": 1803933 + }, + { + "timestamp": "2017-01-01T11:25:00Z", + "value": 1804040 + }, + { + "timestamp": "2017-01-01T11:30:00Z", + "value": 1804044 + }, + { + "timestamp": "2017-01-01T11:35:00Z", + "value": 1804070 + }, + { + "timestamp": "2017-01-01T11:40:00Z", + "value": 1804070 + }, + { + "timestamp": "2017-01-01T11:45:00Z", + "value": 1804068 + }, + { + "timestamp": "2017-01-01T11:50:00Z", + "value": 1804073 + }, + { + "timestamp": "2017-01-01T11:55:00Z", + "value": 1804101 + }, + { + "timestamp": "2017-01-01T12:00:00Z", + "value": 1804674 + }, + { + "timestamp": "2017-01-01T12:05:00Z", + "value": 1804714 + }, + { + "timestamp": "2017-01-01T12:10:00Z", + "value": 1804730 + }, + { + "timestamp": "2017-01-01T12:15:00Z", + "value": 1804816 + }, + { + "timestamp": "2017-01-01T12:20:00Z", + "value": 1803996 + }, + { + "timestamp": "2017-01-01T12:25:00Z", + "value": 1803998 + }, + { + "timestamp": "2017-01-01T12:30:00Z", + "value": 1804015 + }, + { + "timestamp": "2017-01-01T12:35:00Z", + "value": 1804047 + }, + { + "timestamp": "2017-01-01T12:40:00Z", + "value": 1804050 + }, + { + "timestamp": "2017-01-01T12:45:00Z", + "value": 1804218 + }, + { + "timestamp": "2017-01-01T12:50:00Z", + "value": 1804217 + }, + { + "timestamp": "2017-01-01T12:55:00Z", + "value": 1804217 + }, + { + "timestamp": "2017-01-01T13:00:00Z", + "value": 1804205 + }, + { + "timestamp": "2017-01-01T13:05:00Z", + "value": 1804728 + }, + { + "timestamp": "2017-01-01T13:10:00Z", + "value": 1804748 + }, + { + "timestamp": "2017-01-01T13:15:00Z", + "value": 1805232 + }, + { + "timestamp": "2017-01-01T13:20:00Z", + "value": 1814121 + }, + { + "timestamp": "2017-01-01T13:25:00Z", + "value": 1806789 + }, + { + "timestamp": "2017-01-01T13:30:00Z", + "value": 1806119 + }, + { + "timestamp": "2017-01-01T13:35:00Z", + "value": 1806329 + }, + { + "timestamp": "2017-01-01T13:40:00Z", + "value": 1806454 + }, + { + "timestamp": "2017-01-01T13:45:00Z", + "value": 1806852 + }, + { + "timestamp": "2017-01-01T13:50:00Z", + "value": 1807347 + }, + { + "timestamp": "2017-01-01T13:55:00Z", + "value": 1812144 + }, + { + "timestamp": "2017-01-01T14:00:00Z", + "value": 1807418 + }, + { + "timestamp": "2017-01-01T14:05:00Z", + "value": 1807418 + }, + { + "timestamp": "2017-01-01T14:10:00Z", + "value": 1807432 + }, + { + "timestamp": "2017-01-01T14:15:00Z", + "value": 1808540 + }, + { + "timestamp": "2017-01-01T14:20:00Z", + "value": 1808541 + }, + { + "timestamp": "2017-01-01T14:25:00Z", + "value": 1807831 + }, + { + "timestamp": "2017-01-01T14:30:00Z", + "value": 1807852 + }, + { + "timestamp": "2017-01-01T14:35:00Z", + "value": 1807811 + }, + { + "timestamp": "2017-01-01T14:40:00Z", + "value": 2214285 + }, + { + "timestamp": "2017-01-01T14:45:00Z", + "value": 2215019 + }, + { + "timestamp": "2017-01-01T14:50:00Z", + "value": 2215329 + }, + { + "timestamp": "2017-01-01T14:55:00Z", + "value": 2215097 + }, + { + "timestamp": "2017-01-01T15:00:00Z", + "value": 2215129 + }, + { + "timestamp": "2017-01-01T15:05:00Z", + "value": 2215120 + }, + { + "timestamp": "2017-01-01T15:10:00Z", + "value": 2217056 + }, + { + "timestamp": "2017-01-01T15:15:00Z", + "value": 2217056 + }, + { + "timestamp": "2017-01-01T15:20:00Z", + "value": 2222126 + }, + { + "timestamp": "2017-01-01T15:25:00Z", + "value": 2226472 + }, + { + "timestamp": "2017-01-01T15:30:00Z", + "value": 2226722 + }, + { + "timestamp": "2017-01-01T15:35:00Z", + "value": 2226729 + }, + { + "timestamp": "2017-01-01T15:40:00Z", + "value": 2226735 + }, + { + "timestamp": "2017-01-01T15:45:00Z", + "value": 2226735 + }, + { + "timestamp": "2017-01-01T15:50:00Z", + "value": 2226735 + }, + { + "timestamp": "2017-01-01T15:55:00Z", + "value": 2226952 + }, + { + "timestamp": "2017-01-01T16:00:00Z", + "value": 2226962 + }, + { + "timestamp": "2017-01-01T16:05:00Z", + "value": 2649337 + }, + { + "timestamp": "2017-01-01T16:10:00Z", + "value": 2092796 + }, + { + "timestamp": "2017-01-01T16:15:00Z", + "value": 2092839 + }, + { + "timestamp": "2017-01-01T16:20:00Z", + "value": 2092940 + }, + { + "timestamp": "2017-01-01T16:25:00Z", + "value": 2092940 + }, + { + "timestamp": "2017-01-01T16:30:00Z", + "value": 2092965 + }, + { + "timestamp": "2017-01-01T16:35:00Z", + "value": 2092979 + }, + { + "timestamp": "2017-01-01T16:40:00Z", + "value": 2095588 + }, + { + "timestamp": "2017-01-01T16:45:00Z", + "value": 2099586 + }, + { + "timestamp": "2017-01-01T16:50:00Z", + "value": 2102981 + }, + { + "timestamp": "2017-01-01T16:55:00Z", + "value": 2108053 + }, + { + "timestamp": "2017-01-01T17:00:00Z", + "value": 2107907 + }, + { + "timestamp": "2017-01-01T17:05:00Z", + "value": 2108241 + }, + { + "timestamp": "2017-01-01T17:10:00Z", + "value": 2100321 + }, + { + "timestamp": "2017-01-01T17:15:00Z", + "value": 2100448 + }, + { + "timestamp": "2017-01-01T17:20:00Z", + "value": 2100483 + }, + { + "timestamp": "2017-01-01T17:25:00Z", + "value": 2103042 + }, + { + "timestamp": "2017-01-01T17:30:00Z", + "value": 2103037 + }, + { + "timestamp": "2017-01-01T17:35:00Z", + "value": 2103040 + }, + { + "timestamp": "2017-01-01T17:40:00Z", + "value": 2103054 + }, + { + "timestamp": "2017-01-01T17:45:00Z", + "value": 2103058 + }, + { + "timestamp": "2017-01-01T17:50:00Z", + "value": 1830757 + }, + { + "timestamp": "2017-01-01T17:55:00Z", + "value": 1830855 + }, + { + "timestamp": "2017-01-01T18:00:00Z", + "value": 1831495 + }, + { + "timestamp": "2017-01-01T18:05:00Z", + "value": 1831463 + }, + { + "timestamp": "2017-01-01T18:10:00Z", + "value": 1831963 + }, + { + "timestamp": "2017-01-01T18:15:00Z", + "value": 1832046 + }, + { + "timestamp": "2017-01-01T18:20:00Z", + "value": 1832070 + }, + { + "timestamp": "2017-01-01T18:25:00Z", + "value": 1835511 + }, + { + "timestamp": "2017-01-01T18:30:00Z", + "value": 1835265 + }, + { + "timestamp": "2017-01-01T18:35:00Z", + "value": 1835481 + }, + { + "timestamp": "2017-01-01T18:40:00Z", + "value": 1835578 + }, + { + "timestamp": "2017-01-01T18:45:00Z", + "value": 1835611 + }, + { + "timestamp": "2017-01-01T18:50:00Z", + "value": 1836314 + }, + { + "timestamp": "2017-01-01T18:55:00Z", + "value": 1836369 + }, + { + "timestamp": "2017-01-01T19:00:00Z", + "value": 1837280 + }, + { + "timestamp": "2017-01-01T19:05:00Z", + "value": 1842939 + }, + { + "timestamp": "2017-01-01T19:10:00Z", + "value": 1843126 + }, + { + "timestamp": "2017-01-01T19:15:00Z", + "value": 1845840 + }, + { + "timestamp": "2017-01-01T19:20:00Z", + "value": 1842444 + }, + { + "timestamp": "2017-01-01T19:25:00Z", + "value": 1839891 + }, + { + "timestamp": "2017-01-01T19:30:00Z", + "value": 1839875 + }, + { + "timestamp": "2017-01-01T19:35:00Z", + "value": 1839870 + }, + { + "timestamp": "2017-01-01T19:40:00Z", + "value": 1840090 + }, + { + "timestamp": "2017-01-01T19:45:00Z", + "value": 1840479 + }, + { + "timestamp": "2017-01-01T19:50:00Z", + "value": 1840479 + }, + { + "timestamp": "2017-01-01T19:55:00Z", + "value": 1840482 + }, + { + "timestamp": "2017-01-01T20:00:00Z", + "value": 1841522 + }, + { + "timestamp": "2017-01-01T20:05:00Z", + "value": 1841836 + }, + { + "timestamp": "2017-01-01T20:10:00Z", + "value": 1842377 + }, + { + "timestamp": "2017-01-01T20:15:00Z", + "value": 1842388 + }, + { + "timestamp": "2017-01-01T20:20:00Z", + "value": 1842489 + }, + { + "timestamp": "2017-01-01T20:25:00Z", + "value": 1842489 + }, + { + "timestamp": "2017-01-01T20:30:00Z", + "value": 1842489 + }, + { + "timestamp": "2017-01-01T20:35:00Z", + "value": 1842496 + }, + { + "timestamp": "2017-01-01T20:40:00Z", + "value": 1842689 + }, + { + "timestamp": "2017-01-01T20:45:00Z", + "value": 1843117 + }, + { + "timestamp": "2017-01-01T20:50:00Z", + "value": 1843116 + }, + { + "timestamp": "2017-01-01T20:55:00Z", + "value": 1843227 + }, + { + "timestamp": "2017-01-01T21:00:00Z", + "value": 1843138 + }, + { + "timestamp": "2017-01-01T21:05:00Z", + "value": 1843141 + }, + { + "timestamp": "2017-01-01T21:10:00Z", + "value": 1843310 + }, + { + "timestamp": "2017-01-01T21:15:00Z", + "value": 1843310 + }, + { + "timestamp": "2017-01-01T21:20:00Z", + "value": 1843507 + }, + { + "timestamp": "2017-01-01T21:25:00Z", + "value": 1843953 + }, + { + "timestamp": "2017-01-01T21:30:00Z", + "value": 1844778 + }, + { + "timestamp": "2017-01-01T21:35:00Z", + "value": 1843918 + }, + { + "timestamp": "2017-01-01T21:40:00Z", + "value": 1882692 + }, + { + "timestamp": "2017-01-01T21:45:00Z", + "value": 1974888 + }, + { + "timestamp": "2017-01-01T21:50:00Z", + "value": 2157136 + }, + { + "timestamp": "2017-01-01T21:55:00Z", + "value": 2154987 + }, + { + "timestamp": "2017-01-01T22:00:00Z", + "value": 2155664 + }, + { + "timestamp": "2017-01-01T22:05:00Z", + "value": 2155660 + }, + { + "timestamp": "2017-01-01T22:10:00Z", + "value": 2155824 + }, + { + "timestamp": "2017-01-01T22:15:00Z", + "value": 2155824 + }, + { + "timestamp": "2017-01-01T22:20:00Z", + "value": 2156329 + }, + { + "timestamp": "2017-01-01T22:25:00Z", + "value": 2156479 + }, + { + "timestamp": "2017-01-01T22:30:00Z", + "value": 2165269 + }, + { + "timestamp": "2017-01-01T22:35:00Z", + "value": 2165433 + }, + { + "timestamp": "2017-01-01T22:40:00Z", + "value": 2165739 + }, + { + "timestamp": "2017-01-01T22:45:00Z", + "value": 2165931 + }, + { + "timestamp": "2017-01-01T22:50:00Z", + "value": 2165928 + }, + { + "timestamp": "2017-01-01T22:55:00Z", + "value": 2165989 + }, + { + "timestamp": "2017-01-01T23:00:00Z", + "value": 2228961 + }, + { + "timestamp": "2017-01-01T23:05:00Z", + "value": 2228961 + }, + { + "timestamp": "2017-01-01T23:10:00Z", + "value": 2228961 + }, + { + "timestamp": "2017-01-01T23:15:00Z", + "value": 2485802 + }, + { + "timestamp": "2017-01-01T23:20:00Z", + "value": 2485802 + }, + { + "timestamp": "2017-01-01T23:25:00Z", + "value": 2486021 + }, + { + "timestamp": "2017-01-01T23:30:00Z", + "value": 2485293 + }, + { + "timestamp": "2017-01-01T23:35:00Z", + "value": 2485293 + }, + { + "timestamp": "2017-01-01T23:40:00Z", + "value": 2485324 + }, + { + "timestamp": "2017-01-01T23:45:00Z", + "value": 2489142 + }, + { + "timestamp": "2017-01-01T23:50:00Z", + "value": 2526312 + }, + { + "timestamp": "2017-01-01T23:55:00Z", + "value": 2526313 + }, + { + "timestamp": "2017-01-02T00:00:00Z", + "value": 2526314 + }, + { + "timestamp": "2017-01-02T00:05:00Z", + "value": 2526324 + }, + { + "timestamp": "2017-01-02T00:10:00Z", + "value": 2526325 + }, + { + "timestamp": "2017-01-02T00:15:00Z", + "value": 2526205 + }, + { + "timestamp": "2017-01-02T00:20:00Z", + "value": 2526226 + }, + { + "timestamp": "2017-01-02T00:25:00Z", + "value": 2526475 + }, + { + "timestamp": "2017-01-02T00:30:00Z", + "value": 2526471 + }, + { + "timestamp": "2017-01-02T00:35:00Z", + "value": 2526471 + }, + { + "timestamp": "2017-01-02T00:40:00Z", + "value": 2526534 + }, + { + "timestamp": "2017-01-02T00:45:00Z", + "value": 2526646 + }, + { + "timestamp": "2017-01-02T00:50:00Z", + "value": 2526646 + }, + { + "timestamp": "2017-01-02T00:55:00Z", + "value": 2526648 + }, + { + "timestamp": "2017-01-02T01:00:00Z", + "value": 2526658 + }, + { + "timestamp": "2017-01-02T01:05:00Z", + "value": 2526771 + }, + { + "timestamp": "2017-01-02T01:10:00Z", + "value": 2526773 + }, + { + "timestamp": "2017-01-02T01:15:00Z", + "value": 2526793 + }, + { + "timestamp": "2017-01-02T01:20:00Z", + "value": 2527010 + }, + { + "timestamp": "2017-01-02T01:25:00Z", + "value": 2527031 + }, + { + "timestamp": "2017-01-02T01:30:00Z", + "value": 3178096 + }, + { + "timestamp": "2017-01-02T01:35:00Z", + "value": 3196305 + }, + { + "timestamp": "2017-01-02T01:40:00Z", + "value": 3196202 + }, + { + "timestamp": "2017-01-02T01:45:00Z", + "value": 3196202 + }, + { + "timestamp": "2017-01-02T01:50:00Z", + "value": 3196205 + }, + { + "timestamp": "2017-01-02T01:55:00Z", + "value": 3229232 + }, + { + "timestamp": "2017-01-02T02:00:00Z", + "value": 3230463 + }, + { + "timestamp": "2017-01-02T02:05:00Z", + "value": 3230468 + }, + { + "timestamp": "2017-01-02T02:10:00Z", + "value": 3230468 + }, + { + "timestamp": "2017-01-02T02:15:00Z", + "value": 3230468 + }, + { + "timestamp": "2017-01-02T02:20:00Z", + "value": 3230470 + }, + { + "timestamp": "2017-01-02T02:25:00Z", + "value": 3230467 + }, + { + "timestamp": "2017-01-02T02:30:00Z", + "value": 3230506 + }, + { + "timestamp": "2017-01-02T02:35:00Z", + "value": 3231536 + }, + { + "timestamp": "2017-01-02T02:40:00Z", + "value": 3230723 + }, + { + "timestamp": "2017-01-02T02:45:00Z", + "value": 3230727 + }, + { + "timestamp": "2017-01-02T02:50:00Z", + "value": 3230727 + }, + { + "timestamp": "2017-01-02T02:55:00Z", + "value": 3230727 + }, + { + "timestamp": "2017-01-02T03:00:00Z", + "value": 3231880 + }, + { + "timestamp": "2017-01-02T03:05:00Z", + "value": 3232283 + }, + { + "timestamp": "2017-01-02T03:10:00Z", + "value": 3232283 + }, + { + "timestamp": "2017-01-02T03:15:00Z", + "value": 3232283 + }, + { + "timestamp": "2017-01-02T03:20:00Z", + "value": 3232325 + }, + { + "timestamp": "2017-01-02T03:25:00Z", + "value": 3232323 + }, + { + "timestamp": "2017-01-02T03:30:00Z", + "value": 3232327 + }, + { + "timestamp": "2017-01-02T03:35:00Z", + "value": 3232340 + }, + { + "timestamp": "2017-01-02T03:40:00Z", + "value": 3232713 + }, + { + "timestamp": "2017-01-02T03:45:00Z", + "value": 3232729 + }, + { + "timestamp": "2017-01-02T03:50:00Z", + "value": 3232756 + }, + { + "timestamp": "2017-01-02T03:55:00Z", + "value": 3233500 + }, + { + "timestamp": "2017-01-02T04:00:00Z", + "value": 3233500 + }, + { + "timestamp": "2017-01-02T04:05:00Z", + "value": 3233500 + } + ], + "granularity": "minutely", + "customInterval": 5, + "stableTrendWindow": 10, + "threshold": 0.99, + "period": 0 + } + }, + "responses": { + "200": { + "body": { + "period": 0, + "confidenceScores": [ + 0.11841763735063232, + 0.014857199927548581, + 0.0887032374955278, + 0.07430314751946857, + 0.059903057543409355, + 0.04132288981790399, + 0.022742722092391268, + 0.0005683208474757854, + 0.0216060803974397, + 0.053248991089971616, + 0.08489190178249614, + 0.04322511558132514, + 0.085336620199234, + 0.05876047041512903, + 0.02673755265447302, + 0.005032027060762012, + 0.031323171543775764, + 0.06299774949197792, + 0.08944723025337244, + 0.11523169864554421, + 0.14288453512268834, + 0.001592562559717675, + 0.32637788222282893, + 0, + 7.37310752217245e-15, + 2.211932256651735e-14, + 1, + 0.015697015891758138, + 0.01242773215043403, + 0.016188579169534697, + 0.019537751864826272, + 0.022506917491993753, + 0.01885762668253081, + 0.016253355310429398, + 0.017227483829906676, + 0.023236706002118527, + 0.03906277743439327, + 0.0354134866249377, + 0.037084294769315296, + 0.038248426822850935, + 0.050274427573818385, + 0.046815140298421175, + 0.043292518511668716, + 0.041353259508804745, + 0.038242312045861385, + 0.0346880230034313, + 0.032717096744889713, + 0.033026212895129546, + 0.031055286636580585, + 0.0275326648498355, + 0.023883374040372555, + 0.021564107969369743, + 0.018706498551854727, + 0.01543721481052325, + 0.015176320358565887, + 0.011527029549110314, + 0.008004407762357859, + 0.004355116952902286, + 0.0007058261434393403, + 0.0030701336887340946, + 0.006592755475479178, + 0.010147044517909256, + 0.013701333560339335, + 0.016780613767597707, + 0.020366570065705403, + 0.024015860875168354, + 0.02757014991759106, + 0.03033275756808058, + 0.03068865378707081, + 0.03395793752839492, + 0.03760722833785786, + 0.04122485189164318, + 0.030433874112103007, + 0.032816474694461056, + 0.03602242392443729, + 0.03960838022253762, + 0.04268766042980336, + 0.04633695123926631, + 0.0346592903007527, + 0.010219725324164698, + 0.007218892441326965, + 0.006909776291079754, + 0.000049463551460760754, + 0.0016047901503119819, + 0.01042121060065547, + 0.009020294944303705, + 0.005371004134840759, + 0.0021650549048718984, + 0.010517653997227793, + 0.0075017083013172925, + 0.00385241749186172, + 0.0008681390516288423, + 0.019005920148370017, + 0.015388296594592068, + 0.12583612799160215, + 1, + 0.005055878353042495, + 0.007613932468790628, + 0.011913685646822731, + 0.0166567804043268, + 0.015351429327405014, + 0.034309821169245976, + 0.0292817211106433, + 0.02425362105202589, + 0.019225520993423218, + 0.01419742093482055, + 0.00916932087621788, + 0.004141220817600464, + 0.0008868792410022057, + 0.0059149792996048755, + 0.010943079358207547, + 0.015971179416810213, + 0.02099927947542763, + 1, + 0.11533376425564247, + 0.1207645081246342, + 0.025174230145423273, + 0.09422487163021387, + 0.08417070843230404, + 0.07411654523437947, + 0.06406238203646963, + 0.0540082188385598, + 0.04395405564064997, + 0.03500824639144218, + 0.024954083193532338, + 0.014899919995622513, + 0.004845756797712681, + 0.005208406400211895, + 0.015262569598121728, + 0.025316732796031558, + 0.03537089599394139, + 0.045425059191865964, + 0.05145748091871777, + 1, + 0.011663506282381296, + 0.0043856580970499884, + 0.002892190088273945, + 0.01017003827359788, + 0.01744788645892181, + 0.024725734644253115, + 0.03200358282957705, + 0.03928143101490098, + 0.046559279200224915, + 0.05383712738555622, + 0.060069956133518614, + 0.0450857235774741, + 0.050621872700536176, + 0.029050850963546225, + 0.045689493056171517, + 0.0385699811492357, + 0.03179880905474635, + 0.03082274474926925, + 0.03586345902254038, + 0.028585610837209074, + 0.021402764418918006, + 0.04705886213832124, + 0.049724532235770696, + 0.05957866937203304, + 0.052649160999162954, + 0.045371312813839014, + 0.03809346462851508, + 0.030815616443183775, + 0.023537768257859845, + 0.01945831289597576, + 0.012180464710644455, + 0.00490261652532052, + 0.002153560870260057, + 0.0033196287098028916, + 0.0029244412792105113, + 0.0043217396504358, + 0.010934575466529664, + 0.018117421884820732, + 0.02267188608187652, + 0.027321352045957807, + 0.03459920023128174, + 0.03563859904812146, + 0.02990120514994264, + 0.03607069938654979, + 0.017223061637835352, + 7.37310752217245e-15, + 1.47462150443449e-14, + 1, + 0.046440552438977135, + 0.012233652454378385, + 0.017033155644526038, + 0.05136672465183527, + 0.06970832954194527, + 0.09929181019761117, + 0.11281999222473732, + 0.11039622919405537, + 0.08125609011787617, + 0.05661270134791935, + 0.028264243663680723, + 0.005974323576610399, + 0.038471191754617544, + 0, + 0, + 0, + 0.020288532128574968, + 0.005041879493223223, + 0.009223088216122232, + 0.009332792637570532, + 0.024579445272937026, + 0.03289096891488949, + 0.050695883419617865, + 1, + 0.000748013913075547, + 0.002186373999917361, + 0.0009330173541465358, + 0.00032033929162428933, + 0.0012886906362965138, + 0.002542047282052593, + 0.0007963481454318109, + 0.0004886757560166365, + 0.0016470306347398486, + 0.001063686451208582, + 0.0011980222832366648, + 0.00008700161821178273, + 0.0013086910082902394, + 0.0022770423529624643, + 0.000016333637160404937, + 0.0012053557529180517, + 0.0018570345408140537, + 0.0037297360397815314, + 0.003109724507563151, + 0.22869458705263188, + 0.2293374323429407, + 0.1140021204394844, + 0.0012381896969537412, + 0.11340677603264777, + 1, + 0.011793249472519423, + 0.008293225072094536, + 0.00469819890465153, + 0.0010715054815308995, + 0.0025551879416044767, + 0.006118546853369862, + 0.008605219072110835, + 0.0053601180131874334, + 0.008860142413597574, + 0.01248683583673295, + 0.01611352925985358, + 0.005878587160222206, + 0.013145429690188892, + 0.022280640305150038, + 0.01865394688201466, + 0.015027253458894031, + 0.012033905149325846, + 0.009040556839742916, + 0.005445530672299909, + 0.0018505045048569009, + 0.001744521662600853, + 0.005339547830043862, + 0.008760404091259945, + 0.012181260352490777, + 0.009902010591734853, + 0.007622760830993676 + ], + "isChangePoint": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ] + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/DeleteModel.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/DeleteModel.json new file mode 100644 index 000000000000..1ada54a87848 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/DeleteModel.json @@ -0,0 +1,25 @@ +{ + "operationId": "Multivariate_DeleteMultivariateModel", + "title": "Delete multivariate model", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "body": {} + }, + "responses": { + "204": {}, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/DetectAnomaly.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/DetectAnomaly.json new file mode 100644 index 000000000000..429c24f8b9d2 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/DetectAnomaly.json @@ -0,0 +1,49 @@ +{ + "operationId": "Multivariate_DetectMultivariateBatchAnomaly", + "title": "Detect multivariate batch anomaly", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "body": { + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "topContributorCount": 10, + "startTime": "2019-04-01T00:15:00Z", + "endTime": "2019-04-01T00:40:00Z" + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{Endpoint}/anomalydetector/v1.1/multivariate/detect-batch/", + "Operation-Id": "663884e6-b117-11ea-b3de-0242ac130004" + }, + "body": { + "resultId": "663884e6-b117-11ea-b3de-0242ac130004", + "summary": { + "status": "CREATED", + "errors": [], + "setupInfo": { + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "topContributorCount": 10, + "startTime": "2021-01-01T00:00:00Z", + "endTime": "2021-01-01T00:29:00Z" + } + }, + "results": [] + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/EntireDetect.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/EntireDetect.json new file mode 100644 index 000000000000..1869ce4b95ba --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/EntireDetect.json @@ -0,0 +1,567 @@ +{ + "operationId": "Univariate_DetectUnivariateEntireSeries", + "title": "Univariate detect entire series", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "series": [ + { + "timestamp": "1972-01-01T00:00:00Z", + "value": 826 + }, + { + "timestamp": "1972-02-01T00:00:00Z", + "value": 799 + }, + { + "timestamp": "1972-03-01T00:00:00Z", + "value": 890 + }, + { + "timestamp": "1972-04-01T00:00:00Z", + "value": 900 + }, + { + "timestamp": "1972-05-01T00:00:00Z", + "value": 961 + }, + { + "timestamp": "1972-06-01T00:00:00Z", + "value": 935 + }, + { + "timestamp": "1972-07-01T00:00:00Z", + "value": 894 + }, + { + "timestamp": "1972-08-01T00:00:00Z", + "value": 855 + }, + { + "timestamp": "1972-09-01T00:00:00Z", + "value": 809 + }, + { + "timestamp": "1972-10-01T00:00:00Z", + "value": 810 + }, + { + "timestamp": "1972-11-01T00:00:00Z", + "value": 766 + }, + { + "timestamp": "1972-12-01T00:00:00Z", + "value": 805 + }, + { + "timestamp": "1973-01-01T00:00:00Z", + "value": 821 + }, + { + "timestamp": "1973-02-01T00:00:00Z", + "value": 773 + }, + { + "timestamp": "1973-03-01T00:00:00Z", + "value": 883 + }, + { + "timestamp": "1973-04-01T00:00:00Z", + "value": 898 + }, + { + "timestamp": "1973-05-01T00:00:00Z", + "value": 957 + }, + { + "timestamp": "1973-06-01T00:00:00Z", + "value": 924 + }, + { + "timestamp": "1973-07-01T00:00:00Z", + "value": 881 + }, + { + "timestamp": "1973-08-01T00:00:00Z", + "value": 837 + }, + { + "timestamp": "1973-09-01T00:00:00Z", + "value": 784 + }, + { + "timestamp": "1973-10-01T00:00:00Z", + "value": 791 + }, + { + "timestamp": "1973-11-01T00:00:00Z", + "value": 760 + }, + { + "timestamp": "1973-12-01T00:00:00Z", + "value": 802 + }, + { + "timestamp": "1974-01-01T00:00:00Z", + "value": 828 + }, + { + "timestamp": "1974-02-01T00:00:00Z", + "value": 1030 + }, + { + "timestamp": "1974-03-01T00:00:00Z", + "value": 889 + }, + { + "timestamp": "1974-04-01T00:00:00Z", + "value": 902 + }, + { + "timestamp": "1974-05-01T00:00:00Z", + "value": 969 + }, + { + "timestamp": "1974-06-01T00:00:00Z", + "value": 947 + }, + { + "timestamp": "1974-07-01T00:00:00Z", + "value": 908 + }, + { + "timestamp": "1974-08-01T00:00:00Z", + "value": 867 + }, + { + "timestamp": "1974-09-01T00:00:00Z", + "value": 815 + }, + { + "timestamp": "1974-10-01T00:00:00Z", + "value": 812 + }, + { + "timestamp": "1974-11-01T00:00:00Z", + "value": 773 + }, + { + "timestamp": "1974-12-01T00:00:00Z", + "value": 813 + }, + { + "timestamp": "1975-01-01T00:00:00Z", + "value": 834 + }, + { + "timestamp": "1975-02-01T00:00:00Z", + "value": 782 + }, + { + "timestamp": "1975-03-01T00:00:00Z", + "value": 892 + }, + { + "timestamp": "1975-04-01T00:00:00Z", + "value": 903 + }, + { + "timestamp": "1975-05-01T00:00:00Z", + "value": 966 + }, + { + "timestamp": "1975-06-01T00:00:00Z", + "value": 937 + }, + { + "timestamp": "1975-07-01T00:00:00Z", + "value": 896 + }, + { + "timestamp": "1975-08-01T00:00:00Z", + "value": 858 + }, + { + "timestamp": "1975-09-01T00:00:00Z", + "value": 817 + }, + { + "timestamp": "1975-10-01T00:00:00Z", + "value": 827 + }, + { + "timestamp": "1975-11-01T00:00:00Z", + "value": 797 + }, + { + "timestamp": "1975-12-01T00:00:00Z", + "value": 843 + } + ], + "maxAnomalyRatio": 0.25, + "sensitivity": 95, + "granularity": "monthly", + "imputeMode": "auto" + } + }, + "responses": { + "200": { + "body": { + "isNegativeAnomaly": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "expectedValues": [ + 827.79409082439679, + 798.91337746719273, + 888.60584318071892, + 900.5606407986661, + 962.83894263783043, + 933.25916063069542, + 891.07841047996658, + 856.17816013636968, + 809.89872279089411, + 807.375129007505, + 764.31966824485175, + 803.933498594564, + 823.59006208830579, + 794.09056413342876, + 883.164245249282, + 894.84190006909535, + 956.84305911012575, + 927.62850551901136, + 885.812983784303, + 851.6424797402517, + 806.0927886943216, + 804.68268153120289, + 762.74070738882, + 804.0251702513732, + 825.35236625795585, + 798.04041887249764, + 889.30165055776979, + 902.4226124345937, + 965.867078532635, + 937.32004957366951, + 896.17205247111019, + 862.00873684136559, + 816.46623420974231, + 814.42977455247092, + 771.8614479159354, + 811.859271346729, + 831.89982792155206, + 802.947544797165, + 892.56844074350829, + 904.54882145338092, + 966.85270638447071, + 937.31683910030426, + 895.180003672544, + 860.36495963566347, + 814.17072859690427, + 811.9054862686213, + 769.10837696107421, + 809.23280846597038 + ], + "isPositiveAnomaly": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "lowerMargins": [ + 41.389704541219835, + 39.945668873359637, + 44.430292159035943, + 45.028032039933308, + 48.14194713189152, + 46.662958031534771, + 44.553920523998329, + 42.808908006818484, + 40.494936139544706, + 40.368756450375251, + 38.215983412242586, + 40.196674929728196, + 41.179503104415289, + 39.704528206671441, + 44.1582122624641, + 44.742095003454772, + 47.842152955506293, + 46.381425275950569, + 44.290649189215145, + 42.582123987012579, + 40.30463943471608, + 40.234134076560146, + 38.137035369441, + 40.201258512568664, + 41.267618312897795, + 39.902020943624883, + 44.465082527888491, + 45.121130621729684, + 48.293353926631752, + 46.866002478683477, + 44.808602623555508, + 43.100436842068284, + 40.823311710487111, + 40.721488727623544, + 38.593072395796774, + 40.592963567336447, + 41.5949913960776, + 40.147377239858251, + 44.628422037175412, + 45.227441072669045, + 48.34263531922354, + 46.865841955015213, + 44.759000183627194, + 43.018247981783169, + 40.708536429845211, + 40.595274313431062, + 38.455418848053711, + 40.461640423298519 + ], + "period": 12, + "upperMargins": [ + 41.389704541219835, + 39.945668873359637, + 44.430292159035943, + 45.028032039933308, + 48.14194713189152, + 46.662958031534771, + 44.553920523998329, + 42.808908006818484, + 40.494936139544706, + 40.368756450375251, + 38.215983412242586, + 40.196674929728196, + 41.179503104415289, + 39.704528206671441, + 44.1582122624641, + 44.742095003454772, + 47.842152955506293, + 46.381425275950569, + 44.290649189215145, + 42.582123987012579, + 40.30463943471608, + 40.234134076560146, + 38.137035369441, + 40.201258512568664, + 41.267618312897795, + 39.902020943624883, + 44.465082527888491, + 45.121130621729684, + 48.293353926631752, + 46.866002478683477, + 44.808602623555508, + 43.100436842068284, + 40.823311710487111, + 40.721488727623544, + 38.593072395796774, + 40.592963567336447, + 41.5949913960776, + 40.147377239858251, + 44.628422037175412, + 45.227441072669045, + 48.34263531922354, + 46.865841955015213, + 44.759000183627194, + 43.018247981783169, + 40.708536429845211, + 40.595274313431062, + 38.455418848053711, + 40.461640423298519 + ], + "isAnomaly": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "severity": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.2906614447614368, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ] + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/GetModel.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/GetModel.json new file mode 100644 index 000000000000..5c25efb71270 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/GetModel.json @@ -0,0 +1,163 @@ +{ + "operationId": "Multivariate_GetMultivariateModel", + "title": "Get a multivariate model", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "body": {} + }, + "responses": { + "200": { + "body": { + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "createdTime": "2020-06-30T00:00:00Z", + "lastUpdatedTime": "2020-06-30T00:00:00Z", + "modelInfo": { + "slidingWindow": 20, + "alignPolicy": { + "alignMode": "Outer", + "fillNAMethod": "Linear", + "paddingValue": 0 + }, + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "dataSchema": "OneTable", + "startTime": "2019-04-01T00:00:00Z", + "endTime": "2019-04-02T00:00:00Z", + "displayName": "Devops-MultiAD", + "status": "READY", + "errors": [], + "diagnosticsInfo": { + "modelState": { + "epochIds": [ + 10, + 20, + 30, + 40, + 50, + 60, + 70, + 80, + 90, + 100 + ], + "trainLosses": [ + 0.6291328072547913, + 0.1671326905488968, + 0.12354248017072678, + 0.10259664058685303, + 0.09584927558898926, + 0.09069952368736267, + 0.08686016499996185, + 0.08603022992610931, + 0.08287354558706284, + 0.08235538005828857 + ], + "validationLosses": [ + 1.9232804775238037, + 1.0645641088485718, + 0.6031560301780701, + 0.5302737951278687, + 0.46980252861976624, + 0.4395163357257843, + 0.41829314827919006, + 0.40579143166542053, + 0.405649870634079, + 0.38492488861083984 + ], + "latenciesInSeconds": [ + 0.3398594856262207, + 0.3659665584564209, + 0.37360644340515137, + 0.35134077072143555, + 0.33703041076660156, + 0.31876277923583984, + 0.32833099365234375, + 0.3503587245941162, + 0.3080024719238281, + 0.3327946662902832 + ] + }, + "variableStates": [ + { + "variable": "ad_input", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_ontimer_output", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ingestion", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "data_in_speed", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "cpu", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_series_init", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "flink_last_ckpt_duration", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "data_out_speed", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_output", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + } + ] + } + } + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/GetResult.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/GetResult.json new file mode 100644 index 000000000000..aaf1294d36b5 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/GetResult.json @@ -0,0 +1,109 @@ +{ + "operationId": "Multivariate_GetMultivariateBatchDetectionResult", + "title": "Get multivariate batch detection result", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "663884e6-b117-11ea-b3de-0242ac130004", + "body": {} + }, + "responses": { + "200": { + "body": { + "resultId": "663884e6-b117-11ea-b3de-0242ac130004", + "summary": { + "status": "READY", + "errors": [], + "variableStates": [ + { + "variable": "variable_1", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + }, + { + "variable": "variable_2", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + }, + { + "variable": "variable_3", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + } + ], + "setupInfo": { + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "topContributorCount": 10, + "startTime": "2021-01-01T00:00:00Z", + "endTime": "2021-01-01T00:29:00Z" + } + }, + "results": [ + { + "timestamp": "2021-01-01T00:28:00Z", + "value": { + "isAnomaly": false, + "severity": 0, + "score": 0.6928471326828003 + }, + "errors": [] + }, + { + "timestamp": "2021-01-01T00:29:00Z", + "value": { + "isAnomaly": true, + "severity": 0.5337404608726501, + "score": 0.9171165823936462, + "interpretation": [ + { + "variable": "variable_2", + "contributionScore": 0.5371576215, + "correlationChanges": { + "changedVariables": [ + "variable_1", + "variable_3" + ] + } + }, + { + "variable": "variable_3", + "contributionScore": 0.3324159383, + "correlationChanges": { + "changedVariables": [ + "variable_2" + ] + } + }, + { + "variable": "variable_1", + "contributionScore": 0.1304264402, + "correlationChanges": { + "changedVariables": [] + } + } + ] + } + } + ] + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/LastDetect.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/LastDetect.json new file mode 100644 index 000000000000..ebc05dca98fa --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/LastDetect.json @@ -0,0 +1,226 @@ +{ + "operationId": "Univariate_DetectUnivariateLastPoint", + "title": "Detect univariate last point", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "series": [ + { + "timestamp": "1972-01-01T00:00:00Z", + "value": 826 + }, + { + "timestamp": "1972-02-01T00:00:00Z", + "value": 799 + }, + { + "timestamp": "1972-03-01T00:00:00Z", + "value": 890 + }, + { + "timestamp": "1972-04-01T00:00:00Z", + "value": 900 + }, + { + "timestamp": "1972-05-01T00:00:00Z", + "value": 961 + }, + { + "timestamp": "1972-06-01T00:00:00Z", + "value": 935 + }, + { + "timestamp": "1972-07-01T00:00:00Z", + "value": 894 + }, + { + "timestamp": "1972-08-01T00:00:00Z", + "value": 855 + }, + { + "timestamp": "1972-09-01T00:00:00Z", + "value": 809 + }, + { + "timestamp": "1972-10-01T00:00:00Z", + "value": 810 + }, + { + "timestamp": "1972-11-01T00:00:00Z", + "value": 766 + }, + { + "timestamp": "1972-12-01T00:00:00Z", + "value": 805 + }, + { + "timestamp": "1973-01-01T00:00:00Z", + "value": 821 + }, + { + "timestamp": "1973-02-01T00:00:00Z", + "value": 773 + }, + { + "timestamp": "1973-03-01T00:00:00Z", + "value": 883 + }, + { + "timestamp": "1973-04-01T00:00:00Z", + "value": 898 + }, + { + "timestamp": "1973-05-01T00:00:00Z", + "value": 957 + }, + { + "timestamp": "1973-06-01T00:00:00Z", + "value": 924 + }, + { + "timestamp": "1973-07-01T00:00:00Z", + "value": 881 + }, + { + "timestamp": "1973-08-01T00:00:00Z", + "value": 837 + }, + { + "timestamp": "1973-09-01T00:00:00Z", + "value": 784 + }, + { + "timestamp": "1973-10-01T00:00:00Z", + "value": 791 + }, + { + "timestamp": "1973-11-01T00:00:00Z", + "value": 760 + }, + { + "timestamp": "1973-12-01T00:00:00Z", + "value": 802 + }, + { + "timestamp": "1974-01-01T00:00:00Z", + "value": 828 + }, + { + "timestamp": "1974-02-01T00:00:00Z", + "value": 1030 + }, + { + "timestamp": "1974-03-01T00:00:00Z", + "value": 889 + }, + { + "timestamp": "1974-04-01T00:00:00Z", + "value": 902 + }, + { + "timestamp": "1974-05-01T00:00:00Z", + "value": 969 + }, + { + "timestamp": "1974-06-01T00:00:00Z", + "value": 947 + }, + { + "timestamp": "1974-07-01T00:00:00Z", + "value": 908 + }, + { + "timestamp": "1974-08-01T00:00:00Z", + "value": 867 + }, + { + "timestamp": "1974-09-01T00:00:00Z", + "value": 815 + }, + { + "timestamp": "1974-10-01T00:00:00Z", + "value": 812 + }, + { + "timestamp": "1974-11-01T00:00:00Z", + "value": 773 + }, + { + "timestamp": "1974-12-01T00:00:00Z", + "value": 813 + }, + { + "timestamp": "1975-01-01T00:00:00Z", + "value": 834 + }, + { + "timestamp": "1975-02-01T00:00:00Z", + "value": 782 + }, + { + "timestamp": "1975-03-01T00:00:00Z", + "value": 892 + }, + { + "timestamp": "1975-04-01T00:00:00Z", + "value": 903 + }, + { + "timestamp": "1975-05-01T00:00:00Z", + "value": 966 + }, + { + "timestamp": "1975-06-01T00:00:00Z", + "value": 937 + }, + { + "timestamp": "1975-07-01T00:00:00Z", + "value": 896 + }, + { + "timestamp": "1975-08-01T00:00:00Z", + "value": 858 + }, + { + "timestamp": "1975-09-01T00:00:00Z", + "value": 817 + }, + { + "timestamp": "1975-10-01T00:00:00Z", + "value": 827 + }, + { + "timestamp": "1975-11-01T00:00:00Z", + "value": 797 + }, + { + "timestamp": "1975-12-01T00:00:00Z", + "value": 843 + } + ], + "maxAnomalyRatio": 0.25, + "sensitivity": 95, + "granularity": "monthly", + "imputeMode": "fixed", + "imputeFixedValue": 800 + } + }, + "responses": { + "200": { + "body": { + "isAnomaly": false, + "isPositiveAnomaly": false, + "isNegativeAnomaly": false, + "period": 12, + "expectedValue": 809.23280846597038, + "upperMargin": 40.461640423298519, + "lowerMargin": 40.461640423298519, + "suggestedWindow": 49, + "severity": 0.0 + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/LastDetectAnomaly.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/LastDetectAnomaly.json new file mode 100644 index 000000000000..09c4992dd22b --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/LastDetectAnomaly.json @@ -0,0 +1,304 @@ +{ + "operationId": "Multivariate_DetectMultivariateLastAnomaly", + "title": "Detect multivariate last anomaly", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "body": { + "variables": [ + { + "variable": "Variable_1", + "timestamps": [ + "2021-01-01T00:00:00Z", + "2021-01-01T00:01:00Z", + "2021-01-01T00:02:00Z", + "2021-01-01T00:03:00Z", + "2021-01-01T00:04:00Z", + "2021-01-01T00:05:00Z", + "2021-01-01T00:06:00Z", + "2021-01-01T00:07:00Z", + "2021-01-01T00:08:00Z", + "2021-01-01T00:09:00Z", + "2021-01-01T00:10:00Z", + "2021-01-01T00:11:00Z", + "2021-01-01T00:12:00Z", + "2021-01-01T00:13:00Z", + "2021-01-01T00:14:00Z", + "2021-01-01T00:15:00Z", + "2021-01-01T00:16:00Z", + "2021-01-01T00:17:00Z", + "2021-01-01T00:18:00Z", + "2021-01-01T00:19:00Z", + "2021-01-01T00:20:00Z", + "2021-01-01T00:21:00Z", + "2021-01-01T00:22:00Z", + "2021-01-01T00:23:00Z", + "2021-01-01T00:24:00Z", + "2021-01-01T00:25:00Z", + "2021-01-01T00:26:00Z", + "2021-01-01T00:27:00Z", + "2021-01-01T00:28:00Z", + "2021-01-01T00:29:00Z" + ], + "values": [ + 0.4551378545933972, + 0.7388603950488748, + 0.201088255984052, + 0.7462812245891899, + 0.07308128850401663, + 0.33090474587393537, + 0.7544925268153315, + 0.987506336316328, + 0.6665932993421468, + 0.6308351543168672, + 0.08083310161466228, + 0.8414415588668442, + 0.514583545640453, + 0.0954489875193526, + 0.7786793231920507, + 0.41646133667960994, + 0.030176187583339287, + 0.3474214937189324, + 0.508530173413991, + 0.42451199127255046, + 0.2115944222725208, + 0.24733519545833516, + 0.8791022110982156, + 0.9479621899884665, + 0.26702703121252136, + 0.6954503497669413, + 0.1235728391488995, + 0.8214915473050647, + 0.11813002444192677, + 0.8579045951076123 + ] + }, + { + "variable": "Variable_2", + "timestamps": [ + "2021-01-01T00:00:00Z", + "2021-01-01T00:01:00Z", + "2021-01-01T00:02:00Z", + "2021-01-01T00:03:00Z", + "2021-01-01T00:04:00Z", + "2021-01-01T00:05:00Z", + "2021-01-01T00:06:00Z", + "2021-01-01T00:07:00Z", + "2021-01-01T00:08:00Z", + "2021-01-01T00:09:00Z", + "2021-01-01T00:10:00Z", + "2021-01-01T00:11:00Z", + "2021-01-01T00:12:00Z", + "2021-01-01T00:13:00Z", + "2021-01-01T00:14:00Z", + "2021-01-01T00:15:00Z", + "2021-01-01T00:16:00Z", + "2021-01-01T00:17:00Z", + "2021-01-01T00:18:00Z", + "2021-01-01T00:19:00Z", + "2021-01-01T00:20:00Z", + "2021-01-01T00:21:00Z", + "2021-01-01T00:22:00Z", + "2021-01-01T00:23:00Z", + "2021-01-01T00:24:00Z", + "2021-01-01T00:25:00Z", + "2021-01-01T00:26:00Z", + "2021-01-01T00:27:00Z", + "2021-01-01T00:28:00Z", + "2021-01-01T00:29:00Z" + ], + "values": [ + 0.9617871613964145, + 0.24903311574778408, + 0.4920561254118613, + 0.9895601049618598, + 0.9171759283128094, + 0.5754204711105273, + 0.1811033296265634, + 0.8852311981742577, + 0.9543231904644779, + 0.7088012446094262, + 0.7843572237149014, + 0.7664787010700046, + 0.3699552325387093, + 0.504519908266789, + 0.5848930929950164, + 0.7628913396089576, + 0.8148405868900065, + 0.08540458873739332, + 0.03481976727525682, + 0.21275099339467762, + 0.9836175579199806, + 0.9321441483364282, + 0.038466608085469534, + 0.1723138437622782, + 0.8626383410218382, + 0.35053229974224254, + 0.631141662835182, + 0.0730352607990088, + 0.08886179043386, + 0.7488606040971179 + ] + }, + { + "variable": "Variable_3", + "timestamps": [ + "2021-01-01T00:00:00Z", + "2021-01-01T00:01:00Z", + "2021-01-01T00:02:00Z", + "2021-01-01T00:03:00Z", + "2021-01-01T00:04:00Z", + "2021-01-01T00:05:00Z", + "2021-01-01T00:06:00Z", + "2021-01-01T00:07:00Z", + "2021-01-01T00:08:00Z", + "2021-01-01T00:09:00Z", + "2021-01-01T00:10:00Z", + "2021-01-01T00:11:00Z", + "2021-01-01T00:12:00Z", + "2021-01-01T00:13:00Z", + "2021-01-01T00:14:00Z", + "2021-01-01T00:15:00Z", + "2021-01-01T00:16:00Z", + "2021-01-01T00:17:00Z", + "2021-01-01T00:18:00Z", + "2021-01-01T00:19:00Z", + "2021-01-01T00:20:00Z", + "2021-01-01T00:21:00Z", + "2021-01-01T00:22:00Z", + "2021-01-01T00:23:00Z", + "2021-01-01T00:24:00Z", + "2021-01-01T00:25:00Z", + "2021-01-01T00:26:00Z", + "2021-01-01T00:27:00Z", + "2021-01-01T00:28:00Z", + "2021-01-01T00:29:00Z" + ], + "values": [ + 0.4030756879437628, + 0.15526889968448554, + 0.36352226408981103, + 0.6051200637229004, + 0.8516795018476276, + 0.2645605735279929, + 0.6810875830037345, + 0.9165894221681316, + 0.700783245230424, + 0.5624155469940331, + 0.6277289685127893, + 0.15992056539730204, + 0.6020964482827594, + 0.35937967753105915, + 0.8731686034848609, + 0.20301549117588935, + 0.029261872151168933, + 0.6261499548828445, + 0.45850782028563386, + 0.8275006940083313, + 0.032760268834037376, + 0.4485202784055029, + 0.8915691008748384, + 0.891669051517807, + 0.9469979353323046, + 0.115293087370132, + 0.08818772518459506, + 0.7426286620589166, + 0.32372247468990756, + 0.936268139507417 + ] + } + ], + "topContributorCount": 10 + } + }, + "responses": { + "200": { + "body": { + "variableStates": [ + { + "variable": "variable_1", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + }, + { + "variable": "variable_2", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + }, + { + "variable": "variable_3", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + } + ], + "results": [ + { + "timestamp": "2021-01-01T00:28:00Z", + "value": { + "isAnomaly": false, + "severity": 0, + "score": 0.6928471326828003 + }, + "errors": [] + }, + { + "timestamp": "2021-01-01T00:29:00Z", + "value": { + "isAnomaly": true, + "severity": 0.5337404608726501, + "score": 0.9171165823936462, + "interpretation": [ + { + "variable": "variable_2", + "contributionScore": 0.5371576215, + "correlationChanges": { + "changedVariables": [ + "variable_1", + "variable_3" + ] + } + }, + { + "variable": "variable_3", + "contributionScore": 0.3324159383, + "correlationChanges": { + "changedVariables": [ + "variable_2" + ] + } + }, + { + "variable": "variable_1", + "contributionScore": 0.1304264402, + "correlationChanges": { + "changedVariables": [] + } + } + ] + }, + "errors": [] + } + ] + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/ListModel.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/ListModel.json new file mode 100644 index 000000000000..8e99cf2d0898 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/ListModel.json @@ -0,0 +1,171 @@ +{ + "operationId": "Multivariate_ListMultivariateModels", + "title": "List multivariate models", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "skip": 0, + "top": 10, + "body": {} + }, + "responses": { + "200": { + "body": { + "models": [ + { + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "createdTime": "2020-06-30T00:00:00Z", + "lastUpdatedTime": "2020-06-30T00:00:00Z", + "modelInfo": { + "slidingWindow": 20, + "alignPolicy": { + "alignMode": "Outer", + "fillNAMethod": "Linear", + "paddingValue": 0 + }, + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "dataSchema": "OneTable", + "startTime": "2019-04-01T00:00:00Z", + "endTime": "2019-04-02T00:00:00Z", + "displayName": "Devops-MultiAD", + "status": "READY", + "errors": [], + "diagnosticsInfo": { + "modelState": { + "epochIds": [ + 10, + 20, + 30, + 40, + 50, + 60, + 70, + 80, + 90, + 100 + ], + "trainLosses": [ + 0.6291328072547913, + 0.1671326905488968, + 0.12354248017072678, + 0.10259664058685303, + 0.09584927558898926, + 0.09069952368736267, + 0.08686016499996185, + 0.08603022992610931, + 0.08287354558706284, + 0.08235538005828857 + ], + "validationLosses": [ + 1.9232804775238037, + 1.0645641088485718, + 0.6031560301780701, + 0.5302737951278687, + 0.46980252861976624, + 0.4395163357257843, + 0.41829314827919006, + 0.40579143166542053, + 0.405649870634079, + 0.38492488861083984 + ], + "latenciesInSeconds": [ + 0.3398594856262207, + 0.3659665584564209, + 0.37360644340515137, + 0.35134077072143555, + 0.33703041076660156, + 0.31876277923583984, + 0.32833099365234375, + 0.3503587245941162, + 0.3080024719238281, + 0.3327946662902832 + ] + }, + "variableStates": [ + { + "variable": "ad_input", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_ontimer_output", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ingestion", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "data_in_speed", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "cpu", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_series_init", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "flink_last_ckpt_duration", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "data_out_speed", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_output", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + } + ] + } + } + } + ], + "currentCount": 1, + "maxCount": 20, + "nextLink": "" + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/examples/v1.1/TrainModel.json b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/TrainModel.json new file mode 100644 index 000000000000..234215b723cd --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/examples/v1.1/TrainModel.json @@ -0,0 +1,60 @@ +{ + "operationId": "Multivariate_TrainMultivariateModel", + "title": "Create and train multivariate model", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "slidingWindow": 20, + "alignPolicy": { + "alignMode": "Outer", + "fillNAMethod": "Linear", + "paddingValue": 0 + }, + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "dataSchema": "OneTable", + "startTime": "2019-04-01T00:00:00Z", + "endTime": "2019-04-02T00:00:00Z", + "displayName": "Devops-MultiAD" + } + }, + "responses": { + "201": { + "headers": { + "Location": "{Endpoint}/anomalydetector/v1.1/multivariate/models/{modelId}" + }, + "body": { + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "createdTime": "2020-06-30T00:00:00Z", + "lastUpdatedTime": "2020-06-30T00:00:00Z", + "modelInfo": { + "slidingWindow": 20, + "alignPolicy": { + "alignMode": "Outer", + "fillNAMethod": "Linear", + "paddingValue": 0 + }, + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "dataSchema": "OneTable", + "startTime": "2019-04-01T00:00:00Z", + "endTime": "2019-04-02T00:00:00Z", + "displayName": "Devops-MultiAD", + "status": "CREATED", + "errors": [] + } + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/AnomalyDetector/main.cadl b/specification/cognitiveservices/AnomalyDetector/main.cadl new file mode 100644 index 000000000000..f085513b35e7 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/main.cadl @@ -0,0 +1,52 @@ +import "@cadl-lang/rest"; +import "@cadl-lang/versioning"; +import "./univariate/routes.cadl"; +import "./multivariate/routes.cadl"; + +using Cadl.Rest; +using Cadl.Http; +using Cadl.Versioning; + +@versioned(APIVersion) +@service({ + title: "Anomaly Detector", +}) +@useAuth(ApiKeyAuth) +@server( + "{Endpoint}/anomalydetector/{ApiVersion}", + "The Anomaly Detector API detects anomalies automatically in time series data. It supports two kinds of mode, one is for stateless using, another is for stateful using. In stateless mode, there are three functionalities. Entire Detect is for detecting the whole series with model trained by the time series, Last Detect is detecting last point with model trained by points before. ChangePoint Detect is for detecting trend changes in time series. In stateful mode, user can store time series, the stored time series will be used for detection anomalies. Under this mode, user can still use the above three functionalities by only giving a time range without preparing time series in client side. Besides the above three functionalities, stateful model also provide group based detection and labeling service. By leveraging labeling service user can provide labels for each detection result, these labels will be used for retuning or regenerating detection models. Inconsistency detection is a kind of group based detection, this detection will find inconsistency ones in a set of time series. By using anomaly detector service, business customers can discover incidents and establish a logic flow for root cause analysis.", + { + @doc(""" +Supported Cognitive Services endpoints (protocol and hostname, for example: +https://westus2.api.cognitive.microsoft.com). +""") + Endpoint: string, + + @doc("Api Version") + @path + ApiVersion: APIVersion, + } +) +@doc(""" +The Anomaly Detector API detects anomalies automatically in time series data. +It supports two kinds of mode, one is for stateless using, another is for +stateful using. In stateless mode, there are three functionalities. Entire +Detect is for detecting the whole series with model trained by the time series, +Last Detect is detecting last point with model trained by points before. +ChangePoint Detect is for detecting trend changes in time series. In stateful +mode, user can store time series, the stored time series will be used for +detection anomalies. Under this mode, user can still use the above three +functionalities by only giving a time range without preparing time series in +client side. Besides the above three functionalities, stateful model also +provide group based detection and labeling service. By leveraging labeling +service user can provide labels for each detection result, these labels will be +used for retuning or regenerating detection models. Inconsistency detection is +a kind of group based detection, this detection will find inconsistency ones in +a set of time series. By using anomaly detector service, business customers can +discover incidents and establish a logic flow for root cause analysis. +""") +namespace AnomalyDetector; + +enum APIVersion { + v1_1: "v1.1", +} diff --git a/specification/cognitiveservices/AnomalyDetector/multivariate/models.cadl b/specification/cognitiveservices/AnomalyDetector/multivariate/models.cadl new file mode 100644 index 000000000000..6f72fb4486e7 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/multivariate/models.cadl @@ -0,0 +1,396 @@ +import "@cadl-lang/rest"; +import "@azure-tools/cadl-azure-core"; + +using Cadl.Http; +using Cadl.Rest; +using Azure.Core; + +namespace AnomalyDetector.Multivariate; + +@doc("An optional field, indicating how missing values will be filled. One of Previous, Subsequent, Linear, Zero, Fixed.") +enum FillNAMethod { + "Previous", + "Subsequent", + "Linear", + "Zero", + "Fixed", + "None", +} + +enum MultivariateBatchDetectionStatus { + Created: "CREATED", + Running: "RUNNING", + Ready: "READY", + Failed: "FAILED", +} + +@doc("Data schema of input data source: OneTable or MultiTable. The default DataSchema is OneTable.") +enum DataSchema { + @doc("OneTable means that your input data are all in one CSV file, which contains one 'timestamp' column and several variable columns. The default DataSchema is OneTable.") + "OneTable", + + @doc("MultiTable means that your input data are separated in multiple CSV files, in each file containing one 'timestamp' column and one 'variable' column, and the CSV file name should indicate the name of the variable. The default DataSchema is OneTable.") + "MultiTable", +} + +enum AlignMode { + "Inner", + "Outer", +} + +enum ModelStatus { + Created: "CREATED", + Running: "RUNNING", + Ready: "READY", + Failed: "FAILED", +} + +@doc("Detection results for the given resultId.") +@resource("multivariate/detect-batch") +model MultivariateDetectionResult { + @doc("Result identifier, which is used to fetch the results of an inference call.") + @key + @format("uuid") + resultId: string; + + @doc("Multivariate anomaly detection status.") + summary: MultivariateBatchDetectionResultSummary; + + @doc("Detection result for each timestamp.") + results: AnomalyState[]; +} + +@doc("Multivariate anomaly detection status.") +model MultivariateBatchDetectionResultSummary { + @doc("Status of detection results. One of CREATED, RUNNING, READY, and FAILED.") + status: MultivariateBatchDetectionStatus; + + @doc("Error message when detection is failed.") + errors?: ErrorResponse[]; + + @doc("Variable Status.") + variableStates?: VariableState[]; + + @doc(""" +Detection request for batch inference. This is an asynchronous inference which +will need another API to get detection results. +""") + setupInfo: MultivariateBatchDetectionOptions; +} + +@doc("ErrorResponse contains code and message that shows the error information.") +@error +model ErrorResponse { + @doc("The error code.") + code: string; + + @doc("The message explaining the error reported by the service.") + message: string; +} + +@doc("Variable Status.") +model VariableState { + @doc("Variable name in variable states.") + variable?: string; + + #suppress "@azure-tools/cadl-azure-core/casing-style" "Expected" + @doc("Proportion of missing values that need to be filled by fillNAMethod.") + @minValue(0.0) + @maxValue(1.0) + filledNARatio?: float32; + + @doc("Number of effective data points before applying fillNAMethod.") + effectiveCount?: int32; + + @doc("First valid timestamp with value of input data.") + firstTimestamp?: zonedDateTime; + + @doc("Last valid timestamp with value of input data.") + lastTimestamp?: zonedDateTime; +} + +@doc(""" +Detection request for batch inference. This is an asynchronous inference which +will need another API to get detection results. +""") +model MultivariateBatchDetectionOptions { + @doc(""" +Source link to the input data to indicate an accessible Azure storage Uri, +either pointed to an Azure blob storage folder, or pointed to a CSV file in +Azure blob storage based on you data schema selection. The data schema should +be exactly the same with those used in the training phase. +""") + dataSource: string; + + @doc(""" +An optional field, which is used to specify the number of top contributed +variables for one anomalous timestamp in the response. The default number is +10. +""") + topContributorCount: int32; + + @doc(""" +A required field, indicating the start time of data for detection, which should +be date-time of ISO 8601 format. +""") + startTime: zonedDateTime; + + @doc(""" +A required field, indicating the end time of data for detection, which should +be date-time of ISO 8601 format. +""") + endTime: zonedDateTime; +} + +@doc("Anomaly status and information.") +model AnomalyState { + @doc("The timestamp for this anomaly.") + timestamp: zonedDateTime; + + @doc("The detailed value of this anomalous timestamp.") + value?: AnomalyValue; + + @doc("Error message for the current timestamp.") + errors?: ErrorResponse[]; +} + +@doc("Detailed information of the anomalous timestamp.") +model AnomalyValue { + @doc("True if an anomaly is detected at the current timestamp.") + isAnomaly: boolean; + + @doc(""" +Indicates the significance of the anomaly. The higher the severity, the more +significant the anomaly is. +""") + @minValue(0.0) + @maxValue(1.0) + severity: float32; + + @doc(""" +Raw anomaly score of severity, will help indicate the degree of abnormality as +well. +""") + @minValue(0.0) + @maxValue(2.0) + score: float32; + + @doc("Interpretation of this anomalous timestamp.") + interpretation?: AnomalyInterpretation[]; +} + +@doc("Interpretation of the anomalous timestamp.") +model AnomalyInterpretation { + @doc("Variable.") + variable?: string; + + @doc(""" +This score shows the percentage contributing to the anomalous timestamp. A +number between 0 and 1. +""") + contributionScore?: float32; + + @doc("Correlation changes among the anomalous variables") + correlationChanges?: CorrelationChanges; +} + +@doc("Correlation changes among the anomalous variables") +model CorrelationChanges { + @doc("The correlated variables that have correlation changes under an anomaly.") + changedVariables?: string[]; +} + +@doc(""" +Training result of a model including its status, errors and diagnostics +information. +""") +model ModelInfo { + @doc(""" +Source link to the input data to indicate an accessible Azure storage Uri, +either pointed to an Azure blob storage folder, or pointed to a CSV file in +Azure blob storage based on you data schema selection. +""") + dataSource: string; + + @doc(""" +Data schema of input data source: OneTable or MultiTable. The default +DataSchema is OneTable. +""") + dataSchema?: DataSchema; + + @doc(""" +A required field, indicating the start time of training data, which should be +date-time of ISO 8601 format. +""") + startTime: zonedDateTime; + + @doc(""" +A required field, indicating the end time of training data, which should be +date-time of ISO 8601 format. +""") + endTime: zonedDateTime; + + @doc(""" +An optional field. The display name of the model whose maximum length is 24 +characters. +""") + @maxLength(24) + displayName?: string; + + @doc(""" +An optional field, indicating how many previous timestamps will be used to +detect whether the timestamp is anomaly or not. +""") + slidingWindow?: int32; + + @doc("An optional field, indicating the manner to align multiple variables.") + alignPolicy?: AlignPolicy; + + @doc("Model status. One of CREATED, RUNNING, READY, and FAILED.") + status?: ModelStatus; + + @visibility("read") + @doc("Error messages when failed to create a model.") + errors?: ErrorResponse[]; + + @doc("Diagnostics information to help inspect the states of model or variable.") + diagnosticsInfo?: DiagnosticsInfo; +} + +@doc("An optional field, indicating the manner to align multiple variables.") +model AlignPolicy { + @doc(""" +An optional field, indicating how to align different variables to the same +time-range. Either Inner or Outer. +""") + alignMode?: AlignMode; + + #suppress "@azure-tools/cadl-azure-core/casing-style" "Expected" + @doc(""" +An optional field, indicating how missing values will be filled. One of +Previous, Subsequent, Linear, Zero, Fixed. +""") + fillNAMethod?: FillNAMethod; + + @doc("An optional field. Required when fillNAMethod is Fixed.") + paddingValue?: float32; +} + +@doc("Diagnostics information to help inspect the states of model or variable.") +model DiagnosticsInfo { + @doc("Model status.") + modelState?: ModelState; + + @doc("Variable Status.") + variableStates?: VariableState[]; +} + +@doc("Model status.") +model ModelState { + @doc(""" +This indicates the number of passes of the entire training dataset the +algorithm has completed. +""") + epochIds?: int32[]; + + @doc(""" +List of metrics used to assess how the model fits the training data for each +epoch. +""") + trainLosses?: float32[]; + + @doc(""" +List of metrics used to assess how the model fits the validation set for each +epoch. +""") + validationLosses?: float32[]; + + @doc("Latency for each epoch. ") + latenciesInSeconds?: float32[]; +} + +@doc("Response of getting a model.") +@resource("multivariate/models") +model AnomalyDetectionModel { + @doc("Model identifier.") + @key + @format("uuid") + modelId: string; + + @doc("Date and time (UTC) when the model was created.") + createdTime: zonedDateTime; + + @doc("Date and time (UTC) when the model was last updated.") + lastUpdatedTime: zonedDateTime; + + @doc(""" +Training result of a model including its status, errors and diagnostics +information. +""") + modelInfo?: ModelInfo; +} + +@doc("Response of listing models.") +@pagedResult +model ModelList { + @doc("List of models.") + @items + models: AnomalyDetectionModel[]; + + @doc("Number of trained multivariate models.") + currentCount: int32; + + @doc("Maximum number of models that can be trained for this Anomaly Detector resource.") + maxCount: int32; + + @doc("The link to fetch more models.") + @nextLink + nextLink?: string; +} + +@doc("Request of last detection.") +model MultivariateLastDetectionOptions { + @doc(""" +This contains the inference data, including the name, timestamps(ISO 8601) and +values of variables. +""") + variables: VariableValues[]; + + @doc(""" +An optional field, which is used to specify the number of top contributed +variables for one anomalous timestamp in the response. The default number is +10. +""") + topContributorCount: int32; +} + +@doc("Variable values.") +model VariableValues { + @doc("Variable name of last detection request.") + variable: string; + + @doc("Timestamps of last detection request") + timestamps: string[]; + + @doc("Values of variables.") + values: float32[]; +} + +@doc("Results of last detection.") +model MultivariateLastDetectionResult { + @doc("Variable Status.") + variableStates?: VariableState[]; + + @doc("Anomaly status and information.") + results?: AnomalyState[]; +} + +@doc("Error response") +@error +model ResponseError { + #suppress "@azure-tools/cadl-azure-core/casing-style" "Expected" + @header + @doc("Error code.") + "x-ms-error-code"?: string; + ...ErrorResponse; +} diff --git a/specification/cognitiveservices/AnomalyDetector/multivariate/routes.cadl b/specification/cognitiveservices/AnomalyDetector/multivariate/routes.cadl new file mode 100644 index 000000000000..63b9b5b0b3ff --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/multivariate/routes.cadl @@ -0,0 +1,148 @@ +import "@azure-tools/cadl-azure-core"; +import "@cadl-lang/rest"; +import "./models.cadl"; + +using Cadl.Rest; +using Cadl.Http; + +namespace AnomalyDetector.Multivariate; + +@get +@route("/multivariate/detect-batch/{resultId}") +@summary("Get Multivariate Anomaly Detection Result") +@doc(""" +For asynchronous inference, get multivariate anomaly detection result based on +resultId returned by the BatchDetectAnomaly api. +""") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +GetMultivariateBatchDetectionResult( + @format("uuid") + @doc("ID of a batch detection result.") + @path + resultId: string +): MultivariateDetectionResult | ResponseError; + +@post +@route("/multivariate/models") +@summary("Train a Multivariate Anomaly Detection Model") +@doc(""" +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. +""") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +TrainMultivariateModel( + @doc("Model information.") + @body + modelInfo: ModelInfo +): { + @statusCode statusCode: 201; + + #suppress "@azure-tools/cadl-azure-core/casing-style" "Expected" + @doc("Location and ID of the model.") + @header + Location: string; + @body result: AnomalyDetectionModel; +} | ResponseError; + +@get +@route("/multivariate/models") +@summary("List Multivariate Models") +@doc("List models of a resource.") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +ListMultivariateModels( + @doc("Skip indicates how many models will be skipped.") + @query + skip?: int32 = 0, + + @doc("Top indicates how many models will be fetched.") + @query + top?: int32 +): ModelList | ResponseError; + +@summary("Delete Multivariate Model") +@doc("Delete an existing multivariate model according to the modelId") +@delete +@route("/multivariate/models/{modelId}") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +DeleteMultivariateModel( + @doc("Model identifier.") + @path + modelId: string +): { + @doc("Delete model successfully.") + @statusCode + statusCode: 204; +} | ResponseError; + +@summary("Get Multivariate Model") +@doc(""" +Get detailed information of multivariate model, including the training status +and variables used in the model. +""") +@get +@route("/multivariate/models/{modelId}") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +GetMultivariateModel( + @doc("Model identifier.") + @path + modelId: string +): AnomalyDetectionModel | ResponseError; + +@route("/multivariate/models/{modelId}:detect-batch") +@summary("Detect Multivariate Anomaly") +@doc(""" +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. +""") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +DetectMultivariateBatchAnomaly( + @doc("Model identifier.") + @path + modelId: string, + + #suppress "@azure-tools/cadl-azure-core/casing-style" "Expected" + @doc("Request of multivariate anomaly detection.") + @body + options: MultivariateBatchDetectionOptions +): { + @statusCode statusCode: 202; + + #suppress "@azure-tools/cadl-azure-core/casing-style" "Expected" + @doc("Id of the detection result.") + @header + "Operation-Id": string; + + #suppress "@azure-tools/cadl-azure-core/casing-style" "Expected" + @doc("Location of the detection result.") + @header + "Operation-Location": string; + @body result: MultivariateDetectionResult; +} | ResponseError; + +@route("/multivariate/models/{modelId}:detect-last") +@summary("Detect anomalies in the last point of the request body") +@doc(""" +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. +""") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +DetectMultivariateLastAnomaly( + @doc("Model identifier.") + @path + modelId: string, + + @doc("Request of last detection.") + @body + options: MultivariateLastDetectionOptions +): MultivariateLastDetectionResult | ResponseError; diff --git a/specification/cognitiveservices/AnomalyDetector/package.json b/specification/cognitiveservices/AnomalyDetector/package.json new file mode 100644 index 000000000000..f01b7fe12e59 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/package.json @@ -0,0 +1,10 @@ +{ + "name": "@cadl-api-spec/anomaly-detector", + "author": "Microsoft Corporation", + "description": "The Anomaly Detector API detects anomalies automatically in time series data. It supports two kinds of mode, one is for stateless using, another is for stateful using. In stateless mode, there are three functionalities. Entire Detect is for detecting the whole series with model trained by the time series, Last Detect is detecting last point with model trained by points before. ChangePoint Detect is for detecting trend changes in time series. In stateful mode, user can store time series, the stored time series will be used for detection anomalies. Under this mode, user can still use the above three functionalities by only giving a time range without preparing time series in client side. Besides the above three functionalities, stateful model also provide group based detection and labeling service. By leveraging labeling service user can provide labels for each detection result, these labels will be used for retuning or regenerating detection models. Inconsistency detection is a kind of group based detection, this detection will find inconsistency ones in a set of time series. By using anomaly detector service, business customers can discover incidents and establish a logic flow for root cause analysis.", + "license": "MIT", + "dependencies": { + "@azure-tools/cadl-autorest": "latest" + }, + "private": true +} diff --git a/specification/cognitiveservices/AnomalyDetector/univariate/models.cadl b/specification/cognitiveservices/AnomalyDetector/univariate/models.cadl new file mode 100644 index 000000000000..9f60910802a0 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/univariate/models.cadl @@ -0,0 +1,300 @@ +import "@cadl-lang/rest"; +import "@azure-tools/cadl-azure-core"; + +using Cadl.Http; +using Cadl.Rest; +using Azure.Core; + +namespace AnomalyDetector.Univariate; + +enum ImputeMode { + Auto: "auto", + Previous: "previous", + Linear: "linear", + Fixed: "fixed", + Zero: "zero", + NotFill: "notFill", +} + +enum AnomalyDetectorErrorCodes { + "InvalidCustomInterval", + "BadArgument", + "InvalidGranularity", + "InvalidPeriod", + "InvalidModelArgument", + "InvalidSeries", + "InvalidJsonFormat", + "RequiredGranularity", + "RequiredSeries", + "InvalidImputeMode", + "InvalidImputeFixedValue", +} + +enum TimeGranularity { + Yearly: "yearly", + Monthly: "monthly", + Weekly: "weekly", + Daily: "daily", + Hourly: "hourly", + PerMinute: "minutely", + PerSecond: "secondly", + Microsecond: "microsecond", + None: "none", +} + +@doc("The request of entire or last anomaly detection.") +model UnivariateDetectionOptions { + @doc(""" +Time series data points. Points should be sorted by timestamp in ascending +order to match the anomaly detection result. If the data is not sorted +correctly or there is duplicated timestamp, the API will not work. In such +case, an error message will be returned. +""") + series: TimeSeriesPoint[]; + + @doc(""" +Optional argument, can be one of yearly, monthly, weekly, daily, hourly, +minutely, secondly, microsecond or none. If granularity is not present, it will +be none by default. If granularity is none, the timestamp property in time +series point can be absent. +""") + granularity?: TimeGranularity; + + @doc(""" +Custom Interval is used to set non-standard time interval, for example, if the +series is 5 minutes, request can be set as {\"granularity\":\"minutely\", +\"customInterval\":5}. +""") + customInterval?: int32; + + @doc(""" +Optional argument, periodic value of a time series. If the value is null or +does not present, the API will determine the period automatically. +""") + period?: int32; + + @doc("Optional argument, advanced model parameter, max anomaly ratio in a time series.") + maxAnomalyRatio?: float32; + + @doc(""" +Optional argument, advanced model parameter, between 0-99, the lower the value +is, the larger the margin value will be which means less anomalies will be +accepted. +""") + sensitivity?: int32; + + @doc(""" +Used to specify how to deal with missing values in the input series, it's used +when granularity is not \"none\". +""") + imputeMode?: ImputeMode; + + @doc(""" +Used to specify the value to fill, it's used when granularity is not \"none\" +and imputeMode is \"fixed\". +""") + imputeFixedValue?: float32; +} + +@doc("The definition of input timeseries points.") +model TimeSeriesPoint { + @doc("Optional argument, timestamp of a data point (ISO8601 format).") + timestamp?: zonedDateTime; + + @doc("The measurement of that point, should be float.") + value: float32; +} + +@doc("The response of entire anomaly detection.") +model UnivariateEntireDetectionResult { + @doc(""" +Frequency extracted from the series, zero means no recurrent pattern has been +found. +""") + period: int32; + + @doc(""" +ExpectedValues contain expected value for each input point. The index of the +array is consistent with the input series. +""") + expectedValues: float32[]; + + @doc(""" +UpperMargins contain upper margin of each input point. UpperMargin is used to +calculate upperBoundary, which equals to expectedValue + (100 - +marginScale)*upperMargin. Anomalies in response can be filtered by +upperBoundary and lowerBoundary. By adjusting marginScale value, less +significant anomalies can be filtered in client side. The index of the array is +consistent with the input series. +""") + upperMargins: float32[]; + + @doc(""" +LowerMargins contain lower margin of each input point. LowerMargin is used to +calculate lowerBoundary, which equals to expectedValue - (100 - +marginScale)*lowerMargin. Points between the boundary can be marked as normal +ones in client side. The index of the array is consistent with the input +series. +""") + lowerMargins: float32[]; + + @doc(""" +IsAnomaly contains anomaly properties for each input point. True means an +anomaly either negative or positive has been detected. The index of the array +is consistent with the input series. +""") + isAnomaly: boolean[]; + + @doc(""" +IsNegativeAnomaly contains anomaly status in negative direction for each input +point. True means a negative anomaly has been detected. A negative anomaly +means the point is detected as an anomaly and its real value is smaller than +the expected one. The index of the array is consistent with the input series. +""") + isNegativeAnomaly: boolean[]; + + @doc(""" +IsPositiveAnomaly contain anomaly status in positive direction for each input +point. True means a positive anomaly has been detected. A positive anomaly +means the point is detected as an anomaly and its real value is larger than the +expected one. The index of the array is consistent with the input series. +""") + isPositiveAnomaly: boolean[]; + + @doc(""" +The severity score for each input point. The larger the value is, the more +sever the anomaly is. For normal points, the \"severity\" is always 0. +""") + severity?: float32[]; +} + +@doc("Error information returned by the API.") +@error +model AnomalyDetectorError { + #suppress "@azure-tools/cadl-azure-core/casing-style" "Expected" + @header + @doc("Error code.") + "x-ms-error-code"?: string; + + @doc("The error code.") + code?: AnomalyDetectorErrorCodes; + + @doc("A message explaining the error reported by the service.") + message?: string; +} + +@doc("The response of last anomaly detection.") +model UnivariateLastDetectionResult { + @doc(""" +Frequency extracted from the series, zero means no recurrent pattern has been +found. +""") + period: int32; + + @doc("Suggested input series points needed for detecting the latest point.") + suggestedWindow: int32; + + @doc("Expected value of the latest point.") + expectedValue: float32; + + @doc(""" +Upper margin of the latest point. UpperMargin is used to calculate +upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. +If the value of latest point is between upperBoundary and lowerBoundary, it +should be treated as normal value. By adjusting marginScale value, anomaly +status of latest point can be changed. +""") + upperMargin: float32; + + @doc(""" +Lower margin of the latest point. LowerMargin is used to calculate +lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin. + +""") + lowerMargin: float32; + + @doc(""" +Anomaly status of the latest point, true means the latest point is an anomaly +either in negative direction or positive direction. +""") + isAnomaly: boolean; + + @doc(""" +Anomaly status in negative direction of the latest point. True means the latest +point is an anomaly and its real value is smaller than the expected one. +""") + isNegativeAnomaly: boolean; + + @doc(""" +Anomaly status in positive direction of the latest point. True means the latest +point is an anomaly and its real value is larger than the expected one. +""") + isPositiveAnomaly: boolean; + + @doc(""" +The severity score for the last input point. The larger the value is, the more +sever the anomaly is. For normal points, the \"severity\" is always 0. +""") + severity?: float32; +} + +@doc("The request of change point detection.") +model UnivariateChangePointDetectionOptions { + @doc(""" +Time series data points. Points should be sorted by timestamp in ascending +order to match the change point detection result. +""") + series: TimeSeriesPoint[]; + + @doc(""" +Can only be one of yearly, monthly, weekly, daily, hourly, minutely or +secondly. Granularity is used for verify whether input series is valid. +""") + granularity: TimeGranularity; + + @doc(""" +Custom Interval is used to set non-standard time interval, for example, if the +series is 5 minutes, request can be set as {\"granularity\":\"minutely\", +\"customInterval\":5}. +""") + customInterval?: int32; + + @doc(""" +Optional argument, periodic value of a time series. If the value is null or +does not present, the API will determine the period automatically. +""") + period?: int32; + + @doc(""" +Optional argument, advanced model parameter, a default stableTrendWindow will +be used in detection. +""") + stableTrendWindow?: int32; + + @doc(""" +Optional argument, advanced model parameter, between 0.0-1.0, the lower the +value is, the larger the trend error will be which means less change point will +be accepted. +""") + threshold?: float32; +} + +@doc("The response of change point detection.") +model UnivariateChangePointDetectionResult { + @doc(""" +Frequency extracted from the series, zero means no recurrent pattern has been +found. +""") + @visibility("read") + period?: int32; + + @doc(""" +isChangePoint contains change point properties for each input point. True means +an anomaly either negative or positive has been detected. The index of the +array is consistent with the input series. +""") + isChangePoint?: boolean[]; + + @doc("the change point confidence of each point") + confidenceScores?: float32[]; +} diff --git a/specification/cognitiveservices/AnomalyDetector/univariate/routes.cadl b/specification/cognitiveservices/AnomalyDetector/univariate/routes.cadl new file mode 100644 index 000000000000..0312ff0b6570 --- /dev/null +++ b/specification/cognitiveservices/AnomalyDetector/univariate/routes.cadl @@ -0,0 +1,49 @@ +import "@azure-tools/cadl-azure-core"; +import "@cadl-lang/rest"; +import "./models.cadl"; + +using Cadl.Rest; +using Cadl.Http; + +namespace AnomalyDetector.Univariate; + +@post +@route("timeseries/entire/detect") +@summary("Detect anomalies for the entire series in batch.") +@doc(""" +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. +""") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +DetectUnivariateEntireSeries( + @doc("Method of univariate anomaly detection.") + @body + options: UnivariateDetectionOptions +): UnivariateEntireDetectionResult | AnomalyDetectorError; + +@post +@route("timeseries/last/detect") +@summary("Detect anomaly status of the latest point in time series.") +@doc(""" +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. +""") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +DetectUnivariateLastPoint( + @doc("Method of univariate anomaly detection.") + @body + options: UnivariateDetectionOptions +): UnivariateLastDetectionResult | AnomalyDetectorError; + +@post +@route("timeseries/changepoint/detect") +@summary("Detect change point for the entire series") +@doc("Evaluate change point score of every series point") +op // To improve CADL implementation apply: https://github.com/Azure/azure-rest-api-specs/issues/21527 +DetectUnivariateChangePoint( + @doc("Method of univariate anomaly detection.") + @body + options: UnivariateChangePointDetectionOptions +): UnivariateChangePointDetectionResult | AnomalyDetectorError; diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/readme.md b/specification/cognitiveservices/data-plane/AnomalyDetector/readme.md index 9b273cb1d685..f7b8cf91dd6d 100644 --- a/specification/cognitiveservices/data-plane/AnomalyDetector/readme.md +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/readme.md @@ -4,10 +4,10 @@ Configuration for generating Anomaly Detector SDK. -The current release is `release_1_1_preview.2`. +The current release is `release_1_1`. ``` yaml -tag: release_1_1_preview.2 +tag: release_1_1 add-credentials: true openapi-type: data-plane ``` @@ -49,6 +49,14 @@ input-file: - preview/v1.1-preview.2/RootCauseAnalysis.json ``` +### Release 1.1 +These settings apply only when `--tag=release_1_1` is specified on the command line. + +```yaml $(tag) == 'release_1_1' +input-file: + - stable/v1.1/openapi.json +``` + ## Swagger to SDK This section describes what SDK should be generated by the automatic system. @@ -82,19 +90,7 @@ See configuration in [readme.go.md](./readme.go.md) ## Java -These settings apply only when `--java` is specified on the command line. -Please also specify `--azure-libraries-for-java-folder=`. - -```yaml $(java) -azure-arm: true -namespace: com.microsoft.azure.cognitiveservices.anomalydetector -license-header: MICROSOFT_MIT_NO_CODEGEN -payload-flattening-threshold: 1 -output-folder: $(azure-libraries-for-java-folder)/cognitiveservices/data-plane/anomalydetector -with-optional-parameters: true -with-single-async-method: true -regenerate-manager: true -``` +See configuration in [readme.java.md](./readme.java.md) ## Multi-API/Profile support for AutoRest v3 generators @@ -109,6 +105,7 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - $(this-folder)/stable/v1.0/AnomalyDetector.json + - $(this-folder)/stable/v1.1/openapi.json - $(this-folder)/preview/v1.1-preview/MultivariateAnomalyDetector.json - $(this-folder)/preview/v1.1-preview.1/MultivariateAnomalyDetector.json - $(this-folder)/preview/v1.1-preview.2/AnomalyDetector.json @@ -123,3 +120,4 @@ uncomment the `exclude-file` section below and add the file paths. #exclude-file: # - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json ``` + diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/ChangePointDetect.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/ChangePointDetect.json new file mode 100644 index 000000000000..961b008f896a --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/ChangePointDetect.json @@ -0,0 +1,1572 @@ +{ + "operationId": "Univariate_DetectUnivariateChangePoint", + "title": "Univariate detection of a change point", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "series": [ + { + "timestamp": "2017-01-01T06:45:00Z", + "value": 1639196 + }, + { + "timestamp": "2017-01-01T06:50:00Z", + "value": 1639290 + }, + { + "timestamp": "2017-01-01T06:55:00Z", + "value": 1667293 + }, + { + "timestamp": "2017-01-01T07:00:00Z", + "value": 1703130 + }, + { + "timestamp": "2017-01-01T07:05:00Z", + "value": 1650912 + }, + { + "timestamp": "2017-01-01T07:10:00Z", + "value": 1653596 + }, + { + "timestamp": "2017-01-01T07:15:00Z", + "value": 1653793 + }, + { + "timestamp": "2017-01-01T07:20:00Z", + "value": 1653795 + }, + { + "timestamp": "2017-01-01T07:25:00Z", + "value": 1663471 + }, + { + "timestamp": "2017-01-01T07:30:00Z", + "value": 1662358 + }, + { + "timestamp": "2017-01-01T07:35:00Z", + "value": 1664320 + }, + { + "timestamp": "2017-01-01T07:40:00Z", + "value": 1664942 + }, + { + "timestamp": "2017-01-01T07:45:00Z", + "value": 1664966 + }, + { + "timestamp": "2017-01-01T07:50:00Z", + "value": 1724271 + }, + { + "timestamp": "2017-01-01T07:55:00Z", + "value": 1678720 + }, + { + "timestamp": "2017-01-01T08:00:00Z", + "value": 1672536 + }, + { + "timestamp": "2017-01-01T08:05:00Z", + "value": 1672544 + }, + { + "timestamp": "2017-01-01T08:10:00Z", + "value": 1672364 + }, + { + "timestamp": "2017-01-01T08:15:00Z", + "value": 1672912 + }, + { + "timestamp": "2017-01-01T08:20:00Z", + "value": 1672736 + }, + { + "timestamp": "2017-01-01T08:25:00Z", + "value": 1672725 + }, + { + "timestamp": "2017-01-01T08:30:00Z", + "value": 1673247 + }, + { + "timestamp": "2017-01-01T08:35:00Z", + "value": 1673109 + }, + { + "timestamp": "2017-01-01T08:40:00Z", + "value": 1690088 + }, + { + "timestamp": "2017-01-01T08:45:00Z", + "value": 1703865 + }, + { + "timestamp": "2017-01-01T08:50:00Z", + "value": 1703865 + }, + { + "timestamp": "2017-01-01T08:55:00Z", + "value": 1786581 + }, + { + "timestamp": "2017-01-01T09:00:00Z", + "value": 1800945 + }, + { + "timestamp": "2017-01-01T09:05:00Z", + "value": 1800957 + }, + { + "timestamp": "2017-01-01T09:10:00Z", + "value": 1801191 + }, + { + "timestamp": "2017-01-01T09:15:00Z", + "value": 1801412 + }, + { + "timestamp": "2017-01-01T09:20:00Z", + "value": 1801621 + }, + { + "timestamp": "2017-01-01T09:25:00Z", + "value": 1801621 + }, + { + "timestamp": "2017-01-01T09:30:00Z", + "value": 1801654 + }, + { + "timestamp": "2017-01-01T09:35:00Z", + "value": 1802105 + }, + { + "timestamp": "2017-01-01T09:40:00Z", + "value": 1801800 + }, + { + "timestamp": "2017-01-01T09:45:00Z", + "value": 1803040 + }, + { + "timestamp": "2017-01-01T09:50:00Z", + "value": 1803672 + }, + { + "timestamp": "2017-01-01T09:55:00Z", + "value": 1803535 + }, + { + "timestamp": "2017-01-01T10:00:00Z", + "value": 1803541 + }, + { + "timestamp": "2017-01-01T10:05:00Z", + "value": 1803545 + }, + { + "timestamp": "2017-01-01T10:10:00Z", + "value": 1803599 + }, + { + "timestamp": "2017-01-01T10:15:00Z", + "value": 1803616 + }, + { + "timestamp": "2017-01-01T10:20:00Z", + "value": 1803619 + }, + { + "timestamp": "2017-01-01T10:25:00Z", + "value": 1809942 + }, + { + "timestamp": "2017-01-01T10:30:00Z", + "value": 1802720 + }, + { + "timestamp": "2017-01-01T10:35:00Z", + "value": 1802720 + }, + { + "timestamp": "2017-01-01T10:40:00Z", + "value": 1802888 + }, + { + "timestamp": "2017-01-01T10:45:00Z", + "value": 1809574 + }, + { + "timestamp": "2017-01-01T10:50:00Z", + "value": 1803896 + }, + { + "timestamp": "2017-01-01T10:55:00Z", + "value": 1803850 + }, + { + "timestamp": "2017-01-01T11:00:00Z", + "value": 1803854 + }, + { + "timestamp": "2017-01-01T11:05:00Z", + "value": 1803854 + }, + { + "timestamp": "2017-01-01T11:10:00Z", + "value": 1803797 + }, + { + "timestamp": "2017-01-01T11:15:00Z", + "value": 1803921 + }, + { + "timestamp": "2017-01-01T11:20:00Z", + "value": 1803933 + }, + { + "timestamp": "2017-01-01T11:25:00Z", + "value": 1804040 + }, + { + "timestamp": "2017-01-01T11:30:00Z", + "value": 1804044 + }, + { + "timestamp": "2017-01-01T11:35:00Z", + "value": 1804070 + }, + { + "timestamp": "2017-01-01T11:40:00Z", + "value": 1804070 + }, + { + "timestamp": "2017-01-01T11:45:00Z", + "value": 1804068 + }, + { + "timestamp": "2017-01-01T11:50:00Z", + "value": 1804073 + }, + { + "timestamp": "2017-01-01T11:55:00Z", + "value": 1804101 + }, + { + "timestamp": "2017-01-01T12:00:00Z", + "value": 1804674 + }, + { + "timestamp": "2017-01-01T12:05:00Z", + "value": 1804714 + }, + { + "timestamp": "2017-01-01T12:10:00Z", + "value": 1804730 + }, + { + "timestamp": "2017-01-01T12:15:00Z", + "value": 1804816 + }, + { + "timestamp": "2017-01-01T12:20:00Z", + "value": 1803996 + }, + { + "timestamp": "2017-01-01T12:25:00Z", + "value": 1803998 + }, + { + "timestamp": "2017-01-01T12:30:00Z", + "value": 1804015 + }, + { + "timestamp": "2017-01-01T12:35:00Z", + "value": 1804047 + }, + { + "timestamp": "2017-01-01T12:40:00Z", + "value": 1804050 + }, + { + "timestamp": "2017-01-01T12:45:00Z", + "value": 1804218 + }, + { + "timestamp": "2017-01-01T12:50:00Z", + "value": 1804217 + }, + { + "timestamp": "2017-01-01T12:55:00Z", + "value": 1804217 + }, + { + "timestamp": "2017-01-01T13:00:00Z", + "value": 1804205 + }, + { + "timestamp": "2017-01-01T13:05:00Z", + "value": 1804728 + }, + { + "timestamp": "2017-01-01T13:10:00Z", + "value": 1804748 + }, + { + "timestamp": "2017-01-01T13:15:00Z", + "value": 1805232 + }, + { + "timestamp": "2017-01-01T13:20:00Z", + "value": 1814121 + }, + { + "timestamp": "2017-01-01T13:25:00Z", + "value": 1806789 + }, + { + "timestamp": "2017-01-01T13:30:00Z", + "value": 1806119 + }, + { + "timestamp": "2017-01-01T13:35:00Z", + "value": 1806329 + }, + { + "timestamp": "2017-01-01T13:40:00Z", + "value": 1806454 + }, + { + "timestamp": "2017-01-01T13:45:00Z", + "value": 1806852 + }, + { + "timestamp": "2017-01-01T13:50:00Z", + "value": 1807347 + }, + { + "timestamp": "2017-01-01T13:55:00Z", + "value": 1812144 + }, + { + "timestamp": "2017-01-01T14:00:00Z", + "value": 1807418 + }, + { + "timestamp": "2017-01-01T14:05:00Z", + "value": 1807418 + }, + { + "timestamp": "2017-01-01T14:10:00Z", + "value": 1807432 + }, + { + "timestamp": "2017-01-01T14:15:00Z", + "value": 1808540 + }, + { + "timestamp": "2017-01-01T14:20:00Z", + "value": 1808541 + }, + { + "timestamp": "2017-01-01T14:25:00Z", + "value": 1807831 + }, + { + "timestamp": "2017-01-01T14:30:00Z", + "value": 1807852 + }, + { + "timestamp": "2017-01-01T14:35:00Z", + "value": 1807811 + }, + { + "timestamp": "2017-01-01T14:40:00Z", + "value": 2214285 + }, + { + "timestamp": "2017-01-01T14:45:00Z", + "value": 2215019 + }, + { + "timestamp": "2017-01-01T14:50:00Z", + "value": 2215329 + }, + { + "timestamp": "2017-01-01T14:55:00Z", + "value": 2215097 + }, + { + "timestamp": "2017-01-01T15:00:00Z", + "value": 2215129 + }, + { + "timestamp": "2017-01-01T15:05:00Z", + "value": 2215120 + }, + { + "timestamp": "2017-01-01T15:10:00Z", + "value": 2217056 + }, + { + "timestamp": "2017-01-01T15:15:00Z", + "value": 2217056 + }, + { + "timestamp": "2017-01-01T15:20:00Z", + "value": 2222126 + }, + { + "timestamp": "2017-01-01T15:25:00Z", + "value": 2226472 + }, + { + "timestamp": "2017-01-01T15:30:00Z", + "value": 2226722 + }, + { + "timestamp": "2017-01-01T15:35:00Z", + "value": 2226729 + }, + { + "timestamp": "2017-01-01T15:40:00Z", + "value": 2226735 + }, + { + "timestamp": "2017-01-01T15:45:00Z", + "value": 2226735 + }, + { + "timestamp": "2017-01-01T15:50:00Z", + "value": 2226735 + }, + { + "timestamp": "2017-01-01T15:55:00Z", + "value": 2226952 + }, + { + "timestamp": "2017-01-01T16:00:00Z", + "value": 2226962 + }, + { + "timestamp": "2017-01-01T16:05:00Z", + "value": 2649337 + }, + { + "timestamp": "2017-01-01T16:10:00Z", + "value": 2092796 + }, + { + "timestamp": "2017-01-01T16:15:00Z", + "value": 2092839 + }, + { + "timestamp": "2017-01-01T16:20:00Z", + "value": 2092940 + }, + { + "timestamp": "2017-01-01T16:25:00Z", + "value": 2092940 + }, + { + "timestamp": "2017-01-01T16:30:00Z", + "value": 2092965 + }, + { + "timestamp": "2017-01-01T16:35:00Z", + "value": 2092979 + }, + { + "timestamp": "2017-01-01T16:40:00Z", + "value": 2095588 + }, + { + "timestamp": "2017-01-01T16:45:00Z", + "value": 2099586 + }, + { + "timestamp": "2017-01-01T16:50:00Z", + "value": 2102981 + }, + { + "timestamp": "2017-01-01T16:55:00Z", + "value": 2108053 + }, + { + "timestamp": "2017-01-01T17:00:00Z", + "value": 2107907 + }, + { + "timestamp": "2017-01-01T17:05:00Z", + "value": 2108241 + }, + { + "timestamp": "2017-01-01T17:10:00Z", + "value": 2100321 + }, + { + "timestamp": "2017-01-01T17:15:00Z", + "value": 2100448 + }, + { + "timestamp": "2017-01-01T17:20:00Z", + "value": 2100483 + }, + { + "timestamp": "2017-01-01T17:25:00Z", + "value": 2103042 + }, + { + "timestamp": "2017-01-01T17:30:00Z", + "value": 2103037 + }, + { + "timestamp": "2017-01-01T17:35:00Z", + "value": 2103040 + }, + { + "timestamp": "2017-01-01T17:40:00Z", + "value": 2103054 + }, + { + "timestamp": "2017-01-01T17:45:00Z", + "value": 2103058 + }, + { + "timestamp": "2017-01-01T17:50:00Z", + "value": 1830757 + }, + { + "timestamp": "2017-01-01T17:55:00Z", + "value": 1830855 + }, + { + "timestamp": "2017-01-01T18:00:00Z", + "value": 1831495 + }, + { + "timestamp": "2017-01-01T18:05:00Z", + "value": 1831463 + }, + { + "timestamp": "2017-01-01T18:10:00Z", + "value": 1831963 + }, + { + "timestamp": "2017-01-01T18:15:00Z", + "value": 1832046 + }, + { + "timestamp": "2017-01-01T18:20:00Z", + "value": 1832070 + }, + { + "timestamp": "2017-01-01T18:25:00Z", + "value": 1835511 + }, + { + "timestamp": "2017-01-01T18:30:00Z", + "value": 1835265 + }, + { + "timestamp": "2017-01-01T18:35:00Z", + "value": 1835481 + }, + { + "timestamp": "2017-01-01T18:40:00Z", + "value": 1835578 + }, + { + "timestamp": "2017-01-01T18:45:00Z", + "value": 1835611 + }, + { + "timestamp": "2017-01-01T18:50:00Z", + "value": 1836314 + }, + { + "timestamp": "2017-01-01T18:55:00Z", + "value": 1836369 + }, + { + "timestamp": "2017-01-01T19:00:00Z", + "value": 1837280 + }, + { + "timestamp": "2017-01-01T19:05:00Z", + "value": 1842939 + }, + { + "timestamp": "2017-01-01T19:10:00Z", + "value": 1843126 + }, + { + "timestamp": "2017-01-01T19:15:00Z", + "value": 1845840 + }, + { + "timestamp": "2017-01-01T19:20:00Z", + "value": 1842444 + }, + { + "timestamp": "2017-01-01T19:25:00Z", + "value": 1839891 + }, + { + "timestamp": "2017-01-01T19:30:00Z", + "value": 1839875 + }, + { + "timestamp": "2017-01-01T19:35:00Z", + "value": 1839870 + }, + { + "timestamp": "2017-01-01T19:40:00Z", + "value": 1840090 + }, + { + "timestamp": "2017-01-01T19:45:00Z", + "value": 1840479 + }, + { + "timestamp": "2017-01-01T19:50:00Z", + "value": 1840479 + }, + { + "timestamp": "2017-01-01T19:55:00Z", + "value": 1840482 + }, + { + "timestamp": "2017-01-01T20:00:00Z", + "value": 1841522 + }, + { + "timestamp": "2017-01-01T20:05:00Z", + "value": 1841836 + }, + { + "timestamp": "2017-01-01T20:10:00Z", + "value": 1842377 + }, + { + "timestamp": "2017-01-01T20:15:00Z", + "value": 1842388 + }, + { + "timestamp": "2017-01-01T20:20:00Z", + "value": 1842489 + }, + { + "timestamp": "2017-01-01T20:25:00Z", + "value": 1842489 + }, + { + "timestamp": "2017-01-01T20:30:00Z", + "value": 1842489 + }, + { + "timestamp": "2017-01-01T20:35:00Z", + "value": 1842496 + }, + { + "timestamp": "2017-01-01T20:40:00Z", + "value": 1842689 + }, + { + "timestamp": "2017-01-01T20:45:00Z", + "value": 1843117 + }, + { + "timestamp": "2017-01-01T20:50:00Z", + "value": 1843116 + }, + { + "timestamp": "2017-01-01T20:55:00Z", + "value": 1843227 + }, + { + "timestamp": "2017-01-01T21:00:00Z", + "value": 1843138 + }, + { + "timestamp": "2017-01-01T21:05:00Z", + "value": 1843141 + }, + { + "timestamp": "2017-01-01T21:10:00Z", + "value": 1843310 + }, + { + "timestamp": "2017-01-01T21:15:00Z", + "value": 1843310 + }, + { + "timestamp": "2017-01-01T21:20:00Z", + "value": 1843507 + }, + { + "timestamp": "2017-01-01T21:25:00Z", + "value": 1843953 + }, + { + "timestamp": "2017-01-01T21:30:00Z", + "value": 1844778 + }, + { + "timestamp": "2017-01-01T21:35:00Z", + "value": 1843918 + }, + { + "timestamp": "2017-01-01T21:40:00Z", + "value": 1882692 + }, + { + "timestamp": "2017-01-01T21:45:00Z", + "value": 1974888 + }, + { + "timestamp": "2017-01-01T21:50:00Z", + "value": 2157136 + }, + { + "timestamp": "2017-01-01T21:55:00Z", + "value": 2154987 + }, + { + "timestamp": "2017-01-01T22:00:00Z", + "value": 2155664 + }, + { + "timestamp": "2017-01-01T22:05:00Z", + "value": 2155660 + }, + { + "timestamp": "2017-01-01T22:10:00Z", + "value": 2155824 + }, + { + "timestamp": "2017-01-01T22:15:00Z", + "value": 2155824 + }, + { + "timestamp": "2017-01-01T22:20:00Z", + "value": 2156329 + }, + { + "timestamp": "2017-01-01T22:25:00Z", + "value": 2156479 + }, + { + "timestamp": "2017-01-01T22:30:00Z", + "value": 2165269 + }, + { + "timestamp": "2017-01-01T22:35:00Z", + "value": 2165433 + }, + { + "timestamp": "2017-01-01T22:40:00Z", + "value": 2165739 + }, + { + "timestamp": "2017-01-01T22:45:00Z", + "value": 2165931 + }, + { + "timestamp": "2017-01-01T22:50:00Z", + "value": 2165928 + }, + { + "timestamp": "2017-01-01T22:55:00Z", + "value": 2165989 + }, + { + "timestamp": "2017-01-01T23:00:00Z", + "value": 2228961 + }, + { + "timestamp": "2017-01-01T23:05:00Z", + "value": 2228961 + }, + { + "timestamp": "2017-01-01T23:10:00Z", + "value": 2228961 + }, + { + "timestamp": "2017-01-01T23:15:00Z", + "value": 2485802 + }, + { + "timestamp": "2017-01-01T23:20:00Z", + "value": 2485802 + }, + { + "timestamp": "2017-01-01T23:25:00Z", + "value": 2486021 + }, + { + "timestamp": "2017-01-01T23:30:00Z", + "value": 2485293 + }, + { + "timestamp": "2017-01-01T23:35:00Z", + "value": 2485293 + }, + { + "timestamp": "2017-01-01T23:40:00Z", + "value": 2485324 + }, + { + "timestamp": "2017-01-01T23:45:00Z", + "value": 2489142 + }, + { + "timestamp": "2017-01-01T23:50:00Z", + "value": 2526312 + }, + { + "timestamp": "2017-01-01T23:55:00Z", + "value": 2526313 + }, + { + "timestamp": "2017-01-02T00:00:00Z", + "value": 2526314 + }, + { + "timestamp": "2017-01-02T00:05:00Z", + "value": 2526324 + }, + { + "timestamp": "2017-01-02T00:10:00Z", + "value": 2526325 + }, + { + "timestamp": "2017-01-02T00:15:00Z", + "value": 2526205 + }, + { + "timestamp": "2017-01-02T00:20:00Z", + "value": 2526226 + }, + { + "timestamp": "2017-01-02T00:25:00Z", + "value": 2526475 + }, + { + "timestamp": "2017-01-02T00:30:00Z", + "value": 2526471 + }, + { + "timestamp": "2017-01-02T00:35:00Z", + "value": 2526471 + }, + { + "timestamp": "2017-01-02T00:40:00Z", + "value": 2526534 + }, + { + "timestamp": "2017-01-02T00:45:00Z", + "value": 2526646 + }, + { + "timestamp": "2017-01-02T00:50:00Z", + "value": 2526646 + }, + { + "timestamp": "2017-01-02T00:55:00Z", + "value": 2526648 + }, + { + "timestamp": "2017-01-02T01:00:00Z", + "value": 2526658 + }, + { + "timestamp": "2017-01-02T01:05:00Z", + "value": 2526771 + }, + { + "timestamp": "2017-01-02T01:10:00Z", + "value": 2526773 + }, + { + "timestamp": "2017-01-02T01:15:00Z", + "value": 2526793 + }, + { + "timestamp": "2017-01-02T01:20:00Z", + "value": 2527010 + }, + { + "timestamp": "2017-01-02T01:25:00Z", + "value": 2527031 + }, + { + "timestamp": "2017-01-02T01:30:00Z", + "value": 3178096 + }, + { + "timestamp": "2017-01-02T01:35:00Z", + "value": 3196305 + }, + { + "timestamp": "2017-01-02T01:40:00Z", + "value": 3196202 + }, + { + "timestamp": "2017-01-02T01:45:00Z", + "value": 3196202 + }, + { + "timestamp": "2017-01-02T01:50:00Z", + "value": 3196205 + }, + { + "timestamp": "2017-01-02T01:55:00Z", + "value": 3229232 + }, + { + "timestamp": "2017-01-02T02:00:00Z", + "value": 3230463 + }, + { + "timestamp": "2017-01-02T02:05:00Z", + "value": 3230468 + }, + { + "timestamp": "2017-01-02T02:10:00Z", + "value": 3230468 + }, + { + "timestamp": "2017-01-02T02:15:00Z", + "value": 3230468 + }, + { + "timestamp": "2017-01-02T02:20:00Z", + "value": 3230470 + }, + { + "timestamp": "2017-01-02T02:25:00Z", + "value": 3230467 + }, + { + "timestamp": "2017-01-02T02:30:00Z", + "value": 3230506 + }, + { + "timestamp": "2017-01-02T02:35:00Z", + "value": 3231536 + }, + { + "timestamp": "2017-01-02T02:40:00Z", + "value": 3230723 + }, + { + "timestamp": "2017-01-02T02:45:00Z", + "value": 3230727 + }, + { + "timestamp": "2017-01-02T02:50:00Z", + "value": 3230727 + }, + { + "timestamp": "2017-01-02T02:55:00Z", + "value": 3230727 + }, + { + "timestamp": "2017-01-02T03:00:00Z", + "value": 3231880 + }, + { + "timestamp": "2017-01-02T03:05:00Z", + "value": 3232283 + }, + { + "timestamp": "2017-01-02T03:10:00Z", + "value": 3232283 + }, + { + "timestamp": "2017-01-02T03:15:00Z", + "value": 3232283 + }, + { + "timestamp": "2017-01-02T03:20:00Z", + "value": 3232325 + }, + { + "timestamp": "2017-01-02T03:25:00Z", + "value": 3232323 + }, + { + "timestamp": "2017-01-02T03:30:00Z", + "value": 3232327 + }, + { + "timestamp": "2017-01-02T03:35:00Z", + "value": 3232340 + }, + { + "timestamp": "2017-01-02T03:40:00Z", + "value": 3232713 + }, + { + "timestamp": "2017-01-02T03:45:00Z", + "value": 3232729 + }, + { + "timestamp": "2017-01-02T03:50:00Z", + "value": 3232756 + }, + { + "timestamp": "2017-01-02T03:55:00Z", + "value": 3233500 + }, + { + "timestamp": "2017-01-02T04:00:00Z", + "value": 3233500 + }, + { + "timestamp": "2017-01-02T04:05:00Z", + "value": 3233500 + } + ], + "granularity": "minutely", + "customInterval": 5, + "stableTrendWindow": 10, + "threshold": 0.99, + "period": 0 + } + }, + "responses": { + "200": { + "body": { + "period": 0, + "confidenceScores": [ + 0.11841763735063232, + 0.014857199927548581, + 0.0887032374955278, + 0.07430314751946857, + 0.059903057543409355, + 0.04132288981790399, + 0.022742722092391268, + 0.0005683208474757854, + 0.0216060803974397, + 0.053248991089971616, + 0.08489190178249614, + 0.04322511558132514, + 0.085336620199234, + 0.05876047041512903, + 0.02673755265447302, + 0.005032027060762012, + 0.031323171543775764, + 0.06299774949197792, + 0.08944723025337244, + 0.11523169864554421, + 0.14288453512268834, + 0.001592562559717675, + 0.32637788222282893, + 0, + 7.37310752217245e-15, + 2.211932256651735e-14, + 1, + 0.015697015891758138, + 0.01242773215043403, + 0.016188579169534697, + 0.019537751864826272, + 0.022506917491993753, + 0.01885762668253081, + 0.016253355310429398, + 0.017227483829906676, + 0.023236706002118527, + 0.03906277743439327, + 0.0354134866249377, + 0.037084294769315296, + 0.038248426822850935, + 0.050274427573818385, + 0.046815140298421175, + 0.043292518511668716, + 0.041353259508804745, + 0.038242312045861385, + 0.0346880230034313, + 0.032717096744889713, + 0.033026212895129546, + 0.031055286636580585, + 0.0275326648498355, + 0.023883374040372555, + 0.021564107969369743, + 0.018706498551854727, + 0.01543721481052325, + 0.015176320358565887, + 0.011527029549110314, + 0.008004407762357859, + 0.004355116952902286, + 0.0007058261434393403, + 0.0030701336887340946, + 0.006592755475479178, + 0.010147044517909256, + 0.013701333560339335, + 0.016780613767597707, + 0.020366570065705403, + 0.024015860875168354, + 0.02757014991759106, + 0.03033275756808058, + 0.03068865378707081, + 0.03395793752839492, + 0.03760722833785786, + 0.04122485189164318, + 0.030433874112103007, + 0.032816474694461056, + 0.03602242392443729, + 0.03960838022253762, + 0.04268766042980336, + 0.04633695123926631, + 0.0346592903007527, + 0.010219725324164698, + 0.007218892441326965, + 0.006909776291079754, + 0.000049463551460760754, + 0.0016047901503119819, + 0.01042121060065547, + 0.009020294944303705, + 0.005371004134840759, + 0.0021650549048718984, + 0.010517653997227793, + 0.0075017083013172925, + 0.00385241749186172, + 0.0008681390516288423, + 0.019005920148370017, + 0.015388296594592068, + 0.12583612799160215, + 1, + 0.005055878353042495, + 0.007613932468790628, + 0.011913685646822731, + 0.0166567804043268, + 0.015351429327405014, + 0.034309821169245976, + 0.0292817211106433, + 0.02425362105202589, + 0.019225520993423218, + 0.01419742093482055, + 0.00916932087621788, + 0.004141220817600464, + 0.0008868792410022057, + 0.0059149792996048755, + 0.010943079358207547, + 0.015971179416810213, + 0.02099927947542763, + 1, + 0.11533376425564247, + 0.1207645081246342, + 0.025174230145423273, + 0.09422487163021387, + 0.08417070843230404, + 0.07411654523437947, + 0.06406238203646963, + 0.0540082188385598, + 0.04395405564064997, + 0.03500824639144218, + 0.024954083193532338, + 0.014899919995622513, + 0.004845756797712681, + 0.005208406400211895, + 0.015262569598121728, + 0.025316732796031558, + 0.03537089599394139, + 0.045425059191865964, + 0.05145748091871777, + 1, + 0.011663506282381296, + 0.0043856580970499884, + 0.002892190088273945, + 0.01017003827359788, + 0.01744788645892181, + 0.024725734644253115, + 0.03200358282957705, + 0.03928143101490098, + 0.046559279200224915, + 0.05383712738555622, + 0.060069956133518614, + 0.0450857235774741, + 0.050621872700536176, + 0.029050850963546225, + 0.045689493056171517, + 0.0385699811492357, + 0.03179880905474635, + 0.03082274474926925, + 0.03586345902254038, + 0.028585610837209074, + 0.021402764418918006, + 0.04705886213832124, + 0.049724532235770696, + 0.05957866937203304, + 0.052649160999162954, + 0.045371312813839014, + 0.03809346462851508, + 0.030815616443183775, + 0.023537768257859845, + 0.01945831289597576, + 0.012180464710644455, + 0.00490261652532052, + 0.002153560870260057, + 0.0033196287098028916, + 0.0029244412792105113, + 0.0043217396504358, + 0.010934575466529664, + 0.018117421884820732, + 0.02267188608187652, + 0.027321352045957807, + 0.03459920023128174, + 0.03563859904812146, + 0.02990120514994264, + 0.03607069938654979, + 0.017223061637835352, + 7.37310752217245e-15, + 1.47462150443449e-14, + 1, + 0.046440552438977135, + 0.012233652454378385, + 0.017033155644526038, + 0.05136672465183527, + 0.06970832954194527, + 0.09929181019761117, + 0.11281999222473732, + 0.11039622919405537, + 0.08125609011787617, + 0.05661270134791935, + 0.028264243663680723, + 0.005974323576610399, + 0.038471191754617544, + 0, + 0, + 0, + 0.020288532128574968, + 0.005041879493223223, + 0.009223088216122232, + 0.009332792637570532, + 0.024579445272937026, + 0.03289096891488949, + 0.050695883419617865, + 1, + 0.000748013913075547, + 0.002186373999917361, + 0.0009330173541465358, + 0.00032033929162428933, + 0.0012886906362965138, + 0.002542047282052593, + 0.0007963481454318109, + 0.0004886757560166365, + 0.0016470306347398486, + 0.001063686451208582, + 0.0011980222832366648, + 0.00008700161821178273, + 0.0013086910082902394, + 0.0022770423529624643, + 0.000016333637160404937, + 0.0012053557529180517, + 0.0018570345408140537, + 0.0037297360397815314, + 0.003109724507563151, + 0.22869458705263188, + 0.2293374323429407, + 0.1140021204394844, + 0.0012381896969537412, + 0.11340677603264777, + 1, + 0.011793249472519423, + 0.008293225072094536, + 0.00469819890465153, + 0.0010715054815308995, + 0.0025551879416044767, + 0.006118546853369862, + 0.008605219072110835, + 0.0053601180131874334, + 0.008860142413597574, + 0.01248683583673295, + 0.01611352925985358, + 0.005878587160222206, + 0.013145429690188892, + 0.022280640305150038, + 0.01865394688201466, + 0.015027253458894031, + 0.012033905149325846, + 0.009040556839742916, + 0.005445530672299909, + 0.0018505045048569009, + 0.001744521662600853, + 0.005339547830043862, + 0.008760404091259945, + 0.012181260352490777, + 0.009902010591734853, + 0.007622760830993676 + ], + "isChangePoint": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/DeleteModel.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/DeleteModel.json new file mode 100644 index 000000000000..1ada54a87848 --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/DeleteModel.json @@ -0,0 +1,25 @@ +{ + "operationId": "Multivariate_DeleteMultivariateModel", + "title": "Delete multivariate model", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "body": {} + }, + "responses": { + "204": {}, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/DetectAnomaly.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/DetectAnomaly.json new file mode 100644 index 000000000000..429c24f8b9d2 --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/DetectAnomaly.json @@ -0,0 +1,49 @@ +{ + "operationId": "Multivariate_DetectMultivariateBatchAnomaly", + "title": "Detect multivariate batch anomaly", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "body": { + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "topContributorCount": 10, + "startTime": "2019-04-01T00:15:00Z", + "endTime": "2019-04-01T00:40:00Z" + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{Endpoint}/anomalydetector/v1.1/multivariate/detect-batch/", + "Operation-Id": "663884e6-b117-11ea-b3de-0242ac130004" + }, + "body": { + "resultId": "663884e6-b117-11ea-b3de-0242ac130004", + "summary": { + "status": "CREATED", + "errors": [], + "setupInfo": { + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "topContributorCount": 10, + "startTime": "2021-01-01T00:00:00Z", + "endTime": "2021-01-01T00:29:00Z" + } + }, + "results": [] + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/EntireDetect.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/EntireDetect.json new file mode 100644 index 000000000000..1869ce4b95ba --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/EntireDetect.json @@ -0,0 +1,567 @@ +{ + "operationId": "Univariate_DetectUnivariateEntireSeries", + "title": "Univariate detect entire series", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "series": [ + { + "timestamp": "1972-01-01T00:00:00Z", + "value": 826 + }, + { + "timestamp": "1972-02-01T00:00:00Z", + "value": 799 + }, + { + "timestamp": "1972-03-01T00:00:00Z", + "value": 890 + }, + { + "timestamp": "1972-04-01T00:00:00Z", + "value": 900 + }, + { + "timestamp": "1972-05-01T00:00:00Z", + "value": 961 + }, + { + "timestamp": "1972-06-01T00:00:00Z", + "value": 935 + }, + { + "timestamp": "1972-07-01T00:00:00Z", + "value": 894 + }, + { + "timestamp": "1972-08-01T00:00:00Z", + "value": 855 + }, + { + "timestamp": "1972-09-01T00:00:00Z", + "value": 809 + }, + { + "timestamp": "1972-10-01T00:00:00Z", + "value": 810 + }, + { + "timestamp": "1972-11-01T00:00:00Z", + "value": 766 + }, + { + "timestamp": "1972-12-01T00:00:00Z", + "value": 805 + }, + { + "timestamp": "1973-01-01T00:00:00Z", + "value": 821 + }, + { + "timestamp": "1973-02-01T00:00:00Z", + "value": 773 + }, + { + "timestamp": "1973-03-01T00:00:00Z", + "value": 883 + }, + { + "timestamp": "1973-04-01T00:00:00Z", + "value": 898 + }, + { + "timestamp": "1973-05-01T00:00:00Z", + "value": 957 + }, + { + "timestamp": "1973-06-01T00:00:00Z", + "value": 924 + }, + { + "timestamp": "1973-07-01T00:00:00Z", + "value": 881 + }, + { + "timestamp": "1973-08-01T00:00:00Z", + "value": 837 + }, + { + "timestamp": "1973-09-01T00:00:00Z", + "value": 784 + }, + { + "timestamp": "1973-10-01T00:00:00Z", + "value": 791 + }, + { + "timestamp": "1973-11-01T00:00:00Z", + "value": 760 + }, + { + "timestamp": "1973-12-01T00:00:00Z", + "value": 802 + }, + { + "timestamp": "1974-01-01T00:00:00Z", + "value": 828 + }, + { + "timestamp": "1974-02-01T00:00:00Z", + "value": 1030 + }, + { + "timestamp": "1974-03-01T00:00:00Z", + "value": 889 + }, + { + "timestamp": "1974-04-01T00:00:00Z", + "value": 902 + }, + { + "timestamp": "1974-05-01T00:00:00Z", + "value": 969 + }, + { + "timestamp": "1974-06-01T00:00:00Z", + "value": 947 + }, + { + "timestamp": "1974-07-01T00:00:00Z", + "value": 908 + }, + { + "timestamp": "1974-08-01T00:00:00Z", + "value": 867 + }, + { + "timestamp": "1974-09-01T00:00:00Z", + "value": 815 + }, + { + "timestamp": "1974-10-01T00:00:00Z", + "value": 812 + }, + { + "timestamp": "1974-11-01T00:00:00Z", + "value": 773 + }, + { + "timestamp": "1974-12-01T00:00:00Z", + "value": 813 + }, + { + "timestamp": "1975-01-01T00:00:00Z", + "value": 834 + }, + { + "timestamp": "1975-02-01T00:00:00Z", + "value": 782 + }, + { + "timestamp": "1975-03-01T00:00:00Z", + "value": 892 + }, + { + "timestamp": "1975-04-01T00:00:00Z", + "value": 903 + }, + { + "timestamp": "1975-05-01T00:00:00Z", + "value": 966 + }, + { + "timestamp": "1975-06-01T00:00:00Z", + "value": 937 + }, + { + "timestamp": "1975-07-01T00:00:00Z", + "value": 896 + }, + { + "timestamp": "1975-08-01T00:00:00Z", + "value": 858 + }, + { + "timestamp": "1975-09-01T00:00:00Z", + "value": 817 + }, + { + "timestamp": "1975-10-01T00:00:00Z", + "value": 827 + }, + { + "timestamp": "1975-11-01T00:00:00Z", + "value": 797 + }, + { + "timestamp": "1975-12-01T00:00:00Z", + "value": 843 + } + ], + "maxAnomalyRatio": 0.25, + "sensitivity": 95, + "granularity": "monthly", + "imputeMode": "auto" + } + }, + "responses": { + "200": { + "body": { + "isNegativeAnomaly": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "expectedValues": [ + 827.79409082439679, + 798.91337746719273, + 888.60584318071892, + 900.5606407986661, + 962.83894263783043, + 933.25916063069542, + 891.07841047996658, + 856.17816013636968, + 809.89872279089411, + 807.375129007505, + 764.31966824485175, + 803.933498594564, + 823.59006208830579, + 794.09056413342876, + 883.164245249282, + 894.84190006909535, + 956.84305911012575, + 927.62850551901136, + 885.812983784303, + 851.6424797402517, + 806.0927886943216, + 804.68268153120289, + 762.74070738882, + 804.0251702513732, + 825.35236625795585, + 798.04041887249764, + 889.30165055776979, + 902.4226124345937, + 965.867078532635, + 937.32004957366951, + 896.17205247111019, + 862.00873684136559, + 816.46623420974231, + 814.42977455247092, + 771.8614479159354, + 811.859271346729, + 831.89982792155206, + 802.947544797165, + 892.56844074350829, + 904.54882145338092, + 966.85270638447071, + 937.31683910030426, + 895.180003672544, + 860.36495963566347, + 814.17072859690427, + 811.9054862686213, + 769.10837696107421, + 809.23280846597038 + ], + "isPositiveAnomaly": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "lowerMargins": [ + 41.389704541219835, + 39.945668873359637, + 44.430292159035943, + 45.028032039933308, + 48.14194713189152, + 46.662958031534771, + 44.553920523998329, + 42.808908006818484, + 40.494936139544706, + 40.368756450375251, + 38.215983412242586, + 40.196674929728196, + 41.179503104415289, + 39.704528206671441, + 44.1582122624641, + 44.742095003454772, + 47.842152955506293, + 46.381425275950569, + 44.290649189215145, + 42.582123987012579, + 40.30463943471608, + 40.234134076560146, + 38.137035369441, + 40.201258512568664, + 41.267618312897795, + 39.902020943624883, + 44.465082527888491, + 45.121130621729684, + 48.293353926631752, + 46.866002478683477, + 44.808602623555508, + 43.100436842068284, + 40.823311710487111, + 40.721488727623544, + 38.593072395796774, + 40.592963567336447, + 41.5949913960776, + 40.147377239858251, + 44.628422037175412, + 45.227441072669045, + 48.34263531922354, + 46.865841955015213, + 44.759000183627194, + 43.018247981783169, + 40.708536429845211, + 40.595274313431062, + 38.455418848053711, + 40.461640423298519 + ], + "period": 12, + "upperMargins": [ + 41.389704541219835, + 39.945668873359637, + 44.430292159035943, + 45.028032039933308, + 48.14194713189152, + 46.662958031534771, + 44.553920523998329, + 42.808908006818484, + 40.494936139544706, + 40.368756450375251, + 38.215983412242586, + 40.196674929728196, + 41.179503104415289, + 39.704528206671441, + 44.1582122624641, + 44.742095003454772, + 47.842152955506293, + 46.381425275950569, + 44.290649189215145, + 42.582123987012579, + 40.30463943471608, + 40.234134076560146, + 38.137035369441, + 40.201258512568664, + 41.267618312897795, + 39.902020943624883, + 44.465082527888491, + 45.121130621729684, + 48.293353926631752, + 46.866002478683477, + 44.808602623555508, + 43.100436842068284, + 40.823311710487111, + 40.721488727623544, + 38.593072395796774, + 40.592963567336447, + 41.5949913960776, + 40.147377239858251, + 44.628422037175412, + 45.227441072669045, + 48.34263531922354, + 46.865841955015213, + 44.759000183627194, + 43.018247981783169, + 40.708536429845211, + 40.595274313431062, + 38.455418848053711, + 40.461640423298519 + ], + "isAnomaly": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "severity": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.2906614447614368, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/GetModel.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/GetModel.json new file mode 100644 index 000000000000..5c25efb71270 --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/GetModel.json @@ -0,0 +1,163 @@ +{ + "operationId": "Multivariate_GetMultivariateModel", + "title": "Get a multivariate model", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "body": {} + }, + "responses": { + "200": { + "body": { + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "createdTime": "2020-06-30T00:00:00Z", + "lastUpdatedTime": "2020-06-30T00:00:00Z", + "modelInfo": { + "slidingWindow": 20, + "alignPolicy": { + "alignMode": "Outer", + "fillNAMethod": "Linear", + "paddingValue": 0 + }, + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "dataSchema": "OneTable", + "startTime": "2019-04-01T00:00:00Z", + "endTime": "2019-04-02T00:00:00Z", + "displayName": "Devops-MultiAD", + "status": "READY", + "errors": [], + "diagnosticsInfo": { + "modelState": { + "epochIds": [ + 10, + 20, + 30, + 40, + 50, + 60, + 70, + 80, + 90, + 100 + ], + "trainLosses": [ + 0.6291328072547913, + 0.1671326905488968, + 0.12354248017072678, + 0.10259664058685303, + 0.09584927558898926, + 0.09069952368736267, + 0.08686016499996185, + 0.08603022992610931, + 0.08287354558706284, + 0.08235538005828857 + ], + "validationLosses": [ + 1.9232804775238037, + 1.0645641088485718, + 0.6031560301780701, + 0.5302737951278687, + 0.46980252861976624, + 0.4395163357257843, + 0.41829314827919006, + 0.40579143166542053, + 0.405649870634079, + 0.38492488861083984 + ], + "latenciesInSeconds": [ + 0.3398594856262207, + 0.3659665584564209, + 0.37360644340515137, + 0.35134077072143555, + 0.33703041076660156, + 0.31876277923583984, + 0.32833099365234375, + 0.3503587245941162, + 0.3080024719238281, + 0.3327946662902832 + ] + }, + "variableStates": [ + { + "variable": "ad_input", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_ontimer_output", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ingestion", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "data_in_speed", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "cpu", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_series_init", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "flink_last_ckpt_duration", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "data_out_speed", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_output", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + } + ] + } + } + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/GetResult.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/GetResult.json new file mode 100644 index 000000000000..aaf1294d36b5 --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/GetResult.json @@ -0,0 +1,109 @@ +{ + "operationId": "Multivariate_GetMultivariateBatchDetectionResult", + "title": "Get multivariate batch detection result", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "663884e6-b117-11ea-b3de-0242ac130004", + "body": {} + }, + "responses": { + "200": { + "body": { + "resultId": "663884e6-b117-11ea-b3de-0242ac130004", + "summary": { + "status": "READY", + "errors": [], + "variableStates": [ + { + "variable": "variable_1", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + }, + { + "variable": "variable_2", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + }, + { + "variable": "variable_3", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + } + ], + "setupInfo": { + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "topContributorCount": 10, + "startTime": "2021-01-01T00:00:00Z", + "endTime": "2021-01-01T00:29:00Z" + } + }, + "results": [ + { + "timestamp": "2021-01-01T00:28:00Z", + "value": { + "isAnomaly": false, + "severity": 0, + "score": 0.6928471326828003 + }, + "errors": [] + }, + { + "timestamp": "2021-01-01T00:29:00Z", + "value": { + "isAnomaly": true, + "severity": 0.5337404608726501, + "score": 0.9171165823936462, + "interpretation": [ + { + "variable": "variable_2", + "contributionScore": 0.5371576215, + "correlationChanges": { + "changedVariables": [ + "variable_1", + "variable_3" + ] + } + }, + { + "variable": "variable_3", + "contributionScore": 0.3324159383, + "correlationChanges": { + "changedVariables": [ + "variable_2" + ] + } + }, + { + "variable": "variable_1", + "contributionScore": 0.1304264402, + "correlationChanges": { + "changedVariables": [] + } + } + ] + } + } + ] + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/LastDetect.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/LastDetect.json new file mode 100644 index 000000000000..ebc05dca98fa --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/LastDetect.json @@ -0,0 +1,226 @@ +{ + "operationId": "Univariate_DetectUnivariateLastPoint", + "title": "Detect univariate last point", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "series": [ + { + "timestamp": "1972-01-01T00:00:00Z", + "value": 826 + }, + { + "timestamp": "1972-02-01T00:00:00Z", + "value": 799 + }, + { + "timestamp": "1972-03-01T00:00:00Z", + "value": 890 + }, + { + "timestamp": "1972-04-01T00:00:00Z", + "value": 900 + }, + { + "timestamp": "1972-05-01T00:00:00Z", + "value": 961 + }, + { + "timestamp": "1972-06-01T00:00:00Z", + "value": 935 + }, + { + "timestamp": "1972-07-01T00:00:00Z", + "value": 894 + }, + { + "timestamp": "1972-08-01T00:00:00Z", + "value": 855 + }, + { + "timestamp": "1972-09-01T00:00:00Z", + "value": 809 + }, + { + "timestamp": "1972-10-01T00:00:00Z", + "value": 810 + }, + { + "timestamp": "1972-11-01T00:00:00Z", + "value": 766 + }, + { + "timestamp": "1972-12-01T00:00:00Z", + "value": 805 + }, + { + "timestamp": "1973-01-01T00:00:00Z", + "value": 821 + }, + { + "timestamp": "1973-02-01T00:00:00Z", + "value": 773 + }, + { + "timestamp": "1973-03-01T00:00:00Z", + "value": 883 + }, + { + "timestamp": "1973-04-01T00:00:00Z", + "value": 898 + }, + { + "timestamp": "1973-05-01T00:00:00Z", + "value": 957 + }, + { + "timestamp": "1973-06-01T00:00:00Z", + "value": 924 + }, + { + "timestamp": "1973-07-01T00:00:00Z", + "value": 881 + }, + { + "timestamp": "1973-08-01T00:00:00Z", + "value": 837 + }, + { + "timestamp": "1973-09-01T00:00:00Z", + "value": 784 + }, + { + "timestamp": "1973-10-01T00:00:00Z", + "value": 791 + }, + { + "timestamp": "1973-11-01T00:00:00Z", + "value": 760 + }, + { + "timestamp": "1973-12-01T00:00:00Z", + "value": 802 + }, + { + "timestamp": "1974-01-01T00:00:00Z", + "value": 828 + }, + { + "timestamp": "1974-02-01T00:00:00Z", + "value": 1030 + }, + { + "timestamp": "1974-03-01T00:00:00Z", + "value": 889 + }, + { + "timestamp": "1974-04-01T00:00:00Z", + "value": 902 + }, + { + "timestamp": "1974-05-01T00:00:00Z", + "value": 969 + }, + { + "timestamp": "1974-06-01T00:00:00Z", + "value": 947 + }, + { + "timestamp": "1974-07-01T00:00:00Z", + "value": 908 + }, + { + "timestamp": "1974-08-01T00:00:00Z", + "value": 867 + }, + { + "timestamp": "1974-09-01T00:00:00Z", + "value": 815 + }, + { + "timestamp": "1974-10-01T00:00:00Z", + "value": 812 + }, + { + "timestamp": "1974-11-01T00:00:00Z", + "value": 773 + }, + { + "timestamp": "1974-12-01T00:00:00Z", + "value": 813 + }, + { + "timestamp": "1975-01-01T00:00:00Z", + "value": 834 + }, + { + "timestamp": "1975-02-01T00:00:00Z", + "value": 782 + }, + { + "timestamp": "1975-03-01T00:00:00Z", + "value": 892 + }, + { + "timestamp": "1975-04-01T00:00:00Z", + "value": 903 + }, + { + "timestamp": "1975-05-01T00:00:00Z", + "value": 966 + }, + { + "timestamp": "1975-06-01T00:00:00Z", + "value": 937 + }, + { + "timestamp": "1975-07-01T00:00:00Z", + "value": 896 + }, + { + "timestamp": "1975-08-01T00:00:00Z", + "value": 858 + }, + { + "timestamp": "1975-09-01T00:00:00Z", + "value": 817 + }, + { + "timestamp": "1975-10-01T00:00:00Z", + "value": 827 + }, + { + "timestamp": "1975-11-01T00:00:00Z", + "value": 797 + }, + { + "timestamp": "1975-12-01T00:00:00Z", + "value": 843 + } + ], + "maxAnomalyRatio": 0.25, + "sensitivity": 95, + "granularity": "monthly", + "imputeMode": "fixed", + "imputeFixedValue": 800 + } + }, + "responses": { + "200": { + "body": { + "isAnomaly": false, + "isPositiveAnomaly": false, + "isNegativeAnomaly": false, + "period": 12, + "expectedValue": 809.23280846597038, + "upperMargin": 40.461640423298519, + "lowerMargin": 40.461640423298519, + "suggestedWindow": 49, + "severity": 0.0 + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/LastDetectAnomaly.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/LastDetectAnomaly.json new file mode 100644 index 000000000000..09c4992dd22b --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/LastDetectAnomaly.json @@ -0,0 +1,304 @@ +{ + "operationId": "Multivariate_DetectMultivariateLastAnomaly", + "title": "Detect multivariate last anomaly", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "body": { + "variables": [ + { + "variable": "Variable_1", + "timestamps": [ + "2021-01-01T00:00:00Z", + "2021-01-01T00:01:00Z", + "2021-01-01T00:02:00Z", + "2021-01-01T00:03:00Z", + "2021-01-01T00:04:00Z", + "2021-01-01T00:05:00Z", + "2021-01-01T00:06:00Z", + "2021-01-01T00:07:00Z", + "2021-01-01T00:08:00Z", + "2021-01-01T00:09:00Z", + "2021-01-01T00:10:00Z", + "2021-01-01T00:11:00Z", + "2021-01-01T00:12:00Z", + "2021-01-01T00:13:00Z", + "2021-01-01T00:14:00Z", + "2021-01-01T00:15:00Z", + "2021-01-01T00:16:00Z", + "2021-01-01T00:17:00Z", + "2021-01-01T00:18:00Z", + "2021-01-01T00:19:00Z", + "2021-01-01T00:20:00Z", + "2021-01-01T00:21:00Z", + "2021-01-01T00:22:00Z", + "2021-01-01T00:23:00Z", + "2021-01-01T00:24:00Z", + "2021-01-01T00:25:00Z", + "2021-01-01T00:26:00Z", + "2021-01-01T00:27:00Z", + "2021-01-01T00:28:00Z", + "2021-01-01T00:29:00Z" + ], + "values": [ + 0.4551378545933972, + 0.7388603950488748, + 0.201088255984052, + 0.7462812245891899, + 0.07308128850401663, + 0.33090474587393537, + 0.7544925268153315, + 0.987506336316328, + 0.6665932993421468, + 0.6308351543168672, + 0.08083310161466228, + 0.8414415588668442, + 0.514583545640453, + 0.0954489875193526, + 0.7786793231920507, + 0.41646133667960994, + 0.030176187583339287, + 0.3474214937189324, + 0.508530173413991, + 0.42451199127255046, + 0.2115944222725208, + 0.24733519545833516, + 0.8791022110982156, + 0.9479621899884665, + 0.26702703121252136, + 0.6954503497669413, + 0.1235728391488995, + 0.8214915473050647, + 0.11813002444192677, + 0.8579045951076123 + ] + }, + { + "variable": "Variable_2", + "timestamps": [ + "2021-01-01T00:00:00Z", + "2021-01-01T00:01:00Z", + "2021-01-01T00:02:00Z", + "2021-01-01T00:03:00Z", + "2021-01-01T00:04:00Z", + "2021-01-01T00:05:00Z", + "2021-01-01T00:06:00Z", + "2021-01-01T00:07:00Z", + "2021-01-01T00:08:00Z", + "2021-01-01T00:09:00Z", + "2021-01-01T00:10:00Z", + "2021-01-01T00:11:00Z", + "2021-01-01T00:12:00Z", + "2021-01-01T00:13:00Z", + "2021-01-01T00:14:00Z", + "2021-01-01T00:15:00Z", + "2021-01-01T00:16:00Z", + "2021-01-01T00:17:00Z", + "2021-01-01T00:18:00Z", + "2021-01-01T00:19:00Z", + "2021-01-01T00:20:00Z", + "2021-01-01T00:21:00Z", + "2021-01-01T00:22:00Z", + "2021-01-01T00:23:00Z", + "2021-01-01T00:24:00Z", + "2021-01-01T00:25:00Z", + "2021-01-01T00:26:00Z", + "2021-01-01T00:27:00Z", + "2021-01-01T00:28:00Z", + "2021-01-01T00:29:00Z" + ], + "values": [ + 0.9617871613964145, + 0.24903311574778408, + 0.4920561254118613, + 0.9895601049618598, + 0.9171759283128094, + 0.5754204711105273, + 0.1811033296265634, + 0.8852311981742577, + 0.9543231904644779, + 0.7088012446094262, + 0.7843572237149014, + 0.7664787010700046, + 0.3699552325387093, + 0.504519908266789, + 0.5848930929950164, + 0.7628913396089576, + 0.8148405868900065, + 0.08540458873739332, + 0.03481976727525682, + 0.21275099339467762, + 0.9836175579199806, + 0.9321441483364282, + 0.038466608085469534, + 0.1723138437622782, + 0.8626383410218382, + 0.35053229974224254, + 0.631141662835182, + 0.0730352607990088, + 0.08886179043386, + 0.7488606040971179 + ] + }, + { + "variable": "Variable_3", + "timestamps": [ + "2021-01-01T00:00:00Z", + "2021-01-01T00:01:00Z", + "2021-01-01T00:02:00Z", + "2021-01-01T00:03:00Z", + "2021-01-01T00:04:00Z", + "2021-01-01T00:05:00Z", + "2021-01-01T00:06:00Z", + "2021-01-01T00:07:00Z", + "2021-01-01T00:08:00Z", + "2021-01-01T00:09:00Z", + "2021-01-01T00:10:00Z", + "2021-01-01T00:11:00Z", + "2021-01-01T00:12:00Z", + "2021-01-01T00:13:00Z", + "2021-01-01T00:14:00Z", + "2021-01-01T00:15:00Z", + "2021-01-01T00:16:00Z", + "2021-01-01T00:17:00Z", + "2021-01-01T00:18:00Z", + "2021-01-01T00:19:00Z", + "2021-01-01T00:20:00Z", + "2021-01-01T00:21:00Z", + "2021-01-01T00:22:00Z", + "2021-01-01T00:23:00Z", + "2021-01-01T00:24:00Z", + "2021-01-01T00:25:00Z", + "2021-01-01T00:26:00Z", + "2021-01-01T00:27:00Z", + "2021-01-01T00:28:00Z", + "2021-01-01T00:29:00Z" + ], + "values": [ + 0.4030756879437628, + 0.15526889968448554, + 0.36352226408981103, + 0.6051200637229004, + 0.8516795018476276, + 0.2645605735279929, + 0.6810875830037345, + 0.9165894221681316, + 0.700783245230424, + 0.5624155469940331, + 0.6277289685127893, + 0.15992056539730204, + 0.6020964482827594, + 0.35937967753105915, + 0.8731686034848609, + 0.20301549117588935, + 0.029261872151168933, + 0.6261499548828445, + 0.45850782028563386, + 0.8275006940083313, + 0.032760268834037376, + 0.4485202784055029, + 0.8915691008748384, + 0.891669051517807, + 0.9469979353323046, + 0.115293087370132, + 0.08818772518459506, + 0.7426286620589166, + 0.32372247468990756, + 0.936268139507417 + ] + } + ], + "topContributorCount": 10 + } + }, + "responses": { + "200": { + "body": { + "variableStates": [ + { + "variable": "variable_1", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + }, + { + "variable": "variable_2", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + }, + { + "variable": "variable_3", + "filledNARatio": 0, + "effectiveCount": 30, + "firstTimestamp": "2021-01-01T00:00:00Z", + "lastTimestamp": "2021-01-01T00:29:00Z" + } + ], + "results": [ + { + "timestamp": "2021-01-01T00:28:00Z", + "value": { + "isAnomaly": false, + "severity": 0, + "score": 0.6928471326828003 + }, + "errors": [] + }, + { + "timestamp": "2021-01-01T00:29:00Z", + "value": { + "isAnomaly": true, + "severity": 0.5337404608726501, + "score": 0.9171165823936462, + "interpretation": [ + { + "variable": "variable_2", + "contributionScore": 0.5371576215, + "correlationChanges": { + "changedVariables": [ + "variable_1", + "variable_3" + ] + } + }, + { + "variable": "variable_3", + "contributionScore": 0.3324159383, + "correlationChanges": { + "changedVariables": [ + "variable_2" + ] + } + }, + { + "variable": "variable_1", + "contributionScore": 0.1304264402, + "correlationChanges": { + "changedVariables": [] + } + } + ] + }, + "errors": [] + } + ] + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/ListModel.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/ListModel.json new file mode 100644 index 000000000000..8e99cf2d0898 --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/ListModel.json @@ -0,0 +1,171 @@ +{ + "operationId": "Multivariate_ListMultivariateModels", + "title": "List multivariate models", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "skip": 0, + "top": 10, + "body": {} + }, + "responses": { + "200": { + "body": { + "models": [ + { + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "createdTime": "2020-06-30T00:00:00Z", + "lastUpdatedTime": "2020-06-30T00:00:00Z", + "modelInfo": { + "slidingWindow": 20, + "alignPolicy": { + "alignMode": "Outer", + "fillNAMethod": "Linear", + "paddingValue": 0 + }, + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "dataSchema": "OneTable", + "startTime": "2019-04-01T00:00:00Z", + "endTime": "2019-04-02T00:00:00Z", + "displayName": "Devops-MultiAD", + "status": "READY", + "errors": [], + "diagnosticsInfo": { + "modelState": { + "epochIds": [ + 10, + 20, + 30, + 40, + 50, + 60, + 70, + 80, + 90, + 100 + ], + "trainLosses": [ + 0.6291328072547913, + 0.1671326905488968, + 0.12354248017072678, + 0.10259664058685303, + 0.09584927558898926, + 0.09069952368736267, + 0.08686016499996185, + 0.08603022992610931, + 0.08287354558706284, + 0.08235538005828857 + ], + "validationLosses": [ + 1.9232804775238037, + 1.0645641088485718, + 0.6031560301780701, + 0.5302737951278687, + 0.46980252861976624, + 0.4395163357257843, + 0.41829314827919006, + 0.40579143166542053, + 0.405649870634079, + 0.38492488861083984 + ], + "latenciesInSeconds": [ + 0.3398594856262207, + 0.3659665584564209, + 0.37360644340515137, + 0.35134077072143555, + 0.33703041076660156, + 0.31876277923583984, + 0.32833099365234375, + 0.3503587245941162, + 0.3080024719238281, + 0.3327946662902832 + ] + }, + "variableStates": [ + { + "variable": "ad_input", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_ontimer_output", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ingestion", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "data_in_speed", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "cpu", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_series_init", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "flink_last_ckpt_duration", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "data_out_speed", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + }, + { + "variable": "ad_output", + "filledNARatio": 0, + "effectiveCount": 1441, + "firstTimestamp": "2019-04-01T00:00:00Z", + "lastTimestamp": "2019-04-02T00:00:00Z" + } + ] + } + } + } + ], + "currentCount": 1, + "maxCount": 20, + "nextLink": "" + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/TrainModel.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/TrainModel.json new file mode 100644 index 000000000000..234215b723cd --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/examples/TrainModel.json @@ -0,0 +1,60 @@ +{ + "operationId": "Multivariate_TrainMultivariateModel", + "title": "Create and train multivariate model", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v1.1", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "slidingWindow": 20, + "alignPolicy": { + "alignMode": "Outer", + "fillNAMethod": "Linear", + "paddingValue": 0 + }, + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "dataSchema": "OneTable", + "startTime": "2019-04-01T00:00:00Z", + "endTime": "2019-04-02T00:00:00Z", + "displayName": "Devops-MultiAD" + } + }, + "responses": { + "201": { + "headers": { + "Location": "{Endpoint}/anomalydetector/v1.1/multivariate/models/{modelId}" + }, + "body": { + "modelId": "45aad126-aafd-11ea-b8fb-d89ef3400c5f", + "createdTime": "2020-06-30T00:00:00Z", + "lastUpdatedTime": "2020-06-30T00:00:00Z", + "modelInfo": { + "slidingWindow": 20, + "alignPolicy": { + "alignMode": "Outer", + "fillNAMethod": "Linear", + "paddingValue": 0 + }, + "dataSource": "https://multiadsample.blob.core.windows.net/data/sample_data_2_1000.csv", + "dataSchema": "OneTable", + "startTime": "2019-04-01T00:00:00Z", + "endTime": "2019-04-02T00:00:00Z", + "displayName": "Devops-MultiAD", + "status": "CREATED", + "errors": [] + } + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-ms-error-code": "Error Code" + }, + "body": { + "code": "Error Code", + "message": "Error Message" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/openapi.json b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/openapi.json new file mode 100644 index 000000000000..74e9cdc3372a --- /dev/null +++ b/specification/cognitiveservices/data-plane/AnomalyDetector/stable/v1.1/openapi.json @@ -0,0 +1,1617 @@ +{ + "swagger": "2.0", + "info": { + "title": "Anomaly Detector", + "version": "v1.1", + "description": "The Anomaly Detector API detects anomalies automatically in time series data.\nIt supports two kinds of mode, one is for stateless using, another is for\nstateful using. In stateless mode, there are three functionalities. Entire\nDetect is for detecting the whole series with model trained by the time series,\nLast Detect is detecting last point with model trained by points before.\nChangePoint Detect is for detecting trend changes in time series. In stateful\nmode, user can store time series, the stored time series will be used for\ndetection anomalies. Under this mode, user can still use the above three\nfunctionalities by only giving a time range without preparing time series in\nclient side. Besides the above three functionalities, stateful model also\nprovide group based detection and labeling service. By leveraging labeling\nservice user can provide labels for each detection result, these labels will be\nused for retuning or regenerating detection models. Inconsistency detection is\na kind of group based detection, this detection will find inconsistency ones in\na set of time series. By using anomaly detector service, business customers can\ndiscover incidents and establish a logic flow for root cause analysis.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}/anomalydetector/{ApiVersion}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "Endpoint", + "in": "path", + "required": true, + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus2.api.cognitive.microsoft.com).", + "type": "string" + }, + { + "name": "ApiVersion", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "v1.1" + ], + "x-ms-enum": { + "name": "APIVersion", + "modelAsString": true, + "values": [ + { + "name": "v1_1", + "value": "v1.1" + } + ] + } + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "ApiKeyAuth": [] + } + ], + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "Ocp-Apim-Subscription-Key" + } + }, + "tags": [], + "paths": { + "/multivariate/detect-batch/{resultId}": { + "get": { + "operationId": "Multivariate_GetMultivariateBatchDetectionResult", + "summary": "Get Multivariate Anomaly Detection Result", + "description": "For asynchronous inference, get multivariate anomaly detection result based on\nresultId returned by the BatchDetectAnomaly api.", + "parameters": [ + { + "name": "resultId", + "in": "path", + "required": true, + "description": "ID of a batch detection result.", + "format": "uuid", + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Multivariate.MultivariateDetectionResult" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Multivariate.ResponseError" + } + } + }, + "x-ms-examples": { + "Get multivariate batch detection result": { + "$ref": "./examples/GetResult.json" + } + } + } + }, + "/multivariate/models": { + "post": { + "operationId": "Multivariate_TrainMultivariateModel", + "summary": "Train a Multivariate Anomaly Detection Model", + "description": "Create and train a multivariate anomaly detection model. The request must\ninclude a source parameter to indicate an externally accessible Azure blob\nstorage URI.There are two types of data input: An URI pointed to an Azure blob\nstorage folder which contains multiple CSV files, and each CSV file contains\ntwo columns, timestamp and variable. Another type of input is an URI pointed to\na CSV file in Azure blob storage, which contains all the variables and a\ntimestamp column.", + "parameters": [ + { + "name": "modelInfo", + "in": "body", + "required": true, + "description": "Model information.", + "schema": { + "$ref": "#/definitions/Multivariate.ModelInfo" + } + } + ], + "responses": { + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "headers": { + "location": { + "description": "Location and ID of the model.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Multivariate.AnomalyDetectionModel" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Multivariate.ResponseError" + } + } + }, + "x-ms-examples": { + "Create and train multivariate model": { + "$ref": "./examples/TrainModel.json" + } + } + }, + "get": { + "operationId": "Multivariate_ListMultivariateModels", + "summary": "List Multivariate Models", + "description": "List models of a resource.", + "parameters": [ + { + "name": "skip", + "in": "query", + "required": false, + "description": "Skip indicates how many models will be skipped.", + "default": 0, + "type": "integer", + "format": "int32" + }, + { + "name": "top", + "in": "query", + "required": false, + "description": "Top indicates how many models will be fetched.", + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Multivariate.ModelList" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Multivariate.ResponseError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List multivariate models": { + "$ref": "./examples/ListModel.json" + } + } + } + }, + "/multivariate/models/{modelId}": { + "delete": { + "operationId": "Multivariate_DeleteMultivariateModel", + "summary": "Delete Multivariate Model", + "description": "Delete an existing multivariate model according to the modelId", + "parameters": [ + { + "name": "modelId", + "in": "path", + "required": true, + "description": "Model identifier.", + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Multivariate.ResponseError" + } + } + }, + "x-ms-examples": { + "Delete multivariate model": { + "$ref": "./examples/DeleteModel.json" + } + } + }, + "get": { + "operationId": "Multivariate_GetMultivariateModel", + "summary": "Get Multivariate Model", + "description": "Get detailed information of multivariate model, including the training status\nand variables used in the model.", + "parameters": [ + { + "name": "modelId", + "in": "path", + "required": true, + "description": "Model identifier.", + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Multivariate.AnomalyDetectionModel" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Multivariate.ResponseError" + } + } + }, + "x-ms-examples": { + "Get a multivariate model": { + "$ref": "./examples/GetModel.json" + } + } + } + }, + "/multivariate/models/{modelId}:detect-batch": { + "post": { + "operationId": "Multivariate_DetectMultivariateBatchAnomaly", + "summary": "Detect Multivariate Anomaly", + "description": "Submit multivariate anomaly detection task with the modelId of trained model\nand inference data, the input schema should be the same with the training\nrequest. The request will complete asynchronously and return a resultId to\nquery the detection result.The request should be a source link to indicate an\nexternally accessible Azure storage Uri, either pointed to an Azure blob\nstorage folder, or pointed to a CSV file in Azure blob storage.", + "parameters": [ + { + "name": "modelId", + "in": "path", + "required": true, + "description": "Model identifier.", + "type": "string" + }, + { + "name": "options", + "in": "body", + "required": true, + "description": "Request of multivariate anomaly detection.", + "schema": { + "$ref": "#/definitions/Multivariate.MultivariateBatchDetectionOptions" + } + } + ], + "responses": { + "202": { + "description": "The request has been accepted for processing, but processing has not yet completed.", + "headers": { + "operation-id": { + "description": "Id of the detection result.", + "type": "string" + }, + "operation-location": { + "description": "Location of the detection result.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Multivariate.MultivariateDetectionResult" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Multivariate.ResponseError" + } + } + }, + "x-ms-examples": { + "Detect multivariate batch anomaly": { + "$ref": "./examples/DetectAnomaly.json" + } + } + } + }, + "/multivariate/models/{modelId}:detect-last": { + "post": { + "operationId": "Multivariate_DetectMultivariateLastAnomaly", + "summary": "Detect anomalies in the last point of the request body", + "description": "Submit multivariate anomaly detection task with the modelId of trained model\nand inference data, and the inference data should be put into request body in a\nJSON format. The request will complete synchronously and return the detection\nimmediately in the response body.", + "parameters": [ + { + "name": "modelId", + "in": "path", + "required": true, + "description": "Model identifier.", + "type": "string" + }, + { + "name": "options", + "in": "body", + "required": true, + "description": "Request of last detection.", + "schema": { + "$ref": "#/definitions/Multivariate.MultivariateLastDetectionOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Multivariate.MultivariateLastDetectionResult" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Multivariate.ResponseError" + } + } + }, + "x-ms-examples": { + "Detect multivariate last anomaly": { + "$ref": "./examples/LastDetectAnomaly.json" + } + } + } + }, + "/timeseries/changepoint/detect": { + "post": { + "operationId": "Univariate_DetectUnivariateChangePoint", + "summary": "Detect change point for the entire series", + "description": "Evaluate change point score of every series point", + "parameters": [ + { + "name": "options", + "in": "body", + "required": true, + "description": "Method of univariate anomaly detection.", + "schema": { + "$ref": "#/definitions/Univariate.UnivariateChangePointDetectionOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Univariate.UnivariateChangePointDetectionResult" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Univariate.AnomalyDetectorError" + } + } + }, + "x-ms-examples": { + "Univariate detection of a change point": { + "$ref": "./examples/ChangePointDetect.json" + } + } + } + }, + "/timeseries/entire/detect": { + "post": { + "operationId": "Univariate_DetectUnivariateEntireSeries", + "summary": "Detect anomalies for the entire series in batch.", + "description": "This operation generates a model with an entire series, each point is detected\nwith the same model. With this method, points before and after a certain point\nare used to determine whether it is an anomaly. The entire detection can give\nuser an overall status of the time series.", + "parameters": [ + { + "name": "options", + "in": "body", + "required": true, + "description": "Method of univariate anomaly detection.", + "schema": { + "$ref": "#/definitions/Univariate.UnivariateDetectionOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Univariate.UnivariateEntireDetectionResult" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Univariate.AnomalyDetectorError" + } + } + }, + "x-ms-examples": { + "Univariate detect entire series": { + "$ref": "./examples/EntireDetect.json" + } + } + } + }, + "/timeseries/last/detect": { + "post": { + "operationId": "Univariate_DetectUnivariateLastPoint", + "summary": "Detect anomaly status of the latest point in time series.", + "description": "This operation generates a model using the points that you sent into the API,\nand based on all data to determine whether the last point is anomalous.", + "parameters": [ + { + "name": "options", + "in": "body", + "required": true, + "description": "Method of univariate anomaly detection.", + "schema": { + "$ref": "#/definitions/Univariate.UnivariateDetectionOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Univariate.UnivariateLastDetectionResult" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "Error code.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Univariate.AnomalyDetectorError" + } + } + }, + "x-ms-examples": { + "Detect univariate last point": { + "$ref": "./examples/LastDetect.json" + } + } + } + } + }, + "definitions": { + "APIVersion": { + "type": "string", + "enum": [ + "v1.1" + ], + "x-ms-enum": { + "name": "APIVersion", + "modelAsString": true, + "values": [ + { + "name": "v1_1", + "value": "v1.1" + } + ] + } + }, + "Multivariate.AlignMode": { + "type": "string", + "enum": [ + "Inner", + "Outer" + ], + "x-ms-enum": { + "name": "AlignMode", + "modelAsString": true + } + }, + "Multivariate.AlignPolicy": { + "type": "object", + "properties": { + "alignMode": { + "$ref": "#/definitions/Multivariate.AlignMode", + "description": "An optional field, indicating how to align different variables to the same\ntime-range. Either Inner or Outer. " + }, + "fillNAMethod": { + "$ref": "#/definitions/Multivariate.FillNAMethod", + "description": "An optional field, indicating how missing values will be filled. One of\nPrevious, Subsequent, Linear, Zero, Fixed." + }, + "paddingValue": { + "type": "number", + "format": "float", + "description": "An optional field. Required when fillNAMethod is Fixed." + } + }, + "description": "An optional field, indicating the manner to align multiple variables." + }, + "Multivariate.AnomalyDetectionModel": { + "type": "object", + "properties": { + "modelId": { + "type": "string", + "description": "Model identifier.", + "format": "uuid" + }, + "createdTime": { + "type": "string", + "format": "date-time", + "description": "Date and time (UTC) when the model was created." + }, + "lastUpdatedTime": { + "type": "string", + "format": "date-time", + "description": "Date and time (UTC) when the model was last updated." + }, + "modelInfo": { + "$ref": "#/definitions/Multivariate.ModelInfo", + "description": "Training result of a model including its status, errors and diagnostics\ninformation." + } + }, + "description": "Response of getting a model.", + "required": [ + "modelId", + "createdTime", + "lastUpdatedTime" + ] + }, + "Multivariate.AnomalyInterpretation": { + "type": "object", + "properties": { + "variable": { + "type": "string", + "description": "Variable." + }, + "contributionScore": { + "type": "number", + "format": "float", + "description": "This score shows the percentage contributing to the anomalous timestamp. A\nnumber between 0 and 1." + }, + "correlationChanges": { + "$ref": "#/definitions/Multivariate.CorrelationChanges", + "description": "Correlation changes among the anomalous variables" + } + }, + "description": "Interpretation of the anomalous timestamp." + }, + "Multivariate.AnomalyState": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp for this anomaly." + }, + "value": { + "$ref": "#/definitions/Multivariate.AnomalyValue", + "description": "The detailed value of this anomalous timestamp." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.ErrorResponse" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.ErrorResponse[]", + "description": "Error message for the current timestamp." + } + }, + "description": "Anomaly status and information.", + "required": [ + "timestamp" + ] + }, + "Multivariate.AnomalyValue": { + "type": "object", + "properties": { + "isAnomaly": { + "type": "boolean", + "description": "True if an anomaly is detected at the current timestamp." + }, + "severity": { + "type": "number", + "format": "float", + "description": "Indicates the significance of the anomaly. The higher the severity, the more\nsignificant the anomaly is.", + "minimum": 0, + "maximum": 1 + }, + "score": { + "type": "number", + "format": "float", + "description": "Raw anomaly score of severity, will help indicate the degree of abnormality as\nwell.", + "minimum": 0, + "maximum": 2 + }, + "interpretation": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.AnomalyInterpretation" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.AnomalyInterpretation[]", + "description": "Interpretation of this anomalous timestamp." + } + }, + "description": "Detailed information of the anomalous timestamp.", + "required": [ + "isAnomaly", + "severity", + "score" + ] + }, + "Multivariate.CorrelationChanges": { + "type": "object", + "properties": { + "changedVariables": { + "type": "array", + "items": { + "type": "string" + }, + "x-cadl-name": "string[]", + "description": "The correlated variables that have correlation changes under an anomaly." + } + }, + "description": "Correlation changes among the anomalous variables" + }, + "Multivariate.DataSchema": { + "type": "string", + "description": "Data schema of input data source: OneTable or MultiTable. The default DataSchema is OneTable.", + "enum": [ + "OneTable", + "MultiTable" + ], + "x-ms-enum": { + "name": "DataSchema", + "modelAsString": true, + "values": [ + { + "name": "OneTable", + "value": "OneTable", + "description": "OneTable means that your input data are all in one CSV file, which contains one 'timestamp' column and several variable columns. The default DataSchema is OneTable." + }, + { + "name": "MultiTable", + "value": "MultiTable", + "description": "MultiTable means that your input data are separated in multiple CSV files, in each file containing one 'timestamp' column and one 'variable' column, and the CSV file name should indicate the name of the variable. The default DataSchema is OneTable." + } + ] + } + }, + "Multivariate.DiagnosticsInfo": { + "type": "object", + "properties": { + "modelState": { + "$ref": "#/definitions/Multivariate.ModelState", + "description": "Model status." + }, + "variableStates": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.VariableState" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.VariableState[]", + "description": "Variable Status." + } + }, + "description": "Diagnostics information to help inspect the states of model or variable." + }, + "Multivariate.ErrorResponse": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The error code." + }, + "message": { + "type": "string", + "description": "The message explaining the error reported by the service." + } + }, + "description": "ErrorResponse contains code and message that shows the error information.", + "required": [ + "code", + "message" + ] + }, + "Multivariate.FillNAMethod": { + "type": "string", + "description": "An optional field, indicating how missing values will be filled. One of Previous, Subsequent, Linear, Zero, Fixed.", + "enum": [ + "Previous", + "Subsequent", + "Linear", + "Zero", + "Fixed" + ], + "x-ms-enum": { + "name": "FillNAMethod", + "modelAsString": true + } + }, + "Multivariate.ModelInfo": { + "type": "object", + "properties": { + "dataSource": { + "type": "string", + "description": "Source link to the input data to indicate an accessible Azure storage Uri,\neither pointed to an Azure blob storage folder, or pointed to a CSV file in\nAzure blob storage based on you data schema selection. " + }, + "dataSchema": { + "$ref": "#/definitions/Multivariate.DataSchema", + "description": "Data schema of input data source: OneTable or MultiTable. The default\nDataSchema is OneTable." + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "A required field, indicating the start time of training data, which should be\ndate-time of ISO 8601 format." + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "A required field, indicating the end time of training data, which should be\ndate-time of ISO 8601 format." + }, + "displayName": { + "type": "string", + "description": "An optional field. The display name of the model whose maximum length is 24\ncharacters.", + "maxLength": 24 + }, + "slidingWindow": { + "type": "integer", + "format": "int32", + "description": "An optional field, indicating how many previous timestamps will be used to\ndetect whether the timestamp is anomaly or not. " + }, + "alignPolicy": { + "$ref": "#/definitions/Multivariate.AlignPolicy", + "description": "An optional field, indicating the manner to align multiple variables." + }, + "status": { + "$ref": "#/definitions/Multivariate.ModelStatus", + "description": "Model status. One of CREATED, RUNNING, READY, and FAILED." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.ErrorResponse" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.ErrorResponse[]", + "description": "Error messages when failed to create a model.", + "readOnly": true + }, + "diagnosticsInfo": { + "$ref": "#/definitions/Multivariate.DiagnosticsInfo", + "description": "Diagnostics information to help inspect the states of model or variable." + } + }, + "description": "Training result of a model including its status, errors and diagnostics\ninformation.", + "required": [ + "dataSource", + "startTime", + "endTime" + ] + }, + "Multivariate.ModelList": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.AnomalyDetectionModel" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.AnomalyDetectionModel[]", + "description": "List of models." + }, + "currentCount": { + "type": "integer", + "format": "int32", + "description": "Number of trained multivariate models." + }, + "maxCount": { + "type": "integer", + "format": "int32", + "description": "Maximum number of models that can be trained for this Anomaly Detector resource." + }, + "nextLink": { + "type": "string", + "description": "The link to fetch more models." + } + }, + "description": "Response of listing models.", + "required": [ + "models", + "currentCount", + "maxCount" + ] + }, + "Multivariate.ModelState": { + "type": "object", + "properties": { + "epochIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "x-cadl-name": "int32[]", + "description": "This indicates the number of passes of the entire training dataset the\nalgorithm has completed." + }, + "trainLosses": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "x-cadl-name": "float32[]", + "description": "List of metrics used to assess how the model fits the training data for each\nepoch." + }, + "validationLosses": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "x-cadl-name": "float32[]", + "description": "List of metrics used to assess how the model fits the validation set for each\nepoch." + }, + "latenciesInSeconds": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "x-cadl-name": "float32[]", + "description": "Latency for each epoch. " + } + }, + "description": "Model status." + }, + "Multivariate.ModelStatus": { + "type": "string", + "enum": [ + "CREATED", + "RUNNING", + "READY", + "FAILED" + ], + "x-ms-enum": { + "name": "ModelStatus", + "modelAsString": true, + "values": [ + { + "name": "Created", + "value": "CREATED" + }, + { + "name": "Running", + "value": "RUNNING" + }, + { + "name": "Ready", + "value": "READY" + }, + { + "name": "Failed", + "value": "FAILED" + } + ] + } + }, + "Multivariate.MultivariateBatchDetectionOptions": { + "type": "object", + "properties": { + "dataSource": { + "type": "string", + "description": "Source link to the input data to indicate an accessible Azure storage Uri,\neither pointed to an Azure blob storage folder, or pointed to a CSV file in\nAzure blob storage based on you data schema selection. The data schema should\nbe exactly the same with those used in the training phase." + }, + "topContributorCount": { + "type": "integer", + "format": "int32", + "description": "An optional field, which is used to specify the number of top contributed\nvariables for one anomalous timestamp in the response. The default number is\n10." + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "A required field, indicating the start time of data for detection, which should\nbe date-time of ISO 8601 format." + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "A required field, indicating the end time of data for detection, which should\nbe date-time of ISO 8601 format." + } + }, + "description": "Detection request for batch inference. This is an asynchronous inference which\nwill need another API to get detection results.", + "required": [ + "dataSource", + "topContributorCount", + "startTime", + "endTime" + ] + }, + "Multivariate.MultivariateBatchDetectionResultSummary": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/Multivariate.MultivariateBatchDetectionStatus", + "description": "Status of detection results. One of CREATED, RUNNING, READY, and FAILED." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.ErrorResponse" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.ErrorResponse[]", + "description": "Error message when detection is failed." + }, + "variableStates": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.VariableState" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.VariableState[]", + "description": "Variable Status." + }, + "setupInfo": { + "$ref": "#/definitions/Multivariate.MultivariateBatchDetectionOptions", + "description": "Detection request for batch inference. This is an asynchronous inference which\nwill need another API to get detection results." + } + }, + "description": "Multivariate anomaly detection status.", + "required": [ + "status", + "setupInfo" + ] + }, + "Multivariate.MultivariateBatchDetectionStatus": { + "type": "string", + "enum": [ + "CREATED", + "RUNNING", + "READY", + "FAILED" + ], + "x-ms-enum": { + "name": "MultivariateBatchDetectionStatus", + "modelAsString": true, + "values": [ + { + "name": "Created", + "value": "CREATED" + }, + { + "name": "Running", + "value": "RUNNING" + }, + { + "name": "Ready", + "value": "READY" + }, + { + "name": "Failed", + "value": "FAILED" + } + ] + } + }, + "Multivariate.MultivariateDetectionResult": { + "type": "object", + "properties": { + "resultId": { + "type": "string", + "description": "Result identifier, which is used to fetch the results of an inference call.", + "format": "uuid" + }, + "summary": { + "$ref": "#/definitions/Multivariate.MultivariateBatchDetectionResultSummary", + "description": "Multivariate anomaly detection status." + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.AnomalyState" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.AnomalyState[]", + "description": "Detection result for each timestamp." + } + }, + "description": "Detection results for the given resultId.", + "required": [ + "resultId", + "summary", + "results" + ] + }, + "Multivariate.MultivariateLastDetectionOptions": { + "type": "object", + "properties": { + "variables": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.VariableValues" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.VariableValues[]", + "description": "This contains the inference data, including the name, timestamps(ISO 8601) and\nvalues of variables." + }, + "topContributorCount": { + "type": "integer", + "format": "int32", + "description": "An optional field, which is used to specify the number of top contributed\nvariables for one anomalous timestamp in the response. The default number is\n10." + } + }, + "description": "Request of last detection.", + "required": [ + "variables", + "topContributorCount" + ] + }, + "Multivariate.MultivariateLastDetectionResult": { + "type": "object", + "properties": { + "variableStates": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.VariableState" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.VariableState[]", + "description": "Variable Status." + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Multivariate.AnomalyState" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Multivariate.AnomalyState[]", + "description": "Anomaly status and information." + } + }, + "description": "Results of last detection." + }, + "Multivariate.ResponseError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The error code." + }, + "message": { + "type": "string", + "description": "The message explaining the error reported by the service." + } + }, + "description": "Error response", + "required": [ + "code", + "message" + ] + }, + "Multivariate.VariableState": { + "type": "object", + "properties": { + "variable": { + "type": "string", + "description": "Variable name in variable states." + }, + "filledNARatio": { + "type": "number", + "format": "float", + "description": "Proportion of missing values that need to be filled by fillNAMethod.", + "minimum": 0, + "maximum": 1 + }, + "effectiveCount": { + "type": "integer", + "format": "int32", + "description": "Number of effective data points before applying fillNAMethod." + }, + "firstTimestamp": { + "type": "string", + "format": "date-time", + "description": "First valid timestamp with value of input data." + }, + "lastTimestamp": { + "type": "string", + "format": "date-time", + "description": "Last valid timestamp with value of input data." + } + }, + "description": "Variable Status." + }, + "Multivariate.VariableValues": { + "type": "object", + "properties": { + "variable": { + "type": "string", + "description": "Variable name of last detection request." + }, + "timestamps": { + "type": "array", + "items": { + "type": "string" + }, + "x-cadl-name": "string[]", + "description": "Timestamps of last detection request" + }, + "values": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "x-cadl-name": "float32[]", + "description": "Values of variables." + } + }, + "description": "Variable values.", + "required": [ + "variable", + "timestamps", + "values" + ] + }, + "Univariate.AnomalyDetectorError": { + "type": "object", + "properties": { + "code": { + "$ref": "#/definitions/Univariate.AnomalyDetectorErrorCodes", + "description": "The error code." + }, + "message": { + "type": "string", + "description": "A message explaining the error reported by the service." + } + }, + "description": "Error information returned by the API." + }, + "Univariate.AnomalyDetectorErrorCodes": { + "type": "string", + "enum": [ + "InvalidCustomInterval", + "BadArgument", + "InvalidGranularity", + "InvalidPeriod", + "InvalidModelArgument", + "InvalidSeries", + "InvalidJsonFormat", + "RequiredGranularity", + "RequiredSeries", + "InvalidImputeMode", + "InvalidImputeFixedValue" + ], + "x-ms-enum": { + "name": "AnomalyDetectorErrorCodes", + "modelAsString": true + } + }, + "Univariate.ImputeMode": { + "type": "string", + "enum": [ + "auto", + "previous", + "linear", + "fixed", + "zero", + "notFill" + ], + "x-ms-enum": { + "name": "ImputeMode", + "modelAsString": true, + "values": [ + { + "name": "Auto", + "value": "auto" + }, + { + "name": "Previous", + "value": "previous" + }, + { + "name": "Linear", + "value": "linear" + }, + { + "name": "Fixed", + "value": "fixed" + }, + { + "name": "Zero", + "value": "zero" + }, + { + "name": "NotFill", + "value": "notFill" + } + ] + } + }, + "Univariate.TimeGranularity": { + "type": "string", + "enum": [ + "yearly", + "monthly", + "weekly", + "daily", + "hourly", + "minutely", + "secondly", + "microsecond", + "none" + ], + "x-ms-enum": { + "name": "TimeGranularity", + "modelAsString": true, + "values": [ + { + "name": "Yearly", + "value": "yearly" + }, + { + "name": "Monthly", + "value": "monthly" + }, + { + "name": "Weekly", + "value": "weekly" + }, + { + "name": "Daily", + "value": "daily" + }, + { + "name": "Hourly", + "value": "hourly" + }, + { + "name": "PerMinute", + "value": "minutely" + }, + { + "name": "PerSecond", + "value": "secondly" + }, + { + "name": "Microsecond", + "value": "microsecond" + }, + { + "name": "None", + "value": "none" + } + ] + } + }, + "Univariate.TimeSeriesPoint": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "Optional argument, timestamp of a data point (ISO8601 format)." + }, + "value": { + "type": "number", + "format": "float", + "description": "The measurement of that point, should be float." + } + }, + "description": "The definition of input timeseries points.", + "required": [ + "value" + ] + }, + "Univariate.UnivariateChangePointDetectionOptions": { + "type": "object", + "properties": { + "series": { + "type": "array", + "items": { + "$ref": "#/definitions/Univariate.TimeSeriesPoint" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Univariate.TimeSeriesPoint[]", + "description": "Time series data points. Points should be sorted by timestamp in ascending\norder to match the change point detection result." + }, + "granularity": { + "$ref": "#/definitions/Univariate.TimeGranularity", + "description": "Can only be one of yearly, monthly, weekly, daily, hourly, minutely or\nsecondly. Granularity is used for verify whether input series is valid." + }, + "customInterval": { + "type": "integer", + "format": "int32", + "description": "Custom Interval is used to set non-standard time interval, for example, if the\nseries is 5 minutes, request can be set as {\"granularity\":\"minutely\",\n\"customInterval\":5}." + }, + "period": { + "type": "integer", + "format": "int32", + "description": "Optional argument, periodic value of a time series. If the value is null or\ndoes not present, the API will determine the period automatically." + }, + "stableTrendWindow": { + "type": "integer", + "format": "int32", + "description": "Optional argument, advanced model parameter, a default stableTrendWindow will\nbe used in detection." + }, + "threshold": { + "type": "number", + "format": "float", + "description": "Optional argument, advanced model parameter, between 0.0-1.0, the lower the\nvalue is, the larger the trend error will be which means less change point will\nbe accepted." + } + }, + "description": "The request of change point detection.", + "required": [ + "series", + "granularity" + ] + }, + "Univariate.UnivariateChangePointDetectionResult": { + "type": "object", + "properties": { + "period": { + "type": "integer", + "format": "int32", + "description": "Frequency extracted from the series, zero means no recurrent pattern has been\nfound.", + "readOnly": true + }, + "isChangePoint": { + "type": "array", + "items": { + "type": "boolean" + }, + "x-cadl-name": "boolean[]", + "description": "isChangePoint contains change point properties for each input point. True means\nan anomaly either negative or positive has been detected. The index of the\narray is consistent with the input series." + }, + "confidenceScores": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "x-cadl-name": "float32[]", + "description": "the change point confidence of each point" + } + }, + "description": "The response of change point detection." + }, + "Univariate.UnivariateDetectionOptions": { + "type": "object", + "properties": { + "series": { + "type": "array", + "items": { + "$ref": "#/definitions/Univariate.TimeSeriesPoint" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Univariate.TimeSeriesPoint[]", + "description": "Time series data points. Points should be sorted by timestamp in ascending\norder to match the anomaly detection result. If the data is not sorted\ncorrectly or there is duplicated timestamp, the API will not work. In such\ncase, an error message will be returned." + }, + "granularity": { + "$ref": "#/definitions/Univariate.TimeGranularity", + "description": "Optional argument, can be one of yearly, monthly, weekly, daily, hourly,\nminutely, secondly, microsecond or none. If granularity is not present, it will\nbe none by default. If granularity is none, the timestamp property in time\nseries point can be absent." + }, + "customInterval": { + "type": "integer", + "format": "int32", + "description": "Custom Interval is used to set non-standard time interval, for example, if the\nseries is 5 minutes, request can be set as {\"granularity\":\"minutely\",\n\"customInterval\":5}." + }, + "period": { + "type": "integer", + "format": "int32", + "description": "Optional argument, periodic value of a time series. If the value is null or\ndoes not present, the API will determine the period automatically." + }, + "maxAnomalyRatio": { + "type": "number", + "format": "float", + "description": "Optional argument, advanced model parameter, max anomaly ratio in a time series." + }, + "sensitivity": { + "type": "integer", + "format": "int32", + "description": "Optional argument, advanced model parameter, between 0-99, the lower the value\nis, the larger the margin value will be which means less anomalies will be\naccepted." + }, + "imputeMode": { + "$ref": "#/definitions/Univariate.ImputeMode", + "description": "Used to specify how to deal with missing values in the input series, it's used\nwhen granularity is not \"none\"." + }, + "imputeFixedValue": { + "type": "number", + "format": "float", + "description": "Used to specify the value to fill, it's used when granularity is not \"none\"\nand imputeMode is \"fixed\"." + } + }, + "description": "The request of entire or last anomaly detection.", + "required": [ + "series" + ] + }, + "Univariate.UnivariateEntireDetectionResult": { + "type": "object", + "properties": { + "period": { + "type": "integer", + "format": "int32", + "description": "Frequency extracted from the series, zero means no recurrent pattern has been\nfound." + }, + "expectedValues": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "x-cadl-name": "float32[]", + "description": "ExpectedValues contain expected value for each input point. The index of the\narray is consistent with the input series." + }, + "upperMargins": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "x-cadl-name": "float32[]", + "description": "UpperMargins contain upper margin of each input point. UpperMargin is used to\ncalculate upperBoundary, which equals to expectedValue + (100 -\nmarginScale)*upperMargin. Anomalies in response can be filtered by\nupperBoundary and lowerBoundary. By adjusting marginScale value, less\nsignificant anomalies can be filtered in client side. The index of the array is\nconsistent with the input series." + }, + "lowerMargins": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "x-cadl-name": "float32[]", + "description": "LowerMargins contain lower margin of each input point. LowerMargin is used to\ncalculate lowerBoundary, which equals to expectedValue - (100 -\nmarginScale)*lowerMargin. Points between the boundary can be marked as normal\nones in client side. The index of the array is consistent with the input\nseries." + }, + "isAnomaly": { + "type": "array", + "items": { + "type": "boolean" + }, + "x-cadl-name": "boolean[]", + "description": "IsAnomaly contains anomaly properties for each input point. True means an\nanomaly either negative or positive has been detected. The index of the array\nis consistent with the input series." + }, + "isNegativeAnomaly": { + "type": "array", + "items": { + "type": "boolean" + }, + "x-cadl-name": "boolean[]", + "description": "IsNegativeAnomaly contains anomaly status in negative direction for each input\npoint. True means a negative anomaly has been detected. A negative anomaly\nmeans the point is detected as an anomaly and its real value is smaller than\nthe expected one. The index of the array is consistent with the input series." + }, + "isPositiveAnomaly": { + "type": "array", + "items": { + "type": "boolean" + }, + "x-cadl-name": "boolean[]", + "description": "IsPositiveAnomaly contain anomaly status in positive direction for each input\npoint. True means a positive anomaly has been detected. A positive anomaly\nmeans the point is detected as an anomaly and its real value is larger than the\nexpected one. The index of the array is consistent with the input series." + }, + "severity": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "x-cadl-name": "float32[]", + "description": "The severity score for each input point. The larger the value is, the more\nsever the anomaly is. For normal points, the \"severity\" is always 0." + } + }, + "description": "The response of entire anomaly detection.", + "required": [ + "period", + "expectedValues", + "upperMargins", + "lowerMargins", + "isAnomaly", + "isNegativeAnomaly", + "isPositiveAnomaly" + ] + }, + "Univariate.UnivariateLastDetectionResult": { + "type": "object", + "properties": { + "period": { + "type": "integer", + "format": "int32", + "description": "Frequency extracted from the series, zero means no recurrent pattern has been\nfound." + }, + "suggestedWindow": { + "type": "integer", + "format": "int32", + "description": "Suggested input series points needed for detecting the latest point." + }, + "expectedValue": { + "type": "number", + "format": "float", + "description": "Expected value of the latest point." + }, + "upperMargin": { + "type": "number", + "format": "float", + "description": "Upper margin of the latest point. UpperMargin is used to calculate\nupperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin.\nIf the value of latest point is between upperBoundary and lowerBoundary, it\nshould be treated as normal value. By adjusting marginScale value, anomaly\nstatus of latest point can be changed." + }, + "lowerMargin": { + "type": "number", + "format": "float", + "description": "Lower margin of the latest point. LowerMargin is used to calculate\nlowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin.\n" + }, + "isAnomaly": { + "type": "boolean", + "description": "Anomaly status of the latest point, true means the latest point is an anomaly\neither in negative direction or positive direction." + }, + "isNegativeAnomaly": { + "type": "boolean", + "description": "Anomaly status in negative direction of the latest point. True means the latest\npoint is an anomaly and its real value is smaller than the expected one." + }, + "isPositiveAnomaly": { + "type": "boolean", + "description": "Anomaly status in positive direction of the latest point. True means the latest\npoint is an anomaly and its real value is larger than the expected one." + }, + "severity": { + "type": "number", + "format": "float", + "description": "The severity score for the last input point. The larger the value is, the more\nsever the anomaly is. For normal points, the \"severity\" is always 0." + } + }, + "description": "The response of last anomaly detection.", + "required": [ + "period", + "suggestedWindow", + "expectedValue", + "upperMargin", + "lowerMargin", + "isAnomaly", + "isNegativeAnomaly", + "isPositiveAnomaly" + ] + } + }, + "parameters": {} +}