albin commited on
Commit
f60f8c3
·
1 Parent(s): df99a21

change threshold

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -127,10 +127,10 @@ async def predict(request: Request, requess: Req = Depends(form_req)):
127
  print("Data types:", dataFrame_features[selected_columns].dtypes)
128
 
129
  prediction_proba = model.predict_proba(data)[:, 1]
130
- threshold = 0.5
131
  output = 1 if prediction_proba >= threshold else 0
132
 
133
- output_text = "Legitimate URL" if output == 1 else "Phishing URL"
134
 
135
  # Render index.html with prediction results
136
  json_compatible_resp_data = jsonable_encoder(Resp(url=requess.url, label=output_text))
 
127
  print("Data types:", dataFrame_features[selected_columns].dtypes)
128
 
129
  prediction_proba = model.predict_proba(data)[:, 1]
130
+ threshold = 0.05
131
  output = 1 if prediction_proba >= threshold else 0
132
 
133
+ output_text = "Legitimate" if output == 1 else "Phishing"
134
 
135
  # Render index.html with prediction results
136
  json_compatible_resp_data = jsonable_encoder(Resp(url=requess.url, label=output_text))