Commit
·
e489d41
1
Parent(s):
e7bef06
Update Sniffer_AI.py
Browse files- Sniffer_AI.py +4 -2
Sniffer_AI.py
CHANGED
|
@@ -26,13 +26,15 @@ class_labels = {
|
|
| 26 |
9: "mitm"
|
| 27 |
}
|
| 28 |
|
| 29 |
-
def detect_intrusion(features, model_choice="
|
| 30 |
# Convert the input string (comma-separated values) into a list of floats
|
| 31 |
features = [list(map(float, features.split(",")))]
|
| 32 |
|
| 33 |
# Choose the model based on user selection
|
| 34 |
-
if model_choice == "
|
| 35 |
model = rf_model
|
|
|
|
|
|
|
| 36 |
elif model_choice == "Bagging Classifier":
|
| 37 |
model = model_bagging
|
| 38 |
elif model_choice == "AdaBoost Classifier":
|
|
|
|
| 26 |
9: "mitm"
|
| 27 |
}
|
| 28 |
|
| 29 |
+
def detect_intrusion(features, model_choice="Random Forest"):
|
| 30 |
# Convert the input string (comma-separated values) into a list of floats
|
| 31 |
features = [list(map(float, features.split(",")))]
|
| 32 |
|
| 33 |
# Choose the model based on user selection
|
| 34 |
+
if model_choice == "Random Forest":
|
| 35 |
model = rf_model
|
| 36 |
+
elif model_choice == "Decision Tree":
|
| 37 |
+
model = decision_tree_model
|
| 38 |
elif model_choice == "Bagging Classifier":
|
| 39 |
model = model_bagging
|
| 40 |
elif model_choice == "AdaBoost Classifier":
|