azure.ai.anomalydetector.models package

class azure.ai.anomalydetector.models.AlignMode(value)[source]

An optional field, indicating how we align different variables to the same time-range. Either Inner or Outer.

INNER = 'Inner'
OUTER = 'Outer'
class azure.ai.anomalydetector.models.AlignPolicy(*, align_mode: Optional[Union[str, azure.ai.anomalydetector.models._anomaly_detector_client_enums.AlignMode]] = None, fill_na_method: Optional[Union[str, azure.ai.anomalydetector.models._anomaly_detector_client_enums.FillNAMethod]] = None, padding_value: Optional[float] = None, **kwargs)[source]

AlignPolicy.

Variables
  • align_mode (str or AlignMode) – An optional field, indicating how we align different variables to the same time-range. Either Inner or Outer. Possible values include: “Inner”, “Outer”.

  • fill_na_method (str or FillNAMethod) – An optional field, indicating how missing values will be filled. One of Previous, Subsequent, Linear, Zero, Fixed, and NotFill. Cannot be set to NotFill, when the alignMode is Outer. Possible values include: “Previous”, “Subsequent”, “Linear”, “Zero”, “Fixed”, “NotFill”.

  • padding_value (float) – An optional field. Required when fillNAMethod is Fixed.

Keyword Arguments
  • align_mode (str or AlignMode) – An optional field, indicating how we align different variables to the same time-range. Either Inner or Outer. Possible values include: “Inner”, “Outer”.

  • fill_na_method (str or FillNAMethod) – An optional field, indicating how missing values will be filled. One of Previous, Subsequent, Linear, Zero, Fixed, and NotFill. Cannot be set to NotFill, when the alignMode is Outer. Possible values include: “Previous”, “Subsequent”, “Linear”, “Zero”, “Fixed”, “NotFill”.

  • padding_value (float) – An optional field. Required when fillNAMethod is Fixed.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.AnomalyDetectorError(*, code: Optional[Union[str, azure.ai.anomalydetector.models._anomaly_detector_client_enums.AnomalyDetectorErrorCodes]] = None, message: Optional[str] = None, **kwargs)[source]

Error information returned by the API.

Variables
  • code (str or AnomalyDetectorErrorCodes) – The error code. Possible values include: “InvalidCustomInterval”, “BadArgument”, “InvalidGranularity”, “InvalidPeriod”, “InvalidModelArgument”, “InvalidSeries”, “InvalidJsonFormat”, “RequiredGranularity”, “RequiredSeries”, “InvalidImputeMode”, “InvalidImputeFixedValue”.

  • message (str) – A message explaining the error reported by the service.

Keyword Arguments
  • code (str or AnomalyDetectorErrorCodes) – The error code. Possible values include: “InvalidCustomInterval”, “BadArgument”, “InvalidGranularity”, “InvalidPeriod”, “InvalidModelArgument”, “InvalidSeries”, “InvalidJsonFormat”, “RequiredGranularity”, “RequiredSeries”, “InvalidImputeMode”, “InvalidImputeFixedValue”.

  • message (str) – A message explaining the error reported by the service.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.AnomalyDetectorErrorCodes(value)[source]

The error code.

BAD_ARGUMENT = 'BadArgument'
INVALID_CUSTOM_INTERVAL = 'InvalidCustomInterval'
INVALID_GRANULARITY = 'InvalidGranularity'
INVALID_IMPUTE_FIXED_VALUE = 'InvalidImputeFixedValue'
INVALID_IMPUTE_MODE = 'InvalidImputeMode'
INVALID_JSON_FORMAT = 'InvalidJsonFormat'
INVALID_MODEL_ARGUMENT = 'InvalidModelArgument'
INVALID_PERIOD = 'InvalidPeriod'
INVALID_SERIES = 'InvalidSeries'
REQUIRED_GRANULARITY = 'RequiredGranularity'
REQUIRED_SERIES = 'RequiredSeries'
class azure.ai.anomalydetector.models.AnomalyInterpretation(*, variable: Optional[str] = None, contribution_score: Optional[float] = None, correlation_changes: Optional[azure.ai.anomalydetector.models._models_py3.CorrelationChanges] = None, **kwargs)[source]

AnomalyInterpretation.

