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
b07d5391
Commit
b07d5391
authored
3 months ago
by
DIANE
Browse files
Options
Downloads
Patches
Plain Diff
sort
parent
88cc77a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pages/2-model_creation.py
+4
-5
4 additions, 5 deletions
src/pages/2-model_creation.py
with
4 additions
and
5 deletions
src/pages/2-model_creation.py
+
4
−
5
View file @
b07d5391
...
@@ -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
=
10
0
,
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_
tra
in
,
y_train
,
model
)
vips
=
vip
(
modelling
.
pretreated_spec
tra
_
,
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
)
...
...
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