Spaces:
Sleeping
Sleeping
File size: 371 Bytes
a309487 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import numpy as np
class MonitoringEngine:
def detect_drift(self, train_stats, new_data_stats, threshold=0.2):
drift_flags = {}
for feature in train_stats:
if abs(train_stats[feature] - new_data_stats.get(feature, train_stats[feature])) > threshold:
drift_flags[feature] = True
return drift_flags
|