Variables
Keyword Arguments
as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.AnomalyState(*, timestamp: datetime.datetime, value: Optional[azure.ai.anomalydetector.models._models_py3.AnomalyValue] = None, errors: Optional[List[azure.ai.anomalydetector.models._models_py3.ErrorResponse]] = None, **kwargs)[source]

AnomalyState.

All required parameters must be populated in order to send to Azure.

Variables
Keyword Arguments
as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.AnomalyValue(*, is_anomaly: bool, severity: float, score: float, interpretation: Optional[List[azure.ai.anomalydetector.models._models_py3.AnomalyInterpretation]] = None, **kwargs)[source]

AnomalyValue.

All required parameters must be populated in order to send to Azure.

Variables
  • is_anomaly (bool) – Required. True if an anomaly is detected at the current timestamp.

  • severity (float) – Required. Indicates the significance of the anomaly. The higher the severity, the more significant the anomaly.

  • score (float) – Required. Raw score from the model.

  • interpretation (list[AnomalyInterpretation]) –

Keyword Arguments
  • is_anomaly (bool) – Required. True if an anomaly is detected at the current timestamp.

  • severity (float) – Required. Indicates the significance of the anomaly. The higher the severity, the more significant the anomaly.

  • score (float) – Required. Raw score from the model.

  • interpretation (list[AnomalyInterpretation]) –

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.ChangePointDetectRequest(*, series: List[azure.ai.anomalydetector.models._models_py3.TimeSeriesPoint], granularity: Union[str, azure.ai.anomalydetector.models._anomaly_detector_client_enums.TimeGranularity], custom_interval: Optional[int] = None, period: Optional[int] = None, stable_trend_window: Optional[int] = None, threshold: Optional[float] = None, **kwargs)[source]

The request of change point detection.

All required parameters must be populated in order to send to Azure.

Variables
  • series (list[TimeSeriesPoint]) – Required. Time series data points. Points should be sorted by timestamp in ascending order to match the change point detection result.

  • granularity (str or TimeGranularity) – Required. Can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid. Possible values include: “yearly”, “monthly”, “weekly”, “daily”, “hourly”, “minutely”, “secondly”, “microsecond”, “none”.

  • custom_interval (int) – 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}.

  • period (int) – Optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically.

  • stable_trend_window (int) – Optional argument, advanced model parameter, a default stableTrendWindow will be used in detection.

  • threshold (float) – 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.

Keyword Arguments
  • series (list[TimeSeriesPoint]) – Required. Time series data points. Points should be sorted by timestamp in ascending order to match the change point detection result.

  • granularity (str or TimeGranularity) – Required. Can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid. Possible values include: “yearly”, “monthly”, “weekly”, “daily”, “hourly”, “minutely”, “secondly”, “microsecond”, “none”.

  • custom_interval (int) – 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}.

  • period (int) – Optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically.

  • stable_trend_window (int) – Optional argument, advanced model parameter, a default stableTrendWindow will be used in detection.

  • threshold (float) – 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.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.ChangePointDetectResponse(*, is_change_point: Optional[List[bool]] = None, confidence_scores: Optional[List[float]] = None, **kwargs)[source]

The response of change point detection.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • period (int) – Frequency extracted from the series, zero means no recurrent pattern has been found.

  • is_change_point (list[bool]) – 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.

  • confidence_scores (list[float]) – the change point confidence of each point.

Keyword Arguments
  • is_change_point (list[bool]) – 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.

  • confidence_scores (list[float]) – the change point confidence of each point.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.CorrelationChanges(*, changed_variables: Optional[List[str]] = None, changed_values: Optional[List[float]] = None, **kwargs)[source]

CorrelationChanges.

Variables
  • changed_variables (list[str]) – correlated variables.

  • changed_values (list[float]) – changes in correlation.

Keyword Arguments
  • changed_variables (list[str]) – correlated variables.

  • changed_values (list[float]) – changes in correlation.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.DetectRequest(*, series: List[azure.ai.anomalydetector.models._models_py3.TimeSeriesPoint], granularity: Optional[Union[str, azure.ai.anomalydetector.models._anomaly_detector_client_enums.TimeGranularity]] = None, custom_interval: Optional[int] = None, period: Optional[int] = None, max_anomaly_ratio: Optional[float] = None, sensitivity: Optional[int] = None, impute_mode: Optional[Union[str, azure.ai.anomalydetector.models._anomaly_detector_client_enums.ImputeMode]] = None, impute_fixed_value: Optional[float] = None, **kwargs)[source]

