7,666
社区成员
发帖
与我相关
我的任务
分享阈值设置需要结合真实业务数据,不能只看模型训练指标。
normal_scores = collect_normal_data(model)
threshold = np.percentile(normal_scores, 95)
```
int over_count = 0;
for (int i = 0; i < 10; i++) {
if (score[i] > threshold) {
over_count++;
}
}
if (over_count >= 7) {
trigger_alarm();
}
```3. 分场景设置阈值
例如:
白天阈值:0.7
夜间阈值:0.6
设备启动前 30 分钟:不告警
4. 定期更新阈值
设备运行一段时间后,根据真实告警结果重新校准。