Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LC-MS-RT-prediction
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Léo Schneider
LC-MS-RT-prediction
Commits
213903bc
Commit
213903bc
authored
11 months ago
by
Léo Schneider
Committed by
Schneider Leo
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
res_viz
parent
db13a34d
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
res_viz.py
+76
-0
76 additions, 0 deletions
res_viz.py
with
76 additions
and
0 deletions
res_viz.py
0 → 100644
+
76
−
0
View file @
213903bc
import
random
import
matplotlib
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
dlomix.data
import
RetentionTimeDataset
epoch
=
100
number
=
8
BATCH_SIZE
=
64
test_rtdata
=
RetentionTimeDataset
(
data_source
=
'
database/data_holdout.csv
'
,
seq_length
=
30
,
batch_size
=
BATCH_SIZE
,
test
=
True
)
target
=
test_rtdata
.
get_split_targets
(
split
=
"
test
"
)
index
=
random
.
sample
(
range
(
target
.
size
),
number
)
target_plot
=
target
[
index
]
pred_1
=
[]
pred_2
=
[]
error_1
=
[]
error_2
=
[]
order_1
=
[]
order_2
=
[]
pred_plot_1
=
[]
pred_plot_2
=
[]
error_plot_1
=
[]
error_plot_2
=
[]
order_plot_1
=
[]
order_plot_2
=
[]
for
i
in
range
(
epoch
):
data_1
=
np
.
load
(
'
results/pred_prosit_ori/mem_pred_
'
+
str
(
i
)
+
'
.npy
'
)
data_1_plot
=
data_1
[
index
]
data_2
=
np
.
load
(
'
results/pred_prosit_ori_2/mem_pred_
'
+
str
(
i
)
+
'
.npy
'
)
data_2_plot
=
data_2
[
index
]
pred_1
.
append
(
data_1
)
pred_2
.
append
(
data_2
)
error_1
.
append
(
data_1
-
target
)
error_2
.
append
(
data_2
-
target
)
order_1
.
append
(
np
.
argsort
(
data_1
-
target
))
order_2
.
append
(
np
.
argsort
(
data_2
-
target
))
pred_plot_1
.
append
(
data_1_plot
)
pred_plot_2
.
append
(
data_2_plot
)
error_plot_1
.
append
(
data_1_plot
-
target_plot
)
error_plot_2
.
append
(
data_2_plot
-
target_plot
)
order_plot_1
.
append
(
np
.
argsort
(
data_1_plot
-
target_plot
))
order_plot_2
.
append
(
np
.
argsort
(
data_2_plot
-
target_plot
))
pred_1
=
np
.
array
(
pred_1
)
pred_2
=
np
.
array
(
pred_2
)
error_1
=
np
.
array
(
error_1
)
error_2
=
np
.
array
(
error_2
)
order_1
=
np
.
array
(
order_1
)
order_2
=
np
.
array
(
order_2
)
pred_plot_1
=
np
.
array
(
pred_plot_1
)
pred_plot_2
=
np
.
array
(
pred_plot_2
)
error_plot_1
=
np
.
array
(
error_plot_1
)
error_plot_2
=
np
.
array
(
error_plot_2
)
order_plot_1
=
np
.
array
(
order_plot_1
)
order_plot_2
=
np
.
array
(
order_plot_2
)
def
viz_error_1
():
for
i
in
range
(
number
):
plt
.
plot
(
error_plot_1
[:,
i
])
plt
.
show
()
def
viz_error_2
():
for
i
in
range
(
number
):
plt
.
plot
(
error_plot_2
[:,
i
])
plt
.
show
()
def
compare_error
():
colors
=
list
(
matplotlib
.
colors
.
TABLEAU_COLORS
)
for
i
in
range
(
number
):
plt
.
plot
(
error_plot_1
[:,
i
],
c
=
colors
[
i
],
ls
=
'
dashed
'
)
plt
.
plot
(
error_plot_2
[:,
i
],
c
=
colors
[
i
])
plt
.
show
()
\ No newline at end of file
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