predict.submod_train | R Documentation |
Prediction function for the trained subgroup identification model (submod).
## S3 method for class 'submod_train' predict(object, newdata = NULL, ...)
object |
Trained submod model. |
newdata |
Data-set to make predictions at (Default=NULL, predictions correspond to training data). |
... |
Any additional parameters, not currently passed through. |
Identified subgroups with subgroup-specific predictions (depends on subgroup model)
Subgrps - Identified subgroups
pred - Predictions, depends on subgroup model
library(StratifiedMedicine) ## Continuous ## dat_ctns = generate_subgrp_data(family="gaussian") Y = dat_ctns$Y X = dat_ctns$X A = dat_ctns$A # Fit through submod_train wrapper # mod1 = submod_train(Y=Y, A=A, X=X, Xtest=X, submod="submod_lmtree") out1 = predict(mod1) table(mod1$Subgrps.train) table(out1$Subgrps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.