Spaces:
Runtime error
Runtime error
| import numpy as np | |
| from sklearn.ensemble import IsolationForest | |
| class AIThreatAnalyzer: | |
| def __init__(self): | |
| self.model = IsolationForest(contamination=0.01) | |
| def train(self, data): | |
| self.model.fit(data) | |
| def predict(self, new_data): | |
| return self.model.predict(new_data) | |