Description Usage Arguments Details Value Author(s) References Examples
Calls the MEml models: MEgbm, MEgbmrules, MErfrules, MEglmtree, MECTree, etc. The training and test data can be split into lagged training and testing as described in [1]
| 1 2 3 4 5 6 7 | MEml.lag(lag = NULL, classifier, dat, id, rhs.vars, resp.vars,
  order.vars, rand.vars = NULL, reg.vars = NULL, part.vars = NULL,
  para, max.iter = 10, seed = 1, return.model = TRUE)
MEml(classifier, dat.trn, dat.tst, id, rhs.vars, resp.vars,
  rand.vars = NULL, reg.vars = NULL, part.vars = NULL, para,
  max.iter = 10, seed = 1, return.model = FALSE, ...)
 | 
| lag | time lag between predictors and outcome: e.g if lag = 1, then we use predictors in current vist to predict outcome in the next visit. | 
| classifier | character or character vector with names of classification models. 
See names( | 
| dat | data frame with predictors and outcome | 
| id | character name of the column containing the group identifier | 
| rhs.vars | caracter vector of predictors | 
| order.vars | order variables (usually time variable) | 
| rand.vars | random effect variables | 
| reg.vars | reg.vars regressors for MOB | 
| part.vars | partitioning variables for MOB and predictors | 
| para | named list of gbm training parameters | 
| max.iter | maximum number of iterations | 
| return.model | should the train model be return. Otherwise the return values is only the performance metrics | 
MEml.lag Takes the full data set and calls LongiLagSplit to split data into lagged 
training and testing.  MEml.lag also trains the MOB and CTree models (see [1]).  
MEml is the same as MEml.lag, except that you pass in the training and test set. So you can 
call LongiLagSlit and pass the derived training and test sets to MEml2.  
The train MEml model and performance matrics (as data frame) if return.model = TRUE
Che Ngufor <Ngufor.Che@mayo.edu>
Che Ngufor, Holly Van Houten, Brian S. Caffo , Nilay D. Shah, Rozalina G. McCoy Mixed Effect Machine Learning: a framework for predicting longitudinal change in hemoglobin A1c, in Journal of Biomedical Informatics, 2018 #
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | ## Not run: 
# parameter list 
para <- list(
method = "cv", # internal cross-validation method for parameter tuning. See caret package 
tuneLength=3, # grid size for parameter search 
number = 3, # number of internal cross-validation 
n.trees=100, # number of trees in gbm 
ntree = 50, # number of trees in random forest 
mtry = 5, # mtry in random forest 
interaction.depth=4,
shrinkage=0.01,
n.minobsinnode=10,
opt.para= TRUE, # perform parameter tuning through internal cross-validation 
coefReg = 0.5, 
coefImp=1, 
include.RE = FALSE,
con.tree = FALSE, 
max.iter = 10, alpha=0.05, minsize=20,maxdepth=30,  
K = 3, decay = 0.05, tol= 1e-5,
seed = 1 # random seed 
 )
data(heart.valve)
dat <- heart.valve
dat$id <- as.numeric(dat$id)  ## random effect grouping variable
resp.vars <- "inc.lvmi"
id <- "id"
## fixed effect variables 
rhs.vars <- c("sex", "age", "time", "fuyrs", "grad", "log.grad", "bsa", "lvh", "prenyha", 
              "redo", "size", "con.cabg", "creat", "dm", "acei", "lv", "emergenc", 
              "hc", "sten.reg.mix", "hs")
order.vars = "time"
rand.vars= "time"  ## random effect variables 
### split data into lagged training and testing 
### predict two time points in advanced 
dd <- LongiLagSplit(dat=dat, id=id, rhs.vars=rhs.vars,resp.vars=resp.vars,
                   order.vars=order.vars,lag= 2)  
train <- dd$train
test <- dd$test
res <- MEml(classifier="GBM", dat.trn = train, dat.tst=test, id=id, 
            rhs.vars=dd$rhs.vars, resp.vars=dd$resp.vars,
            rand.vars=rand.vars, para=para, max.iter = 10, seed = 1, 
            return.model = FALSE)
res$GBM
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.