Spaces:
Runtime error
Runtime error
updated app.py and models section
Browse files- app.py +12 -1
- models/metadata.json +13 -0
app.py
CHANGED
|
@@ -622,7 +622,18 @@ st.markdown("<div style='margin-top:2rem'></div>", unsafe_allow_html=True)
|
|
| 622 |
with st.expander("Model Details"):
|
| 623 |
st.markdown(f"**Best Model:** {metadata['best_model_name']}")
|
| 624 |
st.markdown(f"**Splits:** Train {metadata['train_seasons']} · Val {metadata['val_seasons']} · Test {metadata['test_seasons']}")
|
| 625 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 626 |
for name, r in metadata["results"].items():
|
| 627 |
val = r.get("val_2024", {})
|
| 628 |
test = r.get("test_2025", {})
|
|
|
|
| 622 |
with st.expander("Model Details"):
|
| 623 |
st.markdown(f"**Best Model:** {metadata['best_model_name']}")
|
| 624 |
st.markdown(f"**Splits:** Train {metadata['train_seasons']} · Val {metadata['val_seasons']} · Test {metadata['test_seasons']}")
|
| 625 |
+
|
| 626 |
+
if metadata.get("iteration_summary"):
|
| 627 |
+
st.markdown("**CV Iteration Comparison (5-fold, all models):**")
|
| 628 |
+
iter_df = pd.DataFrame(metadata["iteration_summary"])
|
| 629 |
+
iter_df = iter_df.rename(columns={
|
| 630 |
+
"iteration": "Iteration", "model": "Model",
|
| 631 |
+
"cv_f1": "CV F1", "cv_std": "± Std", "cv_acc": "CV Acc",
|
| 632 |
+
})
|
| 633 |
+
iter_df[["CV F1", "± Std", "CV Acc"]] = iter_df[["CV F1", "± Std", "CV Acc"]].round(4)
|
| 634 |
+
st.dataframe(iter_df.set_index("Iteration"), use_container_width=True)
|
| 635 |
+
|
| 636 |
+
st.markdown("**Final Holdout Evaluation (Val 2024 · Test 2025):**")
|
| 637 |
for name, r in metadata["results"].items():
|
| 638 |
val = r.get("val_2024", {})
|
| 639 |
test = r.get("test_2025", {})
|
models/metadata.json
CHANGED
|
@@ -45,6 +45,19 @@
|
|
| 45 |
"threshold_config": {
|
| 46 |
"Lost": 1.0
|
| 47 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
"results": {
|
| 49 |
"RF (n=300)": {
|
| 50 |
"val_2024": {
|
|
|
|
| 45 |
"threshold_config": {
|
| 46 |
"Lost": 1.0
|
| 47 |
},
|
| 48 |
+
"iteration_summary": [
|
| 49 |
+
{"iteration": "1 – Baseline", "model": "Logistic Regression", "cv_f1": 0.3605, "cv_std": 0.0225, "cv_acc": 0.3942},
|
| 50 |
+
{"iteration": "1 – Baseline", "model": "RF (n=100)", "cv_f1": 0.5380, "cv_std": 0.0198, "cv_acc": 0.5600},
|
| 51 |
+
{"iteration": "2 – Weather", "model": "Logistic Regression", "cv_f1": 0.3624, "cv_std": 0.0171, "cv_acc": 0.3888},
|
| 52 |
+
{"iteration": "2 – Weather", "model": "RF (n=200)", "cv_f1": 0.5275, "cv_std": 0.0180, "cv_acc": 0.5542},
|
| 53 |
+
{"iteration": "2 – Weather", "model": "XGBoost (n=200)", "cv_f1": 0.5358, "cv_std": 0.0175, "cv_acc": 0.5439},
|
| 54 |
+
{"iteration": "3 – History", "model": "RF (n=300)", "cv_f1": 0.5358, "cv_std": 0.0184, "cv_acc": 0.5772},
|
| 55 |
+
{"iteration": "3 – History", "model": "XGBoost (n=300)", "cv_f1": 0.5406, "cv_std": 0.0304, "cv_acc": 0.5523},
|
| 56 |
+
{"iteration": "3 – History", "model": "GradBoost (n=200)", "cv_f1": 0.5551, "cv_std": 0.0241, "cv_acc": 0.5772},
|
| 57 |
+
{"iteration": "4 – Quali/Pace", "model": "RF (n=300)", "cv_f1": 0.5200, "cv_std": 0.0183, "cv_acc": 0.5642},
|
| 58 |
+
{"iteration": "4 – Quali/Pace", "model": "XGBoost (n=300)", "cv_f1": 0.5414, "cv_std": 0.0310, "cv_acc": 0.5535},
|
| 59 |
+
{"iteration": "4 – Quali/Pace", "model": "GradBoost (n=200)", "cv_f1": 0.5497, "cv_std": 0.0204, "cv_acc": 0.5718}
|
| 60 |
+
],
|
| 61 |
"results": {
|
| 62 |
"RF (n=300)": {
|
| 63 |
"val_2024": {
|