chkp-talexm
commited on
Commit
Β·
ecdd8e8
1
Parent(s):
3c8ed5d
update
Browse files
app.py
CHANGED
@@ -293,7 +293,15 @@ if uploaded_file:
|
|
293 |
# β
Apply Threshold to Convert Probabilities into Binary Predictions
|
294 |
THRESHOLD = 0.7 # Adjust to control false positives
|
295 |
|
|
|
|
|
|
|
|
|
296 |
|
|
|
|
|
|
|
|
|
297 |
|
298 |
predictions_df = pd.DataFrame({
|
299 |
"CatBoost": catboost_preds,
|
@@ -301,8 +309,6 @@ if uploaded_file:
|
|
301 |
# "RandomForest": rf_preds
|
302 |
})
|
303 |
|
304 |
-
catboost_preds = (catboost_probs >= THRESHOLD).astype(int)
|
305 |
-
xgb_preds = (xgb_probs >= THRESHOLD).astype(int)
|
306 |
# Apply "at least one model predicts 1" rule
|
307 |
predictions_df["is_click_predicted"] = predictions_df.max(axis=1)
|
308 |
|
|
|
293 |
# β
Apply Threshold to Convert Probabilities into Binary Predictions
|
294 |
THRESHOLD = 0.7 # Adjust to control false positives
|
295 |
|
296 |
+
# β
Debugging: Print probability distributions before thresholding
|
297 |
+
print("π Probability Distributions Before Thresholding:")
|
298 |
+
print("CatBoost:\n", pd.Series(catboost_probs).describe())
|
299 |
+
print("XGBoost:\n", pd.Series(xgb_probs).describe())
|
300 |
|
301 |
+
# β
Apply Threshold to Convert Probabilities into Binary Predictions
|
302 |
+
THRESHOLD = 0.7 # Adjust to control false positives
|
303 |
+
catboost_preds = (catboost_probs >= THRESHOLD).astype(int)
|
304 |
+
xgb_preds = (xgb_probs >= THRESHOLD).astype(int)
|
305 |
|
306 |
predictions_df = pd.DataFrame({
|
307 |
"CatBoost": catboost_preds,
|
|
|
309 |
# "RandomForest": rf_preds
|
310 |
})
|
311 |
|
|
|
|
|
312 |
# Apply "at least one model predicts 1" rule
|
313 |
predictions_df["is_click_predicted"] = predictions_df.max(axis=1)
|
314 |
|