Skip to content
Snippets Groups Projects
Commit 1cc1a75a authored by Nicolas Barthes's avatar Nicolas Barthes
Browse files

added simple/advanced Interface

parent 19757ac9
No related branches found
No related tags found
No related merge requests found
[theme]
#primaryColor="#E0A505"
#backgroundColor="#b7e4f3"
#secondaryBackgroundColor="#b5f5cb"
#textColor="#0a23bf"
#base="dark"
font="sans serif"
#primaryColor="#E91E63"
#backgroundColor="#FFE082"
#secondaryBackgroundColor="#E6EE9C"
#textColor="#0a23bf"
primaryColor="#EF8354"
backgroundColor="#FFFFFF"
secondaryBackgroundColor="#7E8987"
......
......@@ -43,6 +43,7 @@ from sklearn.metrics import pairwise_distances_argmin_min, adjusted_rand_score,
## Web app construction
import streamlit as st
from st_pages import Page, Section, show_pages, add_page_title, hide_pages
from tempfile import NamedTemporaryFile
# help on streamlit input https://docs.streamlit.io/library/api-reference/widgets
......
#from Modules_manager.PCA_ import pca_maker
from Packages import *
st.set_page_config(page_title="NIRS Utils", page_icon=":goat:", layout="wide")
st.set_page_config(page_title="NIRS Utils", page_icon=":goat:", layout="wide",)
if 'interface' not in st.session_state:
st.session_state['interface'] = 'simple'
from Modules import *
from Class_Mod.DATA_HANDLING import *
# graphical delimiter
# st.write("---")
# load images for web interface
# img_sselect = Image.open("images\sselect.JPG")
# img_general = Image.open("images\general.JPG")
# img_predict = Image.open("images\predict.JPG")
# TOC menu on the left
# with st.sidebar:
# st.markdown("[Sample Selection](#sample-selection)")
# st.markdown("[Model Development](#create-a-model)")
# st.markdown("[Predictions Making](#predict)")
# # TOC menu on the left
show_pages(
[Page("app.py", "Home"),
Page("pages\\1-samples_selection.py", "Samples Selection"),
Page("pages\\2-model_creation.py", "Models Creation"),
Page("pages\\3-prediction.py", "Predictions"),
]
)
hide_pages("Samples Selection")
hide_pages("Models Creation")
hide_pages("Predictions")
with st.sidebar:
interface = st.selectbox(label="Interface", options=['simple', 'advanced'], key='interface')
st.page_link('pages\\1-samples_selection.py')
if st.session_state['interface'] == 'simple':
st.page_link('pages\\2-model_creation.py')
# if advanced interface, split Models Creation and Predictions
elif st.session_state['interface'] == 'advanced':
show_pages(
[Page("app.py", "Home"),
Page("pages\\1-samples_selection.py", "Samples Selection"),
Page("pages\\2-model_creation.py", "Models Creation"),
Page("pages\\3-prediction.py", "Predictions"),
]
)
st.page_link('pages\\2-model_creation.py')
st.page_link('pages\\3-prediction.py')
# Page header
with st.container():
......
......@@ -3,6 +3,10 @@ st.set_page_config(page_title="NIRS Utils", page_icon=":goat:", layout="wide")
from Modules import *
from Class_Mod.DATA_HANDLING import *
st.session_state["interface"] = st.session_state.get('interface')
if st.session_state["interface"] == 'simple':
hide_pages("Predictions")
################################### Data Loading and Visualization ########################################
container1 = st.container(border=True)
col2, col1 = st.columns([3, 1])
......@@ -90,7 +94,7 @@ cluster_methods = ['', 'Kmeans','HDBSCAN', 'AP']
with container2:
if sselectx_csv is not None:
plot_type=['', 'PCA','UMAP', 'NMF']
cluster_methods = ['', 'Kmeans','UMAP', 'AP']
cluster_methods = ['', 'Kmeans','HDBSCAN', 'AP']
with pc:
type_plot = st.selectbox("Dimensionality reduction techniques: ", options=plot_type, key=37)
......
......@@ -3,7 +3,9 @@ st.set_page_config(page_title="NIRS Utils", page_icon=":goat:", layout="wide")
from Modules import *
from Class_Mod.DATA_HANDLING import *
st.session_state["interface"] = st.session_state.get('interface')
if st.session_state["interface"] == 'simple':
hide_pages("Predictions")
def nn(x):
return x is not None
########################################################################################
......@@ -107,4 +109,8 @@ if xcal_csv is not None and ycal_csv is not None:
# create a report with information on the model
## see https://stackoverflow.com/a/59578663
#M4.pyplot(reg_plot(meas==(ycal_csv,ycal_csv,ycal_csv], pred=[ycal_csv,ycal_csv,ycal_csv]))
\ No newline at end of file
#M4.pyplot(reg_plot(meas==(ycal_csv,ycal_csv,ycal_csv], pred=[ycal_csv,ycal_csv,ycal_csv]))
if st.session_state['interface'] == 'simple':
st.page_link('pages\\3-prediction.py', label = 'Keep on keepin\' on to predict your values !')
......@@ -3,6 +3,7 @@ st.set_page_config(page_title="NIRS Utils", page_icon=":goat:", layout="wide")
from Modules import *
from Class_Mod.DATA_HANDLING import *
st.session_state["interface"] = st.session_state.get('interface')
st.header("Predictions making", divider='blue')
......
streamlit>=1.3.0
st_pages-0.4.5>=0.4.5
requests>=2.24.0
Pillow>=8.4.0
protobuf>=3.19.0
......
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