The request of entire or last anomaly detection.

All required parameters must be populated in order to send to Azure.

Variables
  • series (list[TimeSeriesPoint]) – Required. 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.

  • granularity (str or TimeGranularity) – 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. Possible values include: “yearly”, “monthly”, “weekly”, “daily”, “hourly”, “minutely”, “secondly”, “microsecond”, “none”.

  • custom_interval (int) – 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}.

  • period (int) – Optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically.

  • max_anomaly_ratio (float) – Optional argument, advanced model parameter, max anomaly ratio in a time series.

  • sensitivity (int) – 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.

  • impute_mode (str or ImputeMode) – Used to specify how to deal with missing values in the input series, it’s used when granularity is not “none”. Possible values include: “auto”, “previous”, “linear”, “fixed”, “zero”, “notFill”.

  • impute_fixed_value (float) – Used to specify the value to fill, it’s used when granularity is not “none” and imputeMode is “fixed”.

Keyword Arguments
  • series (list[TimeSeriesPoint]) – Required. 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.

  • granularity (str or TimeGranularity) – 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. Possible values include: “yearly”, “monthly”, “weekly”, “daily”, “hourly”, “minutely”, “secondly”, “microsecond”, “none”.

  • custom_interval (int) – 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}.

  • period (int) – Optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically.

  • max_anomaly_ratio (float) – Optional argument, advanced model parameter, max anomaly ratio in a time series.

  • sensitivity (int) – 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.

  • impute_mode (str or ImputeMode) – Used to specify how to deal with missing values in the input series, it’s used when granularity is not “none”. Possible values include: “auto”, “previous”, “linear”, “fixed”, “zero”, “notFill”.

  • impute_fixed_value (float) – Used to specify the value to fill, it’s used when granularity is not “none” and imputeMode is “fixed”.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.DetectionRequest(*, source: str, start_time: datetime.datetime, end_time: datetime.datetime, **kwargs)[source]

Detection request.

All required parameters must be populated in order to send to Azure.

Variables
  • source (str) – Required. Source link to the input variables. Each variable should be a csv with two columns, timestamp and value. The file name of the variable will be used as its name. The variables used in detection should be exactly the same with those used in the training phase.

  • start_time (datetime) – Required. A required field, indicating the start time of data for detection. Should be date-time.

  • end_time (datetime) – Required. A required field, indicating the end time of data for detection. Should be date-time.

Keyword Arguments
  • source (str) – Required. Source link to the input variables. Each variable should be a csv with two columns, timestamp and value. The file name of the variable will be used as its name. The variables used in detection should be exactly the same with those used in the training phase.

  • start_time (datetime) – Required. A required field, indicating the start time of data for detection. Should be date-time.

  • end_time (datetime) – Required. A required field, indicating the end time of data for detection. Should be date-time.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.DetectionResult(*, result_id: str, summary: azure.ai.anomalydetector.models._models_py3.DetectionResultSummary, results: List[azure.ai.anomalydetector.models._models_py3.AnomalyState], **kwargs)[source]

Response of the given resultId.

All required parameters must be populated in order to send to Azure.

Variables
Keyword Arguments
as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.DetectionResultSummary(*, status: Union[str, azure.ai.anomalydetector.models._anomaly_detector_client_enums.DetectionStatus], setup_info: azure.ai.anomalydetector.models._models_py3.DetectionRequest, errors: Optional[List[azure.ai.anomalydetector.models._models_py3.ErrorResponse]] = None, variable_states: Optional[List[azure.ai.anomalydetector.models._models_py3.VariableState]] = None, **kwargs)[source]

DetectionResultSummary.

All required parameters must be populated in order to send to Azure.

Variables
  • status (str or DetectionStatus) – Required. Status of detection results. One of CREATED, RUNNING, READY, and FAILED. Possible values include: “CREATED”, “RUNNING”, “READY”, “FAILED”.

  • errors (list[ErrorResponse]) – Error message when detection is failed.

  • variable_states (list[VariableState]) –

  • setup_info (DetectionRequest) – Required. Detection request.

Keyword Arguments
  • status (str or DetectionStatus) – Required. Status of detection results. One of CREATED, RUNNING, READY, and FAILED. Possible values include: “CREATED”, “RUNNING”, “READY”, “FAILED”.

  • errors (list[ErrorResponse]) – Error message when detection is failed.

  • variable_states (list[VariableState]) –

  • setup_info (DetectionRequest) – Required. Detection request.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.DetectionStatus(value)[source]

