Spaces:
Sleeping
Sleeping
Commit
·
4e38b37
1
Parent(s):
970a522
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,10 +76,10 @@ def detect_intrusion(*feature_values, label_value, model_choice="Random Forest")
|
|
| 76 |
return f"Intrusion Detected: {class_labels.get(predicted_class, 'Unknown Attack')}"
|
| 77 |
|
| 78 |
# Create Gradio input fields for each feature (excluding label initially)
|
| 79 |
-
inputs = [gr.Textbox(label=feature_name) for feature_name in feature_names[
|
| 80 |
|
| 81 |
# Add label input field
|
| 82 |
-
|
| 83 |
|
| 84 |
# Add model choice dropdown
|
| 85 |
inputs.append(gr.Dropdown(choices=["Random Forest", "Decision Tree", "Bagging Classifier", "AdaBoost Classifier"], label="Select Model"))
|
|
|
|
| 76 |
return f"Intrusion Detected: {class_labels.get(predicted_class, 'Unknown Attack')}"
|
| 77 |
|
| 78 |
# Create Gradio input fields for each feature (excluding label initially)
|
| 79 |
+
inputs = [gr.Textbox(label=feature_name) for feature_name in feature_names[:-1]] # Exclude the last one (label) from inputs
|
| 80 |
|
| 81 |
# Add label input field
|
| 82 |
+
inputs.append(gr.Textbox(label="label"))
|
| 83 |
|
| 84 |
# Add model choice dropdown
|
| 85 |
inputs.append(gr.Dropdown(choices=["Random Forest", "Decision Tree", "Bagging Classifier", "AdaBoost Classifier"], label="Select Model"))
|