Module aivis_engine_v2_ad_sdk_python.inference
Classes
class AnomalyDetectionInference (handle, key)-
Class for creating and handling anomaly detection inference. This is your entry point for all inference operations.
Private constructor. To create new instances use any of:
Static methods
def create_by_incremental_learning(cls, learning: AnomalyDetectionIncrementalLearning, config_json: str) ‑> AnomalyDetectionInference-
@
FlavourRequirement([Flavour.FULL])Create anomaly detection inference for the given learning handle and config.
To compute anomaly scores with this inference instance use any of:
AnomalyDetectionInference.infer_booleanAnomalyDetectionInference.infer_floatAnomalyDetectionInference.infer_string
Parameters
learning:aivis_engine_v2_ad_sdk_python.learning.AnomalyDetectionIncrementalLearning- Instance of anomaly detection incremental learning
config_json:strDtoInferenceConfigas JSON string
Returns
AnomalyDetectionInference- Instance of anomaly detection inference
def create_by_model(cls, model_json: str, config_json: str) ‑> AnomalyDetectionInference-
@
FlavourRequirement([Flavour.FULL, Flavour.INFERENCE])Create anomaly detection inference for given model and config.
Use -
AnomalyDetectionInference.infer()- `AnomalyDetectionInference.infer_with_next_normal' to compute anomaly scores with this inference instance.Parameters
model_json:strDtoModelas JSON stringconfig_json:strDtoInferenceConfigas JSON string
Returns
AnomalyDetectionInference- Instance of anomaly detection inference
def create_by_training(cls, training: AnomalyDetectionTraining, config_json: str) ‑> AnomalyDetectionInference-
@
FlavourRequirement([Flavour.FULL])Create anomaly detection inference for given training handle and config.
Use -
AnomalyDetectionInference.infer()- `AnomalyDetectionInference.infer_with_next_normal' to compute anomaly scores with this inference instance.Parameters
training:AnomalyDetectionTraining- Instance of anomaly detection training
config_json:strDtoInferenceConfigas JSON string
Returns
AnomalyDetectionInference- Instance of anomaly detection inference
Methods
def destroy(self)-
@
FlavourRequirement([Flavour.FULL, Flavour.INFERENCE])Destroy this anomaly detection inference. It's always safe to destroy an inference. Internally the destruction only takes place after all references to this object have been released.
def get_data_specification(self) ‑> str-
@
FlavourRequirement([Flavour.FULL, Flavour.INFERENCE])Get this inference's
DtoInferenceDataSpecificationReturns
strDtoInferenceDataSpecificationas JSON string
def infer(self, data: AnomalyDetectionData, timestamps: List[int]) ‑> List[DtoFloatDataPoint]-
@
FlavourRequirement([Flavour.FULL, Flavour.INFERENCE])Calculate inference for given data and timestamps. The result will be a list of
DtoFloatDataPointinstances corresponding to given timestamps. Make sure to fill theAnomalyDetectionDatawith all data needed for calculation. Check the model's inference data specification for needed signals and time ranges.Parameters
data:AnomalyDetectionData- Instance of anomaly detection data
timestamps:List[int]- List of timestamps
Returns
List[DtoFloatDataPoint]- List of float data points
def infer_with_next_normal(self, data: AnomalyDetectionData, timestamps: List[int], config_json: str) ‑> List[DtoFloatDataPointWithNextNormal]-
@
FlavourRequirement([Flavour.FULL, Flavour.INFERENCE])For given data, timestamps and next normal config, calculate the inference and the closest point that is normal as defined by the normal config. The result will be a list of
DtoFloatDataPointWithNextNormalinstances corresponding to given timestamps. Make sure to fill theAnomalyDetectionDatawith all data needed for calculation. Check the model's inference data specification for needed signals and time ranges.@experimental: Might change in future releases. See the user guide for known performance issues.
Parameters
data:AnomalyDetectionData- Instance of anomaly detection data
timestamps:List[int]- List of timestamps
config_json:strDtoNextNormalConfigas JSON string
Returns
List[DtoFloatDataPointWithNextNormal]- List of enhanced float data points