Status of detection results. One of CREATED, RUNNING, READY, and FAILED.

CREATED = 'CREATED'
FAILED = 'FAILED'
READY = 'READY'
RUNNING = 'RUNNING'
class azure.ai.anomalydetector.models.DiagnosticsInfo(*, model_state: Optional[azure.ai.anomalydetector.models._models_py3.ModelState] = None, variable_states: Optional[List[azure.ai.anomalydetector.models._models_py3.VariableState]] = None, **kwargs)[source]

DiagnosticsInfo.

Variables
Keyword Arguments
as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.EntireDetectResponse(*, period: int, expected_values: List[float], upper_margins: List[float], lower_margins: List[float], is_anomaly: List[bool], is_negative_anomaly: List[bool], is_positive_anomaly: List[bool], severity: Optional[List[float]] = None, **kwargs)[source]

The response of entire anomaly detection.

All required parameters must be populated in order to send to Azure.

Variables
  • period (int) – Required. Frequency extracted from the series, zero means no recurrent pattern has been found.

  • expected_values (list[float]) – Required. ExpectedValues contain expected value for each input point. The index of the array is consistent with the input series.

  • upper_margins (list[float]) – Required. 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.

  • lower_margins (list[float]) – Required. 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.

  • is_anomaly (list[bool]) – Required. 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.

  • is_negative_anomaly (list[bool]) – Required. 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.

  • is_positive_anomaly (list[bool]) – Required. 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.

  • severity (list[float]) – 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.

Keyword Arguments
  • period (int) – Required. Frequency extracted from the series, zero means no recurrent pattern has been found.

  • expected_values (list[float]) – Required. ExpectedValues contain expected value for each input point. The index of the array is consistent with the input series.

  • upper_margins (list[float]) – Required. 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.

  • lower_margins (list[float]) – Required. 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.

  • is_anomaly (list[bool]) – Required. 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.

  • is_negative_anomaly (list[bool]) – Required. 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.

  • is_positive_anomaly (list[bool]) – Required. 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.

  • severity (list[float]) – 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.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.ErrorResponse(*, code: str, message: str, **kwargs)[source]

ErrorResponse.

All required parameters must be populated in order to send to Azure.

Variables
  • code (str) – Required. The error code.

  • message (str) – Required. The message explaining the error reported by the service.

Keyword Arguments
  • code (str) – Required. The error code.

  • message (str) – Required. The message explaining the error reported by the service.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.FillNAMethod(value)[source]

An optional field, indicating how missing values will be filled. One of Previous, Subsequent, Linear, Zero, Fixed, and NotFill. Cannot be set to NotFill, when the alignMode is Outer.

FIXED = 'Fixed'
LINEAR = 'Linear'
NOT_FILL = 'NotFill'
PREVIOUS = 'Previous'
SUBSEQUENT = 'Subsequent'
ZERO = 'Zero'
class azure.ai.anomalydetector.models.ImputeMode(value)[source]

Define the impute method, can be one of auto, previous, linear, fixed, zero, notFill.

AUTO = 'auto'
FIXED = 'fixed'
LINEAR = 'linear'
NOT_FILL = 'notFill'
PREVIOUS = 'previous'
ZERO = 'zero'
class azure.ai.anomalydetector.models.LastDetectResponse(*, period: int, suggested_window: int, expected_value: float, upper_margin: float, lower_margin: float, is_anomaly: bool, is_negative_anomaly: bool, is_positive_anomaly: bool, severity: Optional[float] = None, **kwargs)[source]

The response of last anomaly detection.

All required parameters must be populated in order to send to Azure.

Variables
  • period (int) – Required. Frequency extracted from the series, zero means no recurrent pattern has been found.

  • suggested_window (int) – Required. Suggested input series points needed for detecting the latest point.

  • expected_value (float) – Required. Expected value of the latest point.

  • upper_margin (float) – Required. 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.

  • lower_margin (float) – Required. Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin.

  • is_anomaly (bool) – Required. Anomaly status of the latest point, true means the latest point is an anomaly either in negative direction or positive direction.

  • is_negative_anomaly (bool) – Required. 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.

  • is_positive_anomaly (bool) – Required. 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.

  • severity (float) – 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.

