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
02cd06cc
Commit
02cd06cc
authored
10 months ago
by
DIANE
Browse files
Options
Downloads
Patches
Plain Diff
Predictions page enhancement
parent
9356d02a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/data/params/Preprocessing.json
+1
-0
1 addition, 0 deletions
src/data/params/Preprocessing.json
src/pages/2-model_creation.py
+6
-7
6 additions, 7 deletions
src/pages/2-model_creation.py
with
7 additions
and
7 deletions
src/data/params/Preprocessing.json
0 → 100644
+
1
−
0
View file @
02cd06cc
{
"Scatter"
:
"Non"
,
"Saitzky-Golay derivative parameters"
:
{
"polyorder"
:
0
,
"deriv"
:
0
,
"window_length"
:
23
}}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/pages/2-model_creation.py
+
6
−
7
View file @
02cd06cc
...
@@ -94,7 +94,7 @@ elif file == files_format[1]:
...
@@ -94,7 +94,7 @@ elif file == files_format[1]:
with
NamedTemporaryFile
(
delete
=
False
,
suffix
=
"
.dx
"
)
as
tmp
:
with
NamedTemporaryFile
(
delete
=
False
,
suffix
=
"
.dx
"
)
as
tmp
:
tmp
.
write
(
data_file
.
read
())
tmp
.
write
(
data_file
.
read
())
tmp_path
=
tmp
.
name
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
=
"
✅
"
)
M3
.
success
(
"
The data have been loaded successfully
"
,
icon
=
"
✅
"
)
if
chem_data
.
shape
[
1
]
>
0
:
if
chem_data
.
shape
[
1
]
>
0
:
yname
=
M3
.
selectbox
(
'
Select target
'
,
options
=
chem_data
.
columns
)
yname
=
M3
.
selectbox
(
'
Select target
'
,
options
=
chem_data
.
columns
)
...
@@ -196,8 +196,11 @@ if not spectra.empty and not y.empty:
...
@@ -196,8 +196,11 @@ if not spectra.empty and not y.empty:
yt
=
Reg
.
pred_data_
[
2
]
yt
=
Reg
.
pred_data_
[
2
]
#if
#if
#M2.write('-- Spectral preprocessing info --')
M2
.
write
(
'
-- Spectral preprocessing info --
'
)
#M2.write(Reg.best_hyperparams)
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
.
write
(
"
-- Performance metrics --
"
)
M2
.
dataframe
(
Reg
.
metrics_
)
M2
.
dataframe
(
Reg
.
metrics_
)
#from st_circular_progress import CircularProgress
#from st_circular_progress import CircularProgress
...
@@ -207,10 +210,6 @@ if not spectra.empty and not y.empty:
...
@@ -207,10 +210,6 @@ if not spectra.empty and not y.empty:
#my_circular_progress.st_circular_progress()
#my_circular_progress.st_circular_progress()
#my_circular_progress.update_value(progress=20)
#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
))
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
))
M8
.
pyplot
(
resid_plot
([
y_train
,
y_train
,
y_test
],[
yc
,
ycv
,
yt
],
train_idx
=
train_index
,
test_idx
=
test_index
))
...
...
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