SilverDragon9 commited on
Commit
de1891e
·
1 Parent(s): 68ebb5b

initial commit

Browse files
Files changed (1) hide show
  1. Sniffer_AI.py +6 -6
Sniffer_AI.py CHANGED
@@ -9,9 +9,9 @@ from sklearn.tree import DecisionTreeClassifier
9
 
10
  # Load the saved models
11
  rf_model = joblib.load('rf_model.pkl')
12
- dt_model = joblib.load('dt_model.pkl')
13
- bagging_model = joblib.load('bagging_model.pkl')
14
- ada_model = joblib.load('ada_model.pkl')
15
 
16
  class_labels = {
17
  0: "normal",
@@ -34,11 +34,11 @@ def detect_intrusion(features, model_choice="Random Forest"):
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
 
 
9
 
10
  # Load the saved models
11
  rf_model = joblib.load('rf_model.pkl')
12
+ dt_model = joblib.load('decision_tree_model.pkl')
13
+ bagging_model = joblib.load('model_bagging.pkl')
14
+ ada_model = joblib.load('model_adaboost.pkl')
15
 
16
  class_labels = {
17
  0: "normal",
 
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":
41
+ model = model_adaboost
42
  else:
43
  return "Invalid model choice!"
44