12345678910111213141516171819 |
- # -*- coding: utf-8 -*-
- """
- @author: zsc
- @time: 2024/11/18
- @desc: 行为分析
- """
- # 异常检测模块
- class AnomalyDetector:
- def __init__(self, behavior_data):
- self.behavior_data = behavior_data
- def detect(self):
- # 根据新的数据结构调整异常检测逻辑
- anomalies = []
- for user, actions in self.behavior_data.items():
- if '结果-支用成功' in actions and actions['结果-支用成功'] > 5:
- anomalies.append(user)
- return anomalies
|