Keyword Arguments
  • period (int) – Required. Frequency extracted from the series, zero means no recurrent pattern has been found.

  • suggested_window (int) – Required. Suggested input series points needed for detecting the latest point.

  • expected_value (float) – Required. Expected value of the latest point.

  • upper_margin (float) – Required. 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.

  • lower_margin (float) – Required. Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin.

  • is_anomaly (bool) – Required. Anomaly status of the latest point, true means the latest point is an anomaly either in negative direction or positive direction.

  • is_negative_anomaly (bool) – Required. 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.

  • is_positive_anomaly (bool) – Required. 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.

  • severity (float) – 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.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.LastDetectionRequest(*, variables: List[azure.ai.anomalydetector.models._models_py3.VariableValues], detecting_points: int, **kwargs)[source]

LastDetectionRequest.

All required parameters must be populated in order to send to Azure.

Variables
  • variables (list[VariableValues]) – Required. variables.

  • detecting_points (int) – Required. number of timestamps on which the model detects.

Keyword Arguments
  • variables (list[VariableValues]) – Required. variables.

  • detecting_points (int) – Required. number of timestamps on which the model detects.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.LastDetectionResult(*, variable_states: Optional[List[azure.ai.anomalydetector.models._models_py3.VariableState]] = None, results: Optional[List[azure.ai.anomalydetector.models._models_py3.AnomalyState]] = None, **kwargs)[source]

LastDetectionResult.

Variables
Keyword Arguments
as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.Model(*, model_id: str, created_time: datetime.datetime, last_updated_time: datetime.datetime, model_info: Optional[azure.ai.anomalydetector.models._models_py3.ModelInfo] = None, **kwargs)[source]

Response of getting a model.

All required parameters must be populated in order to send to Azure.

Variables
  • model_id (str) – Required. Model identifier.

  • created_time (datetime) – Required. Date and time (UTC) when the model was created.

  • last_updated_time (datetime) – Required. Date and time (UTC) when the model was last updated.

  • model_info (ModelInfo) – Train result of a model including status, errors and diagnose info for model and variables.

Keyword Arguments
  • model_id (str) – Required. Model identifier.

  • created_time (datetime) – Required. Date and time (UTC) when the model was created.

  • last_updated_time (datetime) – Required. Date and time (UTC) when the model was last updated.

  • model_info (ModelInfo) – Train result of a model including status, errors and diagnose info for model and variables.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)[source]

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)[source]

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()[source]
classmethod from_dict(data, key_extractors=None, content_type=None)[source]

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()[source]
serialize(keep_readonly=False, **kwargs)[source]

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()[source]

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.ModelInfo(*, source: str, start_time: datetime.datetime, end_time: datetime.datetime, sliding_window: Optional[int] = None, align_policy: Optional[azure.ai.anomalydetector.models._models_py3.AlignPolicy] = None, display_name: Optional[str] = None, **kwargs)[source]

Train result of a model including status, errors and diagnose info for model and variables.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Variables
  • sliding_window (int) – An optional field, indicating how many previous points will be used to compute the anomaly score of the subsequent point.

  • align_policy (AlignPolicy) –

  • source (str) – Required. Source link to the input variables. Each variable should be a csv file with two columns, timestamp and value. By default, the file name of the variable will be used as its variable name.

  • start_time (datetime) – Required. A required field, indicating the start time of training data. Should be date-time.

  • end_time (datetime) – Required. A required field, indicating the end time of training data. Should be date-time.

  • display_name (str) – An optional field. The name of the model whose maximum length is 24.

  • status (str or ModelStatus) – Model training status. Possible values include: “CREATED”, “RUNNING”, “READY”, “FAILED”.

  • errors (list[ErrorResponse]) – Error messages when failed to create a model.

  • diagnostics_info (DiagnosticsInfo) –

Keyword Arguments
  • sliding_window (int) – An optional field, indicating how many previous points will be used to compute the anomaly score of the subsequent point.

  • align_policy (AlignPolicy) –

  • source (str) – Required. Source link to the input variables. Each variable should be a csv file with two columns, timestamp and value. By default, the file name of the variable will be used as its variable name.

  • start_time (datetime) – Required. A required field, indicating the start time of training data. Should be date-time.

  • end_time (datetime) – Required. A required field, indicating the end time of training data. Should be date-time.

  • display_name (str) – An optional field. The name of the model whose maximum length is 24.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.ModelList(*, models: List[azure.ai.anomalydetector.models._models_py3.ModelSnapshot], current_count: int, max_count: int, next_link: Optional[str] = None, **kwargs)[source]

