Skip to content

Commit 7686785

Browse files
author
Max
committed
predict() from greedy_ensemble_selection.py now returns a DataFrame with item_id, user_id, etc., instead of just a series of scores
1 parent 1c6c0c1 commit 7686785

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lkauto/ensemble/greedy_ensemble_selection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ def predict(self, x_data: ItemListCollection):
7676

7777
ens_predictions = self.ensemble_predict([np.array(bm_pred.to_df()) for bm_pred in bm_preds])
7878

79-
return pd.Series(ens_predictions, index=test_ind)
79+
predictions = bm_preds[0].to_df().copy()
80+
81+
predictions["score"] = ens_predictions
82+
83+
return pd.Series(predictions, index=test_ind)
8084

8185
def ensemble_fit(self, predictions: List[np.ndarray], labels: np.ndarray):
8286
self.ensemble_size = int(self.ensemble_size)

0 commit comments

Comments
 (0)