3v324v23 commited on
Commit
ba39959
·
1 Parent(s): ade71f0
Files changed (1) hide show
  1. streamlit_simulation/app.py +31 -31
streamlit_simulation/app.py CHANGED
@@ -241,37 +241,37 @@ def render_simulation_view(timestamp, prediction, actual, progress, fig, paused=
241
  unsafe_allow_html=True
242
  )
243
 
244
- with info_container.container():
245
- st.markdown("<div style='margin-top: 5rem;'></div>", unsafe_allow_html=True)
246
- st.markdown(
247
- f"<span style='font-size: 24px; font-weight: 600; color: {HEADER_COLOR} !important;'>Time: {timestamp}</span>",
248
- unsafe_allow_html=True
249
- )
250
-
251
- st.metric("Prediction", f"{prediction:,.0f} MW" if prediction is not None else "–")
252
- st.metric("Actual", f"{actual:,.0f} MW" if actual is not None else "–")
253
- #st.caption("Simulation Progress")
254
- #st.progress(progress)
255
-
256
- if len(st.session_state.true_vals) > 1:
257
- true_arr = np.array(st.session_state.true_vals)
258
- pred_arr = np.array(st.session_state.pred_vals[:-1])
259
-
260
- min_len = min(len(true_arr), len(pred_arr)) #just start if there are 2 actual values
261
- if min_len >= 1:
262
- errors = np.abs(true_arr[:min_len] - pred_arr[:min_len])
263
- mape = np.mean(errors / np.where(true_arr[:min_len] == 0, 1e-10, true_arr[:min_len])) * 100
264
- mae = np.mean(errors)
265
- max_error = np.max(errors)
266
-
267
- st.divider()
268
- st.markdown(
269
- f"<span style='font-size: 24px; font-weight: 600; color: {HEADER_COLOR} !important;'>Interim Metrics</span>",
270
- unsafe_allow_html=True
271
- )
272
- st.metric("MAPE (so far)", f"{mape:.2f} %")
273
- st.metric("MAE (so far)", f"{mae:,.0f} MW")
274
- st.metric("Max Error", f"{max_error:,.0f} MW")
275
 
276
 
277
 
 
241
  unsafe_allow_html=True
242
  )
243
 
244
+ #with info_container.container():
245
+ # st.markdown("<div style='margin-top: 5rem;'></div>", unsafe_allow_html=True)
246
+ # st.markdown(
247
+ # f"<span style='font-size: 24px; font-weight: 600; color: {HEADER_COLOR} !important;'>Time: {timestamp}</span>",
248
+ # unsafe_allow_html=True
249
+ # )
250
+ #
251
+ # st.metric("Prediction", f"{prediction:,.0f} MW" if prediction is not None else "–")
252
+ # st.metric("Actual", f"{actual:,.0f} MW" if actual is not None else "–")
253
+ # #st.caption("Simulation Progress")
254
+ # #st.progress(progress)
255
+ #
256
+ # if len(st.session_state.true_vals) > 1:
257
+ # true_arr = np.array(st.session_state.true_vals)
258
+ # pred_arr = np.array(st.session_state.pred_vals[:-1])
259
+ #
260
+ # min_len = min(len(true_arr), len(pred_arr)) #just start if there are 2 actual values
261
+ # if min_len >= 1:
262
+ # errors = np.abs(true_arr[:min_len] - pred_arr[:min_len])
263
+ # mape = np.mean(errors / np.where(true_arr[:min_len] == 0, 1e-10, true_arr[:min_len])) * 100
264
+ # mae = np.mean(errors)
265
+ # max_error = np.max(errors)
266
+ #
267
+ # st.divider()
268
+ # st.markdown(
269
+ # f"<span style='font-size: 24px; font-weight: 600; color: {HEADER_COLOR} !important;'>Interim Metrics</span>",
270
+ # unsafe_allow_html=True
271
+ # )
272
+ # st.metric("MAPE (so far)", f"{mape:.2f} %")
273
+ # st.metric("MAE (so far)", f"{mae:,.0f} MW")
274
+ # st.metric("Max Error", f"{max_error:,.0f} MW")
275
 
276
 
277