Coder Social home page Coder Social logo

Comments (4)

seth127 avatar seth127 commented on September 23, 2024

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.

Screenshot 2024-05-09 at 1 30 02 PM

from bbr.

seth127 avatar seth127 commented on September 23, 2024

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.

barrettk avatar barrettk commented on September 23, 2024

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.

barrettk avatar barrettk commented on September 23, 2024

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 names model and data. So if we want to include additional checks, they either have to be grouped into data or model, or be isolated from the returned vector

from bbr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.