Code: Can we trust an alert model, and the AI that explains its alerts?
Every number on the case study page comes from these files. View any file in the browser, download one, or get them all as a zip.
| File | What it does | Open |
|---|---|---|
| analysis.py | Loads the data, builds both models, runs the honest test, the cut-off table and the failure analysis, picks 10 alerts and scores the AI's answers. Writes results.json. | View · Download |
| llm_check.py | Sends each alert to Gemini 3.1 Flash-Lite (3 times, once without the model score, once with a trap question) and saves the answers. | View · Download |
| results.json | Every number on the page. | View · Download |
| llm_runs.json | All 50 AI answers, word for word. | View · Download |
Download all (alert-model-check.zip)
Run it yourself
- Download KDDTrain+.txt and KDDTest+.txt (NSL-KDD, University of New Brunswick) into a folder named data/.
pip install pandas scikit-learn xgboostpython3 analysis.py- Optional, to ask the AI again: GEMINI_API_KEY=... python3 llm_check.py, then python3 analysis.py once more.