Seyomi's picture
Add application file
d75e318
raw
history blame contribute delete
263 Bytes
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