Response of listing models.

All required parameters must be populated in order to send to Azure.

Variables
  • models (list[ModelSnapshot]) – Required. List of models.

  • current_count (int) – Required. Current count of trained multivariate models.

  • max_count (int) – Required. Max number of models that can be trained for this subscription.

  • next_link (str) – The link to fetch more models.

Keyword Arguments
  • models (list[ModelSnapshot]) – Required. List of models.

  • current_count (int) – Required. Current count of trained multivariate models.

  • max_count (int) – Required. Max number of models that can be trained for this subscription.

  • next_link (str) – The link to fetch more models.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.ModelSnapshot(*, model_id: str, created_time: datetime.datetime, last_updated_time: datetime.datetime, variables_count: int, display_name: Optional[str] = None, **kwargs)[source]

ModelSnapshot.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Variables
  • model_id (str) – Required. Model identifier.

  • created_time (datetime) – Required. Date and time (UTC) when the model was created.

  • last_updated_time (datetime) – Required. Date and time (UTC) when the model was last updated.

  • status (str or ModelStatus) – Required. Model training status. Possible values include: “CREATED”, “RUNNING”, “READY”, “FAILED”.

  • display_name (str) –

  • variables_count (int) – Required. Total number of variables.

Keyword Arguments
  • model_id (str) – Required. Model identifier.

  • created_time (datetime) – Required. Date and time (UTC) when the model was created.

  • last_updated_time (datetime) – Required. Date and time (UTC) when the model was last updated.

  • display_name (str) –

  • variables_count (int) – Required. Total number of variables.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.ModelState(*, epoch_ids: Optional[List[int]] = None, train_losses: Optional[List[float]] = None, validation_losses: Optional[List[float]] = None, latencies_in_seconds: Optional[List[float]] = None, **kwargs)[source]

ModelState.

Variables
Keyword Arguments
as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.ModelStatus(value)[source]

Model training status.

CREATED = 'CREATED'
FAILED = 'FAILED'
READY = 'READY'
RUNNING = 'RUNNING'
class azure.ai.anomalydetector.models.TimeGranularity(value)[source]

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.

DAILY = 'daily'
HOURLY = 'hourly'
MICROSECOND = 'microsecond'
MONTHLY = 'monthly'
NONE = 'none'
PER_MINUTE = 'minutely'
PER_SECOND = 'secondly'
WEEKLY = 'weekly'
YEARLY = 'yearly'
class azure.ai.anomalydetector.models.TimeSeriesPoint(*, value: float, timestamp: Optional[datetime.datetime] = None, **kwargs)[source]

The definition of input timeseries points.

All required parameters must be populated in order to send to Azure.

Variables
  • timestamp (datetime) – Optional argument, timestamp of a data point (ISO8601 format).

  • value (float) – Required. The measurement of that point, should be float.

Keyword Arguments
  • timestamp (datetime) – Optional argument, timestamp of a data point (ISO8601 format).

  • value (float) – Required. The measurement of that point, should be float.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.VariableState(*, variable: Optional[str] = None, filled_na_ratio: Optional[float] = None, effective_count: Optional[int] = None, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, **kwargs)[source]

VariableState.

Variables
  • variable (str) – Variable name.

  • filled_na_ratio (float) – Proportion of NaN values filled of the variable.

  • effective_count (int) – Number of effective points counted.

  • start_time (datetime) – Start time of the variable.

  • end_time (datetime) – End time of the variable.

Keyword Arguments
  • variable (str) – Variable name.

  • filled_na_ratio (float) – Proportion of NaN values filled of the variable.

  • effective_count (int) – Number of effective points counted.

  • start_time (datetime) – Start time of the variable.

  • end_time (datetime) – End time of the variable.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.ai.anomalydetector.models.VariableValues(*, name: str, timestamps: List[str], values: List[float], **kwargs)[source]

VariableValues.

All required parameters must be populated in order to send to Azure.

Variables
  • name (str) – Required. variable name.

  • timestamps (list[str]) – Required. timestamps.

  • values (list[float]) – Required. values.

Keyword Arguments
  • name (str) – Required. variable name.

  • timestamps (list[str]) – Required. timestamps.

  • values (list[float]) – Required. values.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list