Scikit-learn
English
Greek
IOT
CyberSecurity
Intrusion
Detection
IDS
SilverDragon9 commited on
Commit
e7bef06
·
1 Parent(s): 5f01070

Update Sniffer_AI.py

Browse files
Files changed (1) hide show
  1. Sniffer_AI.py +4 -6
Sniffer_AI.py CHANGED
@@ -26,19 +26,17 @@ class_labels = {
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 = dt_model
38
  elif model_choice == "Bagging Classifier":
39
- model = bagging_model
40
  elif model_choice == "AdaBoost Classifier":
41
- model = ada_model
42
  else:
43
  return "Invalid model choice!"
44
 
 
26
  9: "mitm"
27
  }
28
 
29
+ def detect_intrusion(features, model_choice="Decision Tree"):
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 == "Decision Tree":
35
  model = rf_model
 
 
36
  elif model_choice == "Bagging Classifier":
37
+ model = model_bagging
38
  elif model_choice == "AdaBoost Classifier":
39
+ model = model_adaboost
40
  else:
41
  return "Invalid model choice!"
42