Collect and label logs
Gather real telemetry, label confirmed incidents where possible, and remove synthetic or duplicated records before training.
Explainable anomaly detection. Assess anomaly explanations.
Explainable anomaly detection pairs an unsupervised or semi-supervised detector with explanations that help analysts triage alerts. Key issues include synthetic or unrepresentative training data, calibration of anomaly scores to analyst workload, and stability of explanations under small input changes.
Learning concept · Not a validated service
Explainable anomaly detection pairs an unsupervised or semi-supervised detector with explanations that help analysts triage alerts. Key issues include synthetic or unrepresentative training data, calibration of anomaly scores to analyst workload, and stability of explanations under small input changes.
A proposed application is security-operations triage: surface anomalous sessions or transactions with an explanation that a human analyst can validate before escalation. This is a suggested extension; the supplied starter does not implement analyst-facing explanations and should not be used for live security decisions without review.
Gather real telemetry, label confirmed incidents where possible, and remove synthetic or duplicated records before training.
Fit an isolation-forest or other detector on training data and hold out a labelled validation set to estimate recall and false positive rate.
Attach explanation methods (SHAP, LIME or surrogate models) and measure explanation stability and narrative utility for analysts.
Expose scores and explanations in a dashboard, require human confirmation for high-impact actions, and monitor drift and calibration over time.
The supplied starter generates synthetic 'normal' and 'suspicious' tabular logs, fits an IsolationForest (contamination=0.05), marks rows with fit_predict() as anomalies, and prints the alerts. It does not compute or display any explanations (SHAP/LIME) nor use real labelled data.
logs = pd.concat([normal, suspicious], ignore_index=True)
detector = IsolationForest(contamination=0.05, random_state=42)
logs["anomaly_score"] = detector.fit_predict(logs)
alerts = logs[logs["anomaly_score"] == -1]The code uses small synthetic data (300 normal, 15 injected suspicious rows) and an unsupervised IsolationForest without any explanation method. The dataset is not representative of production logs, there are no held-out labels for evaluation beyond the synthetic injection, and no explanation, calibration or stability checks are implemented.
A proposed extension is a triage dashboard that pairs detector alerts with per-feature attributions (SHAP or a surrogate rule list) and a confidence band, so analysts can accept, investigate or dismiss alerts with traceable reasoning.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.