Comments (4)
I also wanted to put inherit_param_estimates()
and initial_estimates()
on this list. I think this should be as simple as adding an S3 dispatch that just dispatches through to bbi_nonmem_model
, but I haven't looked into too deeply.
from bbr.
Whenever we come back to this, I also wanted to throw out the idea of just keeping bbi_nonmem_model
as a parent class to bbi_nmboot_model
. To be clear, currently we have this:
class(boot_run)
[1] "bbi_nmboot_model" "bbi_base_model" "bbi_model" "list"
I'm proposing this:
class(boot_run)
[1] "bbi_nmboot_model" "bbi_nonmem_model" "bbi_base_model" "bbi_model" "list"
We would need to think through the repercussions of this more, but naively I think it might be an easy and elegant solution for some number of the functions mentioned in this issue. For example, open the fold below to see my quick testing from hacking the class manually.
manually adding bbi_nonmem_model class
Currently fails (as of 1.10.0.8003
)
> class(boot_run)
[1] "bbi_nmboot_model" "bbi_base_model" "bbi_model" "list"
> model_diff(boot_run)
Error in UseMethod("model_diff") :
no applicable method for 'model_diff' applied to an object of class "c('bbi_nmboot_model', 'bbi_base_model', 'bbi_model', 'list')"
> inherit_param_estimates(boot_run)
Error in check_model_object(.mod, "bbi_nonmem_model") :
Must pass a model object with one of the following classes: `bbi_nonmem_model`
Got object of class: `bbi_nmboot_model, bbi_base_model, bbi_model, list`
Works if I manually add the class
> class(boot_run)
[1] "bbi_nmboot_model" "bbi_base_model" "bbi_model" "list"
> class(boot_run) <- c("bbi_nonmem_model", class(boot_run))
> class(boot_run)
[1] "bbi_nonmem_model" "bbi_nmboot_model" "bbi_base_model" "bbi_model" "list"
> model_diff(boot_run)
< 106-boot > 106
@@ 1,3 @@ @@ 1,3 @@
< $PROBLEM Bootstrap run of model 106 > $PROBLEM From bbr: see 106.yaml for details
$INPUT C NUM ID TIME SEQ CMT EVID AMT DV AGE WT HT EGFR ALB BMI SEX A $INPUT C NUM ID TIME SEQ CMT EVID AMT DV AGE WT HT EGFR ALB BMI SEX A
AG AG
@@ 52,2 @@ @@ 52,5 @@
$EST MAXEVAL=9999 METHOD=1 INTER SIGL=6 NSIG=3 PRINT=1 MSFO=./106.msf $EST MAXEVAL=9999 METHOD=1 INTER SIGL=6 NSIG=3 PRINT=1 MSFO=./106.msf
~ > $COV PRINT=E
~ > $TABLE NUM CL V2 Q V3 KA ETAS(1:LAST) IPRED NPDE CWRES NOPRINT ONEHEA
~ : DER FILE=106.tab
~ > $TABLE NUM CL V2 Q V3 KA ETAS(1:LAST) NOAPPEND NOPRINT ONEHEADER FILE
~ : =106par.tab
> boot_run <- inherit_param_estimates(boot_run)
> model_diff(boot_run)
< 106-boot > 106
@@ 1,3 @@ @@ 1,3 @@
< $PROBLEM Bootstrap run of model 106 > $PROBLEM From bbr: see 106.yaml for details
$INPUT C NUM ID TIME SEQ CMT EVID AMT DV AGE WT HT EGFR ALB BMI SEX A $INPUT C NUM ID TIME SEQ CMT EVID AMT DV AGE WT HT EGFR ALB BMI SEX A
AG AG
@@ 34,20 @@ @@ 34,23 @@
$THETA ; log values $THETA ; log values
< (0.443) ; 1 KA (1/hr) - 1.5 > (0.5) ; 1 KA (1/hr) - 1.5
< (4.12) ; 2 V2 (L) - 60 > (3.5) ; 2 V2 (L) - 60
< (1.17) ; 3 CL (L/hr) - 3.5 > (1) ; 3 CL (L/hr) - 3.5
< (4.21) ; 4 V3 (L) - 70 > (4) ; 4 V3 (L) - 70
< (1.28) ; 5 Q (L/hr) - 4 > (2) ; 5 Q (L/hr) - 4
< (0.485) ; 6 CLEGFR~CL () > (1) ; 6 CLEGFR~CL ()
< (-0.0378) ; 7 AGE~CL () > (1) ; 7 AGE~CL ()
< (0.419) ; 8 ALB~CL () > (0.5) ; 8 ALB~CL ()
$OMEGA BLOCK(3) $OMEGA BLOCK(3)
< 0.219 ;ETA(KA) > 0.2 ;ETA(KA)
< 0.0668 0.0824 ;ETA(V2) > 0.01 0.2 ;ETA(V2)
< 0.121 0.0704 0.114 ;ETA(CL) > 0.01 0.01 0.2 ;ETA(CL)
$SIGMA $SIGMA
< 0.0399 ; 1 pro error > 0.05 ; 1 pro error
$EST MAXEVAL=9999 METHOD=1 INTER SIGL=6 NSIG=3 PRINT=1 MSFO=./106.msf $EST MAXEVAL=9999 METHOD=1 INTER SIGL=6 NSIG=3 PRINT=1 MSFO=./106.msf
~ > $COV PRINT=E
~ > $TABLE NUM CL V2 Q V3 KA ETAS(1:LAST) IPRED NPDE CWRES NOPRINT ONEHEA
~ : DER FILE=106.tab
~ > $TABLE NUM CL V2 Q V3 KA ETAS(1:LAST) NOAPPEND NOPRINT ONEHEADER FILE
~ : =106par.tab
from bbr.
We would need to think through the repercussions of this more, but naively I think it might be an easy and elegant solution for some number of the functions mentioned in this issue.
I think this would work very well for the new nmsim
model type, but yeah there are definitely a number of cases we'd need to have additional handling for nmboot
model objects, such as pulling in gradients, tables, build_path_from_model
, etc. that wont work either because the directory is different, or because the actual model file itself (.ctl
) doesnt actually get submitted/generate submission files.
Thought: could it make sense to do this for the nmsim
model type, but not nmboot
model objects?
from bbr.
check_up_to_date
for bootstrap runs was implemented in 8e6134a - @seth127 @kylebaron you guys may specifically want to take a look at this handling to make sure its implemented the way we want it to be.
- Something Seth noted though: we have to return a final object of
length 2
with namesmodel
anddata
. So if we want to include additional checks, they either have to be grouped intodata
ormodel
, or be isolated from the returned vector
from bbr.
Related Issues (20)
- Address deprecated warning in function `check_grd`
- Bootstrap runs should inherit attached bbi_args HOT 1
- inherit_param_estimates: revisit rounding and use matrix-handling PR HOT 1
- check_nonmem_finished and get_model_status refactor: improve wait times & change functionality HOT 9
- WK files created by bbr - delete by default? HOT 7
- Consider fail-safe for checking on terminated models HOT 4
- bbi package installation failed HOT 8
- Option to start bootstrap runs at final estimates from parent run HOT 3
- No error or warning when trying to overwrite run when `.wait = FALSE` HOT 15
- Re-name msf file in bootstrap run control stream HOT 1
- Submitting bootstrap run in batches can leave lots of unused compute HOT 2
- Bootstrap batch submission sometimes chokes when called before setup is done HOT 2
- Revisit `check_up_to_date` for `nmboot` models HOT 1
- push back minimum snapshot? HOT 5
- Feature: update $TABLE with a certain format HOT 1
- `bbi_init`: parse `nmfe_options` separately from other `.bbi_args`
- .exclude argument in run_log()
- Can't execute bbr commands via the clusters HOT 8
- Check if model can be passed to `nm_join()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bbr.