abacusai.api_class.monitor_alert ================================ .. py:module:: abacusai.api_class.monitor_alert Classes ------- .. autoapisummary:: abacusai.api_class.monitor_alert.AlertConditionConfig abacusai.api_class.monitor_alert.AccuracyBelowThresholdConditionConfig abacusai.api_class.monitor_alert.FeatureDriftConditionConfig abacusai.api_class.monitor_alert.TargetDriftConditionConfig abacusai.api_class.monitor_alert.HistoryLengthDriftConditionConfig abacusai.api_class.monitor_alert.DataIntegrityViolationConditionConfig abacusai.api_class.monitor_alert.BiasViolationConditionConfig abacusai.api_class.monitor_alert.PredictionCountConditionConfig abacusai.api_class.monitor_alert._AlertConditionConfigFactory abacusai.api_class.monitor_alert.AlertActionConfig abacusai.api_class.monitor_alert.EmailActionConfig abacusai.api_class.monitor_alert._AlertActionConfigFactory abacusai.api_class.monitor_alert.MonitorThresholdConfig Module Contents --------------- .. py:class:: AlertConditionConfig Bases: :py:obj:`abacusai.api_class.abstract.ApiClass` An abstract class for alert condition configs .. py:attribute:: alert_type :type: abacusai.api_class.enums.MonitorAlertType :value: None .. py:method:: _get_builder() :classmethod: .. py:class:: AccuracyBelowThresholdConditionConfig Bases: :py:obj:`AlertConditionConfig` Accuracy Below Threshold Condition Config for Monitor Alerts :param threshold: Threshold for when to consider a column to be in violation. The alert will only fire when the drift value is strictly greater than the threshold. :type threshold: float .. py:attribute:: threshold :type: float :value: None .. py:method:: __post_init__() .. py:class:: FeatureDriftConditionConfig Bases: :py:obj:`AlertConditionConfig` Feature Drift Condition Config for Monitor Alerts :param feature_drift_type: Feature drift type to apply the threshold on to determine whether a column has drifted significantly enough to be a violation. :type feature_drift_type: FeatureDriftType :param threshold: Threshold for when to consider a column to be in violation. The alert will only fire when the drift value is strictly greater than the threshold. :type threshold: float :param minimum_violations: Number of columns that must exceed the specified threshold to trigger an alert. :type minimum_violations: int :param feature_names: List of feature names to monitor for this alert. :type feature_names: List[str] .. py:attribute:: feature_drift_type :type: abacusai.api_class.enums.FeatureDriftType :value: None .. py:attribute:: threshold :type: float :value: None .. py:attribute:: minimum_violations :type: int :value: None .. py:attribute:: feature_names :type: List[str] :value: None .. py:method:: __post_init__() .. py:class:: TargetDriftConditionConfig Bases: :py:obj:`AlertConditionConfig` Target Drift Condition Config for Monitor Alerts :param feature_drift_type: Target drift type to apply the threshold on to determine whether a column has drifted significantly enough to be a violation. :type feature_drift_type: FeatureDriftType :param threshold: Threshold for when to consider the target column to be in violation. The alert will only fire when the drift value is strictly greater than the threshold. :type threshold: float .. py:attribute:: feature_drift_type :type: abacusai.api_class.enums.FeatureDriftType :value: None .. py:attribute:: threshold :type: float :value: None .. py:method:: __post_init__() .. py:class:: HistoryLengthDriftConditionConfig Bases: :py:obj:`AlertConditionConfig` History Length Drift Condition Config for Monitor Alerts :param feature_drift_type: History length drift type to apply the threshold on to determine whether the history length has drifted significantly enough to be a violation. :type feature_drift_type: FeatureDriftType :param threshold: Threshold for when to consider the history length to be in violation. The alert will only fire when the drift value is strictly greater than the threshold. :type threshold: float .. py:attribute:: feature_drift_type :type: abacusai.api_class.enums.FeatureDriftType :value: None .. py:attribute:: threshold :type: float :value: None .. py:method:: __post_init__() .. py:class:: DataIntegrityViolationConditionConfig Bases: :py:obj:`AlertConditionConfig` Data Integrity Violation Condition Config for Monitor Alerts :param data_integrity_type: This option selects the data integrity violations to monitor for this alert. :type data_integrity_type: DataIntegrityViolationType :param minimum_violations: Number of columns that must exceed the specified threshold to trigger an alert. :type minimum_violations: int .. py:attribute:: data_integrity_type :type: abacusai.api_class.enums.DataIntegrityViolationType :value: None .. py:attribute:: minimum_violations :type: int :value: None .. py:method:: __post_init__() .. py:class:: BiasViolationConditionConfig Bases: :py:obj:`AlertConditionConfig` Bias Violation Condition Config for Monitor Alerts :param bias_type: This option selects the bias metric to monitor for this alert. :type bias_type: BiasType :param threshold: Threshold for when to consider a column to be in violation. The alert will only fire when the drift value is strictly greater than the threshold. :type threshold: float :param minimum_violations: Number of columns that must exceed the specified threshold to trigger an alert. :type minimum_violations: int .. py:attribute:: bias_type :type: abacusai.api_class.enums.BiasType :value: None .. py:attribute:: threshold :type: float :value: None .. py:attribute:: minimum_violations :type: int :value: None .. py:method:: __post_init__() .. py:class:: PredictionCountConditionConfig Bases: :py:obj:`AlertConditionConfig` Deployment Prediction Condition Config for Deployment Alerts. By default we monitor if predictions made over a time window has reduced significantly. :param threshold: Threshold for when to consider to be a violation. Negative means alert on reduction, positive means alert on increase. :type threshold: float :param aggregation_window: Time window to aggregate the predictions over, e.g. 1h, 10m. Only h(hour), m(minute) and s(second) are supported. :type aggregation_window: str :param aggregation_type: Aggregation type to use for the aggregation window, e.g. sum, avg. :type aggregation_type: str .. py:attribute:: threshold :type: float :value: None .. py:attribute:: aggregation_window :type: str :value: None .. py:attribute:: aggregation_type :type: str :value: None .. py:method:: __post_init__() .. py:class:: _AlertConditionConfigFactory Bases: :py:obj:`abacusai.api_class.abstract._ApiClassFactory` Helper class that provides a standard way to create an ABC using inheritance. .. py:attribute:: config_abstract_class .. py:attribute:: config_class_key :value: 'alert_type' .. py:attribute:: config_class_key_value_camel_case :value: True .. py:attribute:: config_class_map .. py:class:: AlertActionConfig Bases: :py:obj:`abacusai.api_class.abstract.ApiClass` An abstract class for alert action configs .. py:attribute:: action_type :type: abacusai.api_class.enums.AlertActionType :value: None .. py:method:: _get_builder() :classmethod: .. py:class:: EmailActionConfig Bases: :py:obj:`AlertActionConfig` Email Action Config for Monitor Alerts :param email_recipients: List of email addresses to send the alert to. :type email_recipients: List[str] :param email_body: Body of the email to send. :type email_body: str .. py:attribute:: email_recipients :type: List[str] :value: None .. py:attribute:: email_body :type: str :value: None .. py:method:: __post_init__() .. py:class:: _AlertActionConfigFactory Bases: :py:obj:`abacusai.api_class.abstract._ApiClassFactory` Helper class that provides a standard way to create an ABC using inheritance. .. py:attribute:: config_abstract_class .. py:attribute:: config_class_key :value: 'action_type' .. py:attribute:: config_class_map .. py:class:: MonitorThresholdConfig Bases: :py:obj:`abacusai.api_class.abstract.ApiClass` Monitor Threshold Config for Monitor Alerts :param drift_type: Feature drift type to apply the threshold on to determine whether a column has drifted significantly enough to be a violation. :type drift_type: FeatureDriftType :param threshold_config: Thresholds for when to consider a column to be in violation. The alert will only fire when the drift value is strictly greater than the threshold. :type threshold_config: ThresholdConfigs .. py:attribute:: drift_type :type: abacusai.api_class.enums.FeatureDriftType :value: None .. py:attribute:: at_risk_threshold :type: float :value: None .. py:attribute:: severely_drifting_threshold :type: float :value: None .. py:method:: to_dict() Standardizes converting an ApiClass to dictionary. Keys of response dictionary are converted to camel case. This also validates the fields ( type, value, etc ) received in the dictionary.