Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NIRS_Workflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CEFE
PACE
NIRS_Workflow
Commits
8286fc28
Commit
8286fc28
authored
9 months ago
by
DIANE
Browse files
Options
Downloads
Patches
Plain Diff
borders modif
parent
432ac6f5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pages/1-samples_selection.py
+8
-9
8 additions, 9 deletions
src/pages/1-samples_selection.py
src/pages/3-prediction.py
+1
-0
1 addition, 0 deletions
src/pages/3-prediction.py
with
9 additions
and
9 deletions
src/pages/1-samples_selection.py
+
8
−
9
View file @
8286fc28
...
...
@@ -12,15 +12,16 @@ from Modules import *
# st.markdown(bandeau_html, unsafe_allow_html=True)
add_header
()
local_css
(
css_file
/
"
style_model.css
"
)
st
.
session_state
[
"
interface
"
]
=
st
.
session_state
.
get
(
'
interface
'
)
if
st
.
session_state
[
"
interface
"
]
==
'
simple
'
:
hide_pages
(
"
Predictions
"
)
################################### I - Data Loading and Visualization ########################################
st
.
header
(
"
I - Spectral Data Visualization
"
,
divider
=
'
blue
'
)
col2
,
col1
=
st
.
columns
([
3
,
1
])
col1
.
header
(
"
Data Loading
"
,
divider
=
'
blue
'
)
col2
.
header
(
"
Spectral Data Visualization
"
,
divider
=
'
blue
'
)
## Preallocation of data structure
...
...
@@ -90,12 +91,10 @@ if not spectra.empty:
############################## Exploratory data analysis ###############################
container2
=
st
.
container
(
border
=
True
)
container2
.
header
(
"
Exploratory Data Analysis-Multivariable Data Analysis
"
,
divider
=
'
blue
'
)
st
.
header
(
"
II - Exploratory Data Analysis-Multivariable Data Analysis
"
,
divider
=
'
blue
'
)
scores
,
loadings
,
pc
=
st
.
columns
([
2
,
3
,
0.5
])
influence
,
hotelling
,
qexp
=
st
.
columns
([
2
,
2
,
1
])
st
.
header
(
'
Selected samples for chemical analysis
'
,
divider
=
'
blue
'
)
selected_s
,
selected_samples_metd
=
st
.
columns
([
3
,
3
])
st
.
header
(
'
III - Selected samples for chemical analysis
'
,
divider
=
'
blue
'
)
dim_red_methods
=
[
''
,
'
PCA
'
,
'
UMAP
'
,
'
NMF
'
]
# List of dimensionality reduction algos
cluster_methods
=
[
''
,
'
Kmeans
'
,
'
HDBSCAN
'
,
'
AP
'
]
# List of clustering algos
...
...
@@ -221,9 +220,9 @@ if labels:
sam1
.
insert
(
loc
=
0
,
column
=
'
index
'
,
value
=
selected_samples_idx
)
sam1
.
insert
(
loc
=
1
,
column
=
'
cluster
'
,
value
=
np
.
array
(
labels
)[
selected_samples_idx
])
sam1
.
index
=
np
.
arange
(
len
(
selected_samples_idx
))
+
1
s
elected_s
.
write
(
f
'
- The total number of samples:
{
tcr
.
shape
[
0
]
}
.
\n
- The number of selected samples for chemical analysis:
{
sam1
.
shape
[
0
]
}
.
'
)
s
t
.
write
(
f
'
- The total number of samples:
{
tcr
.
shape
[
0
]
}
.
\n
- The number of selected samples for chemical analysis:
{
sam1
.
shape
[
0
]
}
.
'
)
sam
=
sam1
unclus
=
s
elected_s
.
checkbox
(
"
Include non clustered samples (for HDBSCAN clustering)
"
,
value
=
True
)
unclus
=
s
t
.
checkbox
(
"
Include non clustered samples (for HDBSCAN clustering)
"
,
value
=
True
)
if
clus_method
==
cluster_methods
[
2
]:
if
selected_samples_idx
:
...
...
@@ -239,7 +238,7 @@ if labels:
sam
=
pd
.
concat
([
sam1
,
sam2
],
axis
=
0
)
sam
.
index
=
np
.
arange
(
sam
.
shape
[
0
])
+
1
s
elected_s
.
write
(
f
'
The number of Non-clustered samples is
{
sam2
.
shape
[
0
]
}
samples
'
)
s
t
.
write
(
f
'
The number of Non-clustered samples is
{
sam2
.
shape
[
0
]
}
samples
'
)
else
:
sam
=
sam1
st
.
write
(
sam
)
...
...
This diff is collapsed.
Click to expand it.
src/pages/3-prediction.py
+
1
−
0
View file @
8286fc28
...
...
@@ -13,6 +13,7 @@ from Class_Mod.DATA_HANDLING import *
add_header
()
st
.
session_state
[
"
interface
"
]
=
st
.
session_state
.
get
(
'
interface
'
)
local_css
(
css_file
/
"
style_model.css
"
)
st
.
header
(
"
Data loading
"
,
divider
=
'
blue
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment