chkp-talexm commited on
Commit ·
855e055
1
Parent(s): d84704c
app.py
CHANGED
|
@@ -199,7 +199,7 @@ if uploaded_file:
|
|
| 199 |
|
| 200 |
input_pool = Pool(input_df, cat_features=cat_features)
|
| 201 |
catboost_preds = catboost.predict(input_pool)
|
| 202 |
-
|
| 203 |
label_encoders = {} # Store encoders to ensure consistency
|
| 204 |
|
| 205 |
for col in cat_features:
|
|
@@ -260,17 +260,15 @@ if uploaded_file:
|
|
| 260 |
# # ✅ Make Predictions with RandomForest
|
| 261 |
# rf_preds = rf.predict(input_df_rf)
|
| 262 |
|
| 263 |
-
catboost_probs = catboost.predict_proba(input_df)[:, 1]
|
| 264 |
xgb_probs = xgb.predict_proba(input_df)[:, 1]
|
| 265 |
#rf_probs = rf.predict_proba(input_df)[:, 1]
|
| 266 |
-
|
| 267 |
# Combine results
|
| 268 |
predictions_df = pd.DataFrame({
|
| 269 |
"CatBoost": catboost_preds,
|
| 270 |
"XGBoost": xgb_preds,
|
| 271 |
# "RandomForest": rf_preds
|
| 272 |
})
|
| 273 |
-
|
| 274 |
# Apply "at least one model predicts 1" rule
|
| 275 |
predictions_df["is_click_predicted"] = predictions_df.max(axis=1)
|
| 276 |
|
|
|
|
| 199 |
|
| 200 |
input_pool = Pool(input_df, cat_features=cat_features)
|
| 201 |
catboost_preds = catboost.predict(input_pool)
|
| 202 |
+
catboost_probs = catboost.predict_proba(input_df)[:, 1]
|
| 203 |
label_encoders = {} # Store encoders to ensure consistency
|
| 204 |
|
| 205 |
for col in cat_features:
|
|
|
|
| 260 |
# # ✅ Make Predictions with RandomForest
|
| 261 |
# rf_preds = rf.predict(input_df_rf)
|
| 262 |
|
|
|
|
| 263 |
xgb_probs = xgb.predict_proba(input_df)[:, 1]
|
| 264 |
#rf_probs = rf.predict_proba(input_df)[:, 1]
|
| 265 |
+
#test
|
| 266 |
# Combine results
|
| 267 |
predictions_df = pd.DataFrame({
|
| 268 |
"CatBoost": catboost_preds,
|
| 269 |
"XGBoost": xgb_preds,
|
| 270 |
# "RandomForest": rf_preds
|
| 271 |
})
|
|
|
|
| 272 |
# Apply "at least one model predicts 1" rule
|
| 273 |
predictions_df["is_click_predicted"] = predictions_df.max(axis=1)
|
| 274 |
|