Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions sdk/anomalydetector/azure-ai-anomalydetector/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"commit": "324a5095c5b33493b59da70803a2e2e7f35034a9",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/cognitiveservices/AnomalyDetector",
"@azure-tools/typespec-python": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/@azure-tools/typespec-python/-/typespec-python-0.8.4.tgz",
"dependencies": {
"@autorest/python": {
"version": "6.4.11",
"resolved": "https://registry.npmjs.org/@autorest/python/-/python-6.4.11.tgz"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@

class AnomalyDetectorClient(AnomalyDetectorClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
"""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
It supports both a stateless detection mode and a
stateful detection mode. In stateless mode, there are three functionalities. Entire
Detect is for detecting the whole series, with the model trained by the time series.
Last Detect is for detecting the last point, with the model trained by points before.
ChangePoint Detect is for detecting trend changes in the time series. In stateful
mode, the user can store time series. The stored time series will be used for
detection anomalies. In this mode, the user can still use the preceding three
functionalities by only giving a time range without preparing time series on the
client side. Besides the preceding three functionalities, the stateful model
provides group-based detection and labeling services. By using the labeling
service, the 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
a kind of group-based detection that finds inconsistencies in
a set of time series. By using the anomaly detector service, business customers can
discover incidents and establish a logic flow for root cause analysis.

:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
:param endpoint: Supported Azure Cognitive Services endpoints (protocol and host name, such as
https://westus2.api.cognitive.microsoft.com). Required.
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
Expand All @@ -49,7 +49,7 @@ class AnomalyDetectorClient(AnomalyDetectorClientOperationsMixin): # pylint: di
def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None:
_endpoint = "{Endpoint}/anomalydetector/{ApiVersion}"
self._config = AnomalyDetectorClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
self._client: PipelineClient = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)

self._serialize = Serializer()
self._deserialize = Deserializer()
Expand Down Expand Up @@ -91,5 +91,5 @@ def __enter__(self) -> "AnomalyDetectorClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details) -> None:
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any

from azure.core.configuration import Configuration
Expand All @@ -15,19 +14,14 @@

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports


class AnomalyDetectorClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for AnomalyDetectorClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
:param endpoint: Supported Azure Cognitive Services endpoints (protocol and host name, such as
https://westus2.api.cognitive.microsoft.com). Required.
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
Expand All @@ -39,7 +33,7 @@ class AnomalyDetectorClientConfiguration(Configuration): # pylint: disable=too-

def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None:
super(AnomalyDetectorClientConfiguration, self).__init__(**kwargs)
api_version: Literal["v1.1"] = kwargs.pop("api_version", "v1.1")
api_version: str = kwargs.pop("api_version", "v1.1")

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand Down
Loading