File size: 565 Bytes
0e8f14a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import streamlit as st
import numpy as np
st.title("Intrusion Detection System")
st.write("Enter input values:")
# Example input (adjust size if needed)
inputs = []
for i in range(50): # match your feature count
val = st.number_input(f"Feature {i+1}", value=0.0)
inputs.append(val)
if st.button("Predict"):
data = np.array(inputs).reshape(1, -1)
prediction = model.predict(data)
result = int(prediction[0][0] > 0.5)
if result == 1:
st.error("⚠️ Attack Detected")
else:
st.success("✅ Normal Traffic") |