v3 · Colab run · part 7 of 7
Submission
The notebook exactly as it ran on Colab's T4 GPU, with its real outputs.
Download the executed notebook
Left: what & whyRight: the code and its real output
7. Submission
submission.csv = the best scenario. The decoder is re-tuned on all out-of-fold predictions, then applied to the test predictions.
The 2nd and 3rd best are saved too (submission_rank2.csv, submission_rank3.csv).
Pick by CV, not by the public leaderboard: the public part is only a slice of the test set.
prog.start("write submissions") ranked = sorted(rows, key=lambda r: -r["score"][0]) for i, r in enumerate(ranked[:3]): o, t = r["out"] prm = r["fit"](o, y, W_tr, MT_tr) pred = r["apply"](t, prm, MT_te) fname = "submission.csv" if i == 0 else f"submission_rank{i + 1}.csv" pd.DataFrame({"ID": test["space_id"], "price_tier": pred.astype(int) + 1}).to_csv(WORK / fname, index=False) print(f"{fname:24s} ← {r['scenario']} | {r['decoder']} | CV (test-weighted) {r['score'][0]:.4f}") prog.finish() pd.read_csv(WORK / "submission.csv").price_tier.value_counts().sort_index()
▶ write submissions [████████████████████████████░░ 20/21 (95%)] submission.csv ← stack | A class weights | CV (test-weighted) 0.7214 submission_rank2.csv ← opt_blend + xgb_reg (a=0.7) | B cut-points | CV (test-weighted) 0.7199 submission_rank3.csv ← opt_blend + xgb_reg (a=0.5) | B cut-points | CV (test-weighted) 0.7198 ✓ write submissions: took 0.2 min | [██████████████████████████████ 21/21 (100%)] | elapsed 36.0 min | ETA ~-
| count | |
|---|---|
| price_tier | |
| 1 | 25533 |
| 2 | 37412 |
| 3 | 26906 |
| 4 | 24687 |