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

corrections

parent b8476f79
No related branches found
No related tags found
No related merge requests found
......@@ -11,21 +11,21 @@ def intersect(l1, l2):
def check(file):
return os.path.isfile(file)
def report(*args):
signal_preprocess = {'Snv':'Standard Normal Variate (SNV) \cite{barnes1989standard}',
'SG': 'Savitzky-Golay (SG) \cite{savitzky1964smoothing}'}
dim_red_methods= {'PCA':'Principal Components Analysis (PCA) \cite{wold1987principal,ringner2008principal,greenacre2022principal,JMLR:v12:pedregosa11a}',
'UMAP':'Uniform Manifold Approximation and Projection (UMAP) \cite{ghojogh2021uniform,JMLR:v12:pedregosa11a}',
'NMF':'Non-negative Matrix Factorization (NMF) \cite{lopes2015non}'} # List of dimensionality reduction algos
cluster_methods = {'Kmeans':'Kmeans \cite{chong2021k,JMLR:v12:pedregosa11a}',
'HDBSCAN':'Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN) \cite{mcinnes2017hdbscan}',
'AP':'Affinity Propagation (AP) \cite{dueck2009affinity,JMLR:v12:pedregosa11a}',
'KS':'Kennard-Stone algorithm (KS)',
'RDM': 'random approach'} # List of clustering algos
signal_preprocess = {'Snv':r'''Standard Normal Variate (SNV) \cite{barnes1989standard}''',
'SG': r'''Savitzky-Golay (SG) \cite{savitzky1964smoothing}'''}
dim_red_methods= {'PCA':r'''Principal Components Analysis (PCA) \cite{wold1987principal,ringner2008principal,greenacre2022principal,JMLR:v12:pedregosa11a}''',
'UMAP':r'''Uniform Manifold Approximation and Projection (UMAP) \cite{ghojogh2021uniform,JMLR:v12:pedregosa11a}''',
'NMF':r'''Non-negative Matrix Factorization (NMF) \cite{lopes2015non}'''} # List of dimensionality reduction algos
cluster_methods = {'Kmeans':r'''Kmeans \cite{chong2021k,JMLR:v12:pedregosa11a}''',
'HDBSCAN':r'''Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN) \cite{mcinnes2017hdbscan}''',
'AP':r'''Affinity Propagation (AP) \cite{dueck2009affinity,JMLR:v12:pedregosa11a}''',
'KS':r'''Kennard-Stone algorithm (KS)''',
'RDM': r'''random approach'''} # List of clustering algos
selec_strategy = {'center':'PCA','random':'PCA'}
reg_algo ={"PLS":'Partial Least Squares (PLS) \cite{Wold2001,JMLR:v12:pedregosa11a}',
"LW-PLS": 'Locally Weighted-Partial Least Squares (LW-PLS) \cite{Lesnoff2020}',
"TPE-iPLS": "Tree-structured Parzen estimator-interval Partial Least Squares (TPE-iPLS)"}
reg_algo ={"PLS":r'''Partial Least Squares (PLS) \cite{Wold2001,JMLR:v12:pedregosa11a}''',
"LW-PLS": r'''Locally Weighted-Partial Least Squares (LW-PLS) \cite{Lesnoff2020}''',
"TPE-iPLS": r'''Tree-structured Parzen estimator-interval Partial Least Squares (TPE-iPLS)'''}
to_report=[]
j=0
......@@ -176,19 +176,19 @@ def report(*args):
large residual distance to the subspace, but whose projection is on the subspace; and, finally, bad leverage
points, which have a large residual distance such that the projection on the subspace is away from regular observations.\par"""
latex_report += """ Results of applying this workflow are displayed in"""
latex_report += r""" Results of applying this workflow are displayed in"""
if 'PCA' in to_report:
latex_report += """ (\cref{pcaplots, hotelling_and_influence, loadings})."""
latex_report += r""" (\cref{pcaplots, hotelling_and_influence, loadings})."""
elif 'NMF' in to_report:
latex_report += """ (\cref{pcaplots, loadings})."""
latex_report += r""" (\cref{pcaplots, loadings})."""
else:
latex_report += """ (\cref{pcaplots})."""
latex_report += r""" (\cref{pcaplots})."""
if 'KS' in to_report or 'RDM' in to_report:
latex_report += """ Based of the features extracted using {"""+to_report[2]+ r"""}, """
latex_report += r""" Based of the features extracted using {"""+to_report[2]+ r"""}, """
else:
latex_report += """ Based of the features extracted using {"""+to_report[2]+ r"""},
latex_report += r""" Based of the features extracted using {"""+to_report[2]+ r"""},
{"""+to_report[3]+ r"""} revealed the existance of {"""+to_report[5] + r"""} data clusters, visualized with different colors, from which """
latex_report += r"""a subset of {"""+to_report[8]+ r"""} samples was selected"""
......
......@@ -414,6 +414,7 @@ if not t.empty:
st.write('Scores plot')
tcr_plot = tcr.copy()
colfilter = st.selectbox('Color by:', options= filter,format_func = lambda x: x if x else "<Select>")
p_hash(colfilter)
if colfilter in cluster_methods:
tcr_plot[colfilter] = labels
elif not meta_data.empty and colfilter in md_df_st_.columns.tolist():
......
......@@ -158,8 +158,8 @@ try:
with M4:
@st.cache_data
def prep_info(change):
SG = f'- Savitzky-Golay derivative parameters \:(Window_length:{prep['window_length']}; polynomial order: {prep['polyorder']}; Derivative order : {prep['deriv']})'
Norm = f'- Spectral Normalization \: {norm}'
SG = r'''- Savitzky-Golay derivative parameters \:(Window_length:{prep['window_length']}; polynomial order: {prep['polyorder']}; Derivative order : {prep['deriv']})'''
Norm = r'''- Spectral Normalization \: {norm}'''
return SG, Norm
SG, Norm = prep_info(change = hash_)
st.info('The spectra were preprocessed using:\n'+SG+"\n"+Norm)
......
......@@ -69,30 +69,31 @@ with st.container():
}
submitted = st.form_submit_button(label='Save')
if submitted:
if '' not in form_data.values():
# Save the form data here
st.session_state['form_submitted'] = True
st.success('Form was saved successfully!', icon="")
# Enregistrement des données dans un fichier JSON
with open('form_data.json', 'w') as json_file:
json.dump(form_data, json_file)
with st.container():
if st.session_state['interface'] == 'simple':
header3, header4 = st.columns(2)
if header3.button("Samples Selection"):
st.switch_page(pages_folder / '1-samples_selection.py')
if header4.button("Model Creation"):
st.switch_page(pages_folder / '2-model_creation.py')
elif st.session_state['interface'] == 'advanced':
header3, header4, header5 = st.columns(3)
if header3.button("Samples Selection"):
st.switch_page(pages_folder / '1-samples_selection.py')
if header4.button("Model Creation"):
st.switch_page(pages_folder / '2-model_creation.py')
if header5.button("Prediction"):
st.switch_page(pages_folder / '3-prediction.py')
else:
st.error('Error: The form was not saved, please ensure the required fields are filled!')
\ No newline at end of file
if submitted:
if '' not in form_data.values():
# Save the form data here
st.session_state['form_submitted'] = True
st.success('Form was saved successfully!', icon="")
# Enregistrement des données dans un fichier JSON
with open('form_data.json', 'w') as json_file:
json.dump(form_data, json_file)
if st.session_state['interface'] == 'simple':
header3, header4 = st.columns(2)
if header3.button("Samples Selection"):
st.switch_page(pages_folder / '1-samples_selection.py')
if header4.button("Model Creation"):
st.switch_page(pages_folder / '2-model_creation.py')
elif st.session_state['interface'] == 'advanced':
header3, header4, header5 = st.columns(3)
if header3.button("Samples Selection"):
st.switch_page(pages_folder / '1-samples_selection.py')
if header4.button("Model Creation"):
st.switch_page(pages_folder / '2-model_creation.py')
if header5.button("Prediction"):
st.switch_page(pages_folder / '3-prediction.py')
else:
st.error('Error: The form was not saved, please ensure the required fields are filled!')
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