Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -582,15 +582,16 @@ if st.session_state.app_step == "dev":
|
|
| 582 |
""", unsafe_allow_html=True)
|
| 583 |
|
| 584 |
# 2-column layout, big gap (prevents overlap)
|
| 585 |
-
|
| 586 |
-
with col_cross:
|
| 587 |
-
st.pyplot(cross_plot_static(df[TARGET], df["UCS_Pred"]), use_container_width=False)
|
| 588 |
with col_track:
|
| 589 |
st.plotly_chart(
|
| 590 |
track_plot(df, include_actual=True),
|
| 591 |
use_container_width=False, # Set to False to honor the width in track_plot()
|
| 592 |
config={"displayModeBar": False, "scrollZoom": True}
|
| 593 |
)
|
|
|
|
|
|
|
|
|
|
| 594 |
|
| 595 |
if "Train" in st.session_state.results or "Test" in st.session_state.results:
|
| 596 |
tab1, tab2 = st.tabs(["Training", "Testing"])
|
|
@@ -612,7 +613,7 @@ if st.session_state.app_step == "validate":
|
|
| 612 |
st.sidebar.caption(f"**Data loaded:** {up.name} • {df0.shape[0]} rows × {df0.shape[1]} cols")
|
| 613 |
if st.sidebar.button("Preview data", use_container_width=True, disabled=(up is None)):
|
| 614 |
st.session_state.show_preview_modal = True # Set state to show modal
|
| 615 |
-
go_btn = st.sidebar.button("Predict", type="primary", use_container_width=True)
|
| 616 |
if st.sidebar.button("⬅ Back to Case Building", use_container_width=True): st.session_state.app_step="dev"; st.rerun()
|
| 617 |
if st.sidebar.button("Proceed to Prediction ▶", use_container_width=True): st.session_state.app_step="predict"; st.rerun()
|
| 618 |
|
|
@@ -658,20 +659,20 @@ if st.session_state.app_step == "validate":
|
|
| 658 |
<strong>MAE:</strong> Mean Absolute Error
|
| 659 |
</div>
|
| 660 |
""", unsafe_allow_html=True)
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
with col_cross:
|
| 664 |
-
st.pyplot(
|
| 665 |
-
cross_plot_static(st.session_state.results["Validate"][TARGET],
|
| 666 |
-
st.session_state.results["Validate"]["UCS_Pred"]),
|
| 667 |
-
use_container_width=False
|
| 668 |
-
)
|
| 669 |
with col_track:
|
| 670 |
st.plotly_chart(
|
| 671 |
track_plot(st.session_state.results["Validate"], include_actual=True),
|
| 672 |
use_container_width=False, # Set to False to honor the width in track_plot()
|
| 673 |
config={"displayModeBar": False, "scrollZoom": True}
|
| 674 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 675 |
|
| 676 |
sv = st.session_state.results["sv_val"]
|
| 677 |
if sv["oor"] > 0: st.markdown('<div class="st-message-box st-warning">Some inputs fall outside **training min–max** ranges.</div>', unsafe_allow_html=True)
|
|
|
|
| 582 |
""", unsafe_allow_html=True)
|
| 583 |
|
| 584 |
# 2-column layout, big gap (prevents overlap)
|
| 585 |
+
col_track, col_cross = st.columns([2, 3], gap="large")
|
|
|
|
|
|
|
| 586 |
with col_track:
|
| 587 |
st.plotly_chart(
|
| 588 |
track_plot(df, include_actual=True),
|
| 589 |
use_container_width=False, # Set to False to honor the width in track_plot()
|
| 590 |
config={"displayModeBar": False, "scrollZoom": True}
|
| 591 |
)
|
| 592 |
+
with col_cross:
|
| 593 |
+
st.pyplot(cross_plot_static(df[TARGET], df["UCS_Pred"]), use_container_width=False)
|
| 594 |
+
|
| 595 |
|
| 596 |
if "Train" in st.session_state.results or "Test" in st.session_state.results:
|
| 597 |
tab1, tab2 = st.tabs(["Training", "Testing"])
|
|
|
|
| 613 |
st.sidebar.caption(f"**Data loaded:** {up.name} • {df0.shape[0]} rows × {df0.shape[1]} cols")
|
| 614 |
if st.sidebar.button("Preview data", use_container_width=True, disabled=(up is None)):
|
| 615 |
st.session_state.show_preview_modal = True # Set state to show modal
|
| 616 |
+
go_btn = st.sidebar.button("Predict & Validate", type="primary", use_container_width=True)
|
| 617 |
if st.sidebar.button("⬅ Back to Case Building", use_container_width=True): st.session_state.app_step="dev"; st.rerun()
|
| 618 |
if st.sidebar.button("Proceed to Prediction ▶", use_container_width=True): st.session_state.app_step="predict"; st.rerun()
|
| 619 |
|
|
|
|
| 659 |
<strong>MAE:</strong> Mean Absolute Error
|
| 660 |
</div>
|
| 661 |
""", unsafe_allow_html=True)
|
| 662 |
+
|
| 663 |
+
col_track, col_cross = st.columns([2, 3], gap="large")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 664 |
with col_track:
|
| 665 |
st.plotly_chart(
|
| 666 |
track_plot(st.session_state.results["Validate"], include_actual=True),
|
| 667 |
use_container_width=False, # Set to False to honor the width in track_plot()
|
| 668 |
config={"displayModeBar": False, "scrollZoom": True}
|
| 669 |
)
|
| 670 |
+
with col_cross:
|
| 671 |
+
st.pyplot(
|
| 672 |
+
cross_plot_static(st.session_state.results["Validate"][TARGET],
|
| 673 |
+
st.session_state.results["Validate"]["UCS_Pred"]),
|
| 674 |
+
use_container_width=False
|
| 675 |
+
)
|
| 676 |
|
| 677 |
sv = st.session_state.results["sv_val"]
|
| 678 |
if sv["oor"] > 0: st.markdown('<div class="st-message-box st-warning">Some inputs fall outside **training min–max** ranges.</div>', unsafe_allow_html=True)
|