-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import time | ||
|
||
class RiskMonitoring: | ||
def __init__(self, risk_assessment_model, risk_mitigation_model): | ||
self.risk_assessment_model = risk_assessment_model | ||
self.risk_mitigation_model = risk_mitigation_model | ||
|
||
def monitor_risks(self, transactions): | ||
for transaction in transactions: | ||
risk_level = self.risk_assessment_model.predict_risk(transaction) | ||
if risk_level == 'high': | ||
mitigation_result = self.risk_mitigation_model.mitigate_risk(transaction) | ||
print(f'High-risk transaction detected: {mitigation_result}') | ||
elif risk_level == 'medium': | ||
mitigation_result = self.risk_mitigation_model.mitigate_risk(transaction) | ||
print(f'Medium-risk transaction detected: {mitigation_result}') | ||
else: | ||
print(f'Low-risk transaction detected: Transaction approved') | ||
time.sleep(1) |