Spaces:
Runtime error
Runtime error
File size: 263 Bytes
d75e318 |
1 2 3 4 5 6 7 8 9 10 |
import joblib
import numpy as np
def load_anomaly_model(path='models/anomaly_detector.pkl'):
return joblib.load(path)
def is_anomalous(features, model):
score = model.decision_function([features])[0]
return model.predict([features])[0] == -1, score
|