Skip to content
Snippets Groups Projects
Commit fd8ae76b authored by DIANE's avatar DIANE
Browse files

Download report, app performance enhancements

parent 1315963c
No related branches found
No related tags found
No related merge requests found
...@@ -516,7 +516,7 @@ if Reg: ...@@ -516,7 +516,7 @@ if Reg:
numbers_dict = {1: "One", 2: "Two",3: "Three",4: "Four",5: "Five", numbers_dict = {1: "One", 2: "Two",3: "Three",4: "Four",5: "Five",
6: "Six",7: "Seven",8: "Eight",9: "Nine",10: "Ten"} 6: "Six",7: "Seven",8: "Eight",9: "Nine",10: "Ten"}
st.header(f" {numbers_dict[nb_folds]}-Fold Cross-Validation results") st.header(f" {numbers_dict[nb_folds]}-Fold Cross-Validation results")
@st.cache_data(show_spinner =False) @st.cache_data(show_spinner =False)
def cv_display(change): def cv_display(change):
fig1 = px.scatter(Reg.cv_data_[0], x = 'Measured', y = 'Predicted' , trendline = 'ols', color = 'Folds', symbol = 'Folds', fig1 = px.scatter(Reg.cv_data_[0], x = 'Measured', y = 'Predicted' , trendline = 'ols', color = 'Folds', symbol = 'Folds',
...@@ -530,7 +530,7 @@ if Reg: ...@@ -530,7 +530,7 @@ if Reg:
fig0.update_traces(marker_size = 8, showlegend = False) fig0.update_traces(marker_size = 8, showlegend = False)
return fig0, fig1 return fig0, fig1
fig0, fig1 = cv_display(change= Reg.cv_data_) fig0, fig1 = cv_display(change= Reg.cv_data_)
cv1, cv2 = st.columns([2, 2]) cv1, cv2 = st.columns([2, 2])
with cv2: with cv2:
cv_results = pd.DataFrame(Reg.CV_results_).round(4)# CV table cv_results = pd.DataFrame(Reg.CV_results_).round(4)# CV table
...@@ -545,12 +545,11 @@ if Reg: ...@@ -545,12 +545,11 @@ if Reg:
st.plotly_chart(fig0, use_container_width=True) st.plotly_chart(fig0, use_container_width=True)
################################################### BEGIN : Model Diagnosis #################################################### ################################################### BEGIN : Model Diagnosis ####################################################
st.header("III - Model Diagnosis", divider='blue') st.header("III - Model Diagnosis", divider='blue')
if Reg: if Reg:
# signal preprocessing results preparation for latex report # signal preprocessing results preparation for latex report
prep_para = Reg.best_hyperparams_ prep_para = Reg.best_hyperparams_.copy()
if model_type != reg_algo[2]: if model_type != reg_algo[2]:
prep_para.pop('n_components') prep_para.pop('n_components')
for i in ['deriv','polyorder']: for i in ['deriv','polyorder']:
...@@ -560,7 +559,7 @@ if Reg: ...@@ -560,7 +559,7 @@ if Reg:
prep_para[i] = '1st' prep_para[i] = '1st'
elif Reg.best_hyperparams_[i] > 1: elif Reg.best_hyperparams_[i] > 1:
prep_para[i] = f"{Reg.best_hyperparams_[i]}nd" prep_para[i] = f"{Reg.best_hyperparams_[i]}nd"
# reg plot and residuals plot # reg plot and residuals plot
if model_type != reg_algo[2]: if model_type != reg_algo[2]:
measured_vs_predicted = reg_plot([y_train, y_test],[yc, yt], train_idx = train_index, test_idx = test_index) measured_vs_predicted = reg_plot([y_train, y_test],[yc, yt], train_idx = train_index, test_idx = test_index)
...@@ -581,7 +580,6 @@ if Reg: ...@@ -581,7 +580,6 @@ if Reg:
# residual_plot.savefig('./Report/figures/residuals_plot.png') # residual_plot.savefig('./Report/figures/residuals_plot.png')
################################################### END : Model Diagnosis ####################################################### ################################################### END : Model Diagnosis #######################################################
################################################### BEGIN : Download results ####################################################### ################################################### BEGIN : Download results #######################################################
########################################################################################################################################## ##########################################################################################################################################
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment