Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -748,35 +748,41 @@ if st.session_state.app_step == "dev":
|
|
| 748 |
st.markdown('<div class="st-message-box st-success">Case has been built and results are displayed below.</div>', unsafe_allow_html=True)
|
| 749 |
|
| 750 |
def _dev_block(df, m):
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
st.markdown("""
|
| 756 |
-
<div style='text-align:left;font-size:0.8em;color:#6b7280;margin-top:-16px;margin-bottom:8px;'>
|
| 757 |
-
<strong>R:</strong> Pearson Correlation Coefficient<br>
|
| 758 |
-
<strong>RMSE:</strong> Root Mean Square Error<br>
|
| 759 |
-
<strong>MAE:</strong> Mean Absolute Error
|
| 760 |
-
</div>
|
| 761 |
-
""", unsafe_allow_html=True)
|
| 762 |
-
|
| 763 |
-
col_track, col_cross = st.columns([2, 3], gap="large")
|
| 764 |
-
with col_track:
|
| 765 |
-
st.plotly_chart(
|
| 766 |
-
track_plot(df, include_actual=True, pred_col="GR_Pred", actual_col="GR_Actual"),
|
| 767 |
-
use_container_width=False,
|
| 768 |
-
config={"displayModeBar": False, "scrollZoom": True}
|
| 769 |
-
)
|
| 770 |
-
with col_cross:
|
| 771 |
-
st.pyplot(cross_plot_static(df["GR_Actual"], df["GR_Pred"]), use_container_width=False)
|
| 772 |
|
| 773 |
-
|
| 774 |
-
|
| 775 |
-
|
| 776 |
-
|
| 777 |
-
|
| 778 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 779 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 780 |
# =========================
|
| 781 |
# VALIDATION (with actual GR)
|
| 782 |
# =========================
|
|
@@ -1001,6 +1007,6 @@ st.markdown("""
|
|
| 1001 |
<hr>
|
| 1002 |
<div style='text-align:center;color:#6b7280;font-size:1.0em;'>
|
| 1003 |
© 2025 Smart Thinking AI-Solutions Team. All rights reserved.<br>
|
| 1004 |
-
|
| 1005 |
</div>
|
| 1006 |
""", unsafe_allow_html=True)
|
|
|
|
| 748 |
st.markdown('<div class="st-message-box st-success">Case has been built and results are displayed below.</div>', unsafe_allow_html=True)
|
| 749 |
|
| 750 |
def _dev_block(df, m):
|
| 751 |
+
c1, c2, c3 = st.columns(3)
|
| 752 |
+
c1.metric("R", f"{m['R']:.3f}")
|
| 753 |
+
c2.metric("RMSE", f"{m['RMSE']:.3f}")
|
| 754 |
+
c3.metric("MAE", f"{m['MAE']:.3f}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 755 |
|
| 756 |
+
st.markdown(
|
| 757 |
+
"""
|
| 758 |
+
<div style='text-align:left;font-size:0.8em;color:#6b7280;margin-top:-16px;margin-bottom:8px;'>
|
| 759 |
+
<strong>R:</strong> Pearson Correlation Coefficient<br>
|
| 760 |
+
<strong>RMSE:</strong> Root Mean Square Error<br>
|
| 761 |
+
<strong>MAE:</strong> Mean Absolute Error
|
| 762 |
+
</div>
|
| 763 |
+
""",
|
| 764 |
+
unsafe_allow_html=True,
|
| 765 |
+
)
|
| 766 |
|
| 767 |
+
col_track, col_cross = st.columns([2, 3], gap="large")
|
| 768 |
+
with col_track:
|
| 769 |
+
st.plotly_chart(
|
| 770 |
+
track_plot(df, include_actual=True, pred_col="GR_Pred", actual_col="GR_Actual"),
|
| 771 |
+
use_container_width=False,
|
| 772 |
+
config={"displayModeBar": False, "scrollZoom": True},
|
| 773 |
+
)
|
| 774 |
+
with col_cross:
|
| 775 |
+
st.pyplot(cross_plot_static(df["GR_Actual"], df["GR_Pred"]), use_container_width=False)
|
| 776 |
+
|
| 777 |
+
|
| 778 |
+
if "Train" in st.session_state.results or "Test" in st.session_state.results:
|
| 779 |
+
tab1, tab2 = st.tabs(["Training", "Testing"])
|
| 780 |
+
if "Train" in st.session_state.results:
|
| 781 |
+
with tab1:
|
| 782 |
+
_dev_block(st.session_state.results["Train"], st.session_state.results["m_train"])
|
| 783 |
+
if "Test" in st.session_state.results:
|
| 784 |
+
with tab2:
|
| 785 |
+
_dev_block(st.session_state.results["Test"], st.session_state.results["m_test"])
|
| 786 |
# =========================
|
| 787 |
# VALIDATION (with actual GR)
|
| 788 |
# =========================
|
|
|
|
| 1007 |
<hr>
|
| 1008 |
<div style='text-align:center;color:#6b7280;font-size:1.0em;'>
|
| 1009 |
© 2025 Smart Thinking AI-Solutions Team. All rights reserved.<br>
|
| 1010 |
+
Website: <a href="https://smartthinking.com.sa" target="_blank" rel="noopener noreferrer">smartthinking.com.sa</a>
|
| 1011 |
</div>
|
| 1012 |
""", unsafe_allow_html=True)
|