in frauddetector/frauddetector.py [0:0]
def activate(self, outcomes_list=None):
"""create a Fraud Detector detector and activate a model with outcomes
Args:
:outcomes_list: list; list of (outcome_name, outcome_description) tuples
"""
if self.model_status != 'TRAINING_COMPLETE' and self.model_status != 'ACTIVE':
raise EnvironmentError("model training must be complete before compiling")
# create a new detector
self.fd.put_detector(
detectorId=self.detector_name,
eventTypeName=self.event_type
)
# put outcomes - if no outcomes, skip this (may be activating a model to work with existing outcomes)
if outcomes_list:
self.create_outcomes(outcomes_list=outcomes_list)
# Activate the model
self.fd.update_model_version_status(
modelId=self.model_name,
modelType=self.model_type,
modelVersionNumber=self.model_version,
status='ACTIVE'
)