Palak565/Real-Time-Network-Anomaly-Detection-System ? reverse-engineered prompt

Reverse engineered prompt

Build me a real time network intrusion detection app that can watch live traffic, score it for suspicious activity, and show the results in a simple dashboard.

I want it to sniff packets from a chosen network interface, group them into flow style records, and then run those records through a trained model based on the NSL KDD dataset. It should be able to tell me if traffic looks normal or like an attack, and save those predictions so I can review them later. Please include a small training script, an offline test script for checking the model on the provided dataset, and a Streamlit dashboard with live monitoring, model performance, and history views.

Use Spark for the streaming part, PySpark ML for the model, and make the live capture work with tshark or pyshark. Keep it practical and runnable from the command line, and if you need current docs for any library, look them up online.