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

sort

parent 88cc77a9
No related branches found
No related tags found
No related merge requests found
...@@ -260,8 +260,8 @@ if not x_block.empty and not y.empty: ...@@ -260,8 +260,8 @@ if not x_block.empty and not y.empty:
with c3: with c3:
st.write('Loaded data summary') st.write('Loaded data summary')
stats = DataFrame([desc_stats(y_train), desc_stats(y_test), desc_stats(y)], index=[ stats = DataFrame([desc_stats(y) ,desc_stats(y_train), desc_stats(y_test)], index=[f'{yname} (Total)',
f'{yname} (Cal)', f'{yname} (Val)', f'{yname} (Total)']).round(2) f'{yname} (Cal)', f'{yname} (Val)']).round(2)
st.write(stats) st.write(stats)
# histogramms # histogramms
target_plot = hist(y=y, y_train=y_train, target_plot = hist(y=y, y_train=y_train,
...@@ -360,7 +360,7 @@ if not x_block.empty and not y.empty: ...@@ -360,7 +360,7 @@ if not x_block.empty and not y.empty:
case 'PLS': case 'PLS':
from utils.regress import Plsr from utils.regress import Plsr
Model = Plsr(train=[X_train, y_train], test=[ Model = Plsr(train=[X_train, y_train], test=[
X_test, y_test], n_iter=10, cv=nb_folds) X_test, y_test], n_iter=100, cv=nb_folds)
case 'TPE-iPLS': case 'TPE-iPLS':
from utils.regress import TpeIpls from utils.regress import TpeIpls
...@@ -487,7 +487,6 @@ if not x_block.empty and not y.empty: ...@@ -487,7 +487,6 @@ if not x_block.empty and not y.empty:
with c8: with c8:
iternum = st.number_input(label='No.iterations', min_value=2, iternum = st.number_input(label='No.iterations', min_value=2,
max_value=500, value=10 if model_type == 'TPE-iPLS' else None, disabled=False if model_type == 'TPE-iPLS' else True) max_value=500, value=10 if model_type == 'TPE-iPLS' else None, disabled=False if model_type == 'TPE-iPLS' else True)
remodel_button = st.button('re-model the data', type="primary", use_container_width=True, remodel_button = st.button('re-model the data', type="primary", use_container_width=True,
disabled=False if model_type else True, disabled=False if model_type else True,
on_click=lambda: st_var(variable='counter', initialize=False, update=True)) on_click=lambda: st_var(variable='counter', initialize=False, update=True))
...@@ -543,7 +542,7 @@ if model_type: ...@@ -543,7 +542,7 @@ if model_type:
fig, (ax1, ax2, ax3) = plt.subplots( fig, (ax1, ax2, ax3) = plt.subplots(
3, 1, figsize=(12, 4), sharex=True) 3, 1, figsize=(12, 4), sharex=True)
from utils.varimportance import vip from utils.varimportance import vip
vips = vip(X_train, y_train, model) vips = vip(modelling.pretreated_spectra_, y_train, model)
vips = DataFrame(vips, columns=['vips']) vips = DataFrame(vips, columns=['vips'])
vips.index = X_train.columns vips.index = X_train.columns
vips.plot(ax=ax3) vips.plot(ax=ax3)
......
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