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
c6b78987
Commit
c6b78987
authored
1 year ago
by
Léo Schneider
Committed by
Schneider Leo
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fpdf_local
parent
c6409513
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
prosit_RT_ori.py
+0
-47
0 additions, 47 deletions
prosit_RT_ori.py
requirements.txt
+3
-2
3 additions, 2 deletions
requirements.txt
with
4 additions
and
49 deletions
.gitignore
+
1
−
0
View file @
c6b78987
...
@@ -5,3 +5,4 @@
...
@@ -5,3 +5,4 @@
/test.py
/test.py
/database/
/database/
/wandb_run/
This diff is collapsed.
Click to expand it.
prosit_RT_ori.py
deleted
100644 → 0
+
0
−
47
View file @
c6409513
import
os
import
numpy
as
np
import
pandas
as
pd
from
dlomix
import
constants
,
data
,
eval
,
layers
,
models
,
pipelines
,
reports
,
utils
from
dlomix.models
import
RetentionTimePredictor
from
dlomix.data
import
RetentionTimeDataset
from
dlomix.eval
import
TimeDeltaMetric
from
dlomix.reports
import
RetentionTimeReport
batch_size
=
1024
TRAIN_DATAPATH
=
'
/database/data.csv
'
data
=
pd
.
read_csv
(
'
/database/data.csv
'
)
data_train
=
data
[
data
.
state
==
'
train
'
or
data
.
state
==
'
validation
'
]
data_holdout
=
data
[
data
.
state
==
'
holdout
'
]
data_train
.
to_csv
(
'
/database/data_train.csv
'
)
data_holdout
.
to_csv
(
'
/database/data_holdout.csv
'
)
rtdata
=
RetentionTimeDataset
(
data_source
=
'
/database/data_train.csv
'
,
seq_length
=
30
,
batch_size
=
batch_size
,
val_ratio
=
0.2
,
test
=
False
)
model
=
RetentionTimePredictor
(
seq_length
=
30
)
model
.
compile
(
optimizer
=
'
adam
'
,
loss
=
'
mse
'
,
metrics
=
[
'
mean_absolute_error
'
,
TimeDeltaMetric
()])
history
=
model
.
fit
(
rtdata
.
train_data
,
validation_data
=
rtdata
.
val_data
,
epochs
=
20
)
test_rtdata
=
RetentionTimeDataset
(
data_source
=
'
/database/data_holdout.csv
'
,
seq_length
=
30
,
batch_size
=
1024
,
test
=
True
)
predictions
=
model
.
predict
(
test_rtdata
.
test_data
)
# we use ravel from numpy to flatten the array (since it comes out as an array of arrays)
predictions
=
predictions
.
ravel
()
test_targets
=
test_rtdata
.
get_split_targets
(
split
=
"
test
"
)
report
=
RetentionTimeReport
(
output_path
=
"
./output
"
,
history
=
history
)
report
.
calculate_r2
(
test_targets
,
predictions
)
report
.
generate_report
(
test_targets
,
predictions
)
This diff is collapsed.
Click to expand it.
requirements.txt
+
3
−
2
View file @
c6b78987
torch
~=2.1.2
torch
~=2.1.2
h5py
~=3.10.0
h5py
~=3.10.0
pandas
~=2.
1.4
pandas
~=2.
2.0
numpy
~=1.26.2
numpy
~=1.26.2
matplotlib
~=3.8.2
matplotlib
~=3.8.2
\ No newline at end of file
wandb
~=0.16.2
\ 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