diff --git a/src/data/params/Preprocessing.json b/src/data/params/Preprocessing.json new file mode 100644 index 0000000000000000000000000000000000000000..821db7c9c527189fe8a3a6dee1f63a20957e807e --- /dev/null +++ b/src/data/params/Preprocessing.json @@ -0,0 +1 @@ +{"Scatter": "Non", "Saitzky-Golay derivative parameters": {"polyorder": 0, "deriv": 0, "window_length": 23}} \ No newline at end of file diff --git a/src/pages/2-model_creation.py b/src/pages/2-model_creation.py index 2556511d54dbe58dbbe768ea857a347182c62cfa..ddb2289854d98022b525a47cc20524c36d779c2d 100644 --- a/src/pages/2-model_creation.py +++ b/src/pages/2-model_creation.py @@ -94,7 +94,7 @@ elif file == files_format[1]: with NamedTemporaryFile(delete=False, suffix=".dx") as tmp: tmp.write(data_file.read()) tmp_path = tmp.name - chem_data, spectra, meta_data = read_dx(file = tmp_path) + chem_data, spectra, meta_data, meta_data_st = read_dx(file = tmp_path) M3.success("The data have been loaded successfully", icon="✅") if chem_data.shape[1]>0: yname = M3.selectbox('Select target', options=chem_data.columns) @@ -196,8 +196,11 @@ if not spectra.empty and not y.empty: yt = Reg.pred_data_[2] #if - #M2.write('-- Spectral preprocessing info --') - #M2.write(Reg.best_hyperparams) + M2.write('-- Spectral preprocessing info --') + M2.write(Reg.best_hyperparams) + with open("data/params/Preprocessing.json", "w") as outfile: + json.dump(Reg.best_hyperparams, outfile) + M2.write("-- Performance metrics --") M2.dataframe(Reg.metrics_) #from st_circular_progress import CircularProgress @@ -207,10 +210,6 @@ if not spectra.empty and not y.empty: #my_circular_progress.st_circular_progress() #my_circular_progress.update_value(progress=20) - - - - M7.pyplot(reg_plot([y_train, y_train, y_test],[yc, ycv, yt], train_idx = train_index, test_idx = test_index)) M8.pyplot(resid_plot([y_train, y_train, y_test],[yc, ycv, yt], train_idx = train_index, test_idx = test_index))