| Mixgb.train | R Documentation |
Set up an xgboost imputer object with specified hyperparameters and then obtain an imputed object including multiple imputed datasets, saved models and parameters.
new()Create a new Mixgb object. This is used to set up the multiple imputation imputer using xgboost.
Mixgb.train$new( data, nrounds = 50, max_depth = 6, gamma = 0.1, eta = 0.3, nthread = 4, early_stopping_rounds = 10, colsample_bytree = 1, min_child_weight = 1, subsample = 1, pmm.k = 5, pmm.type = "auto", pmm.link = "logit", scale_pos_weight = 1, initial.imp = "random", tree_method = "auto", gpu_id = 0, predictor = "auto", print_every_n = 10L, verbose = 0 )
dataA data frame with missing values
nroundsmax number of boosting iterations. Default: 50
max_depthmaximum depth of the tree. Default: 6
gammaDefault: 0.1
etaDefault: 0.3
nthreadDefault: 4
early_stopping_roundsDefault: 10,
colsample_bytreeDefault: 1
min_child_weightDefault: 1
subsampleDefault: 1
pmm.kDefault: 5
pmm.typeDefault: "auto" (used to be NULL)
pmm.linkDefault: "logit"
scale_pos_weightDefault:1
initial.impDefault: "random"
tree_methodDefault: "auto" (can set "gpu_hist" for linux)
gpu_idDevice ordinal. Default: 0
predictorThe type of predictor algorithm to use. Default: "auto" (other options: "cpu_predictor","gpu_predictor")
print_every_nDefault: 10L
verboseDefault: 0
MIXGB=Mixgb.train$new(withNA.df) MIXGB=Mixgb.train$new(withNA.df,nrounds=50,max_depth=6)
impute()Use the imputer to impute missing values and obtain multiple imputed datasets, saved training models and some parameters needed for future use.
Mixgb.train$impute(m = 5, save.vars = NULL)
mthe number of imputed datasets. Default: 5
save.varsthe names or indices of variables that users want to save models for. Default: NULL. By default, save.vars=NULL, imputation models for all variables will be saved for imputing future data. However, if users know that future data will only have missing values in certain variables, they can choose to save models only for those variables.
MIXGB=Mixgb.train$new(withNA.df) mixgb.obj=MIXGB$impute(m = 5)
## ------------------------------------------------
## Method `Mixgb.train$new`
## ------------------------------------------------
MIXGB=Mixgb.train$new(withNA.df)
MIXGB=Mixgb.train$new(withNA.df,nrounds=50,max_depth=6)
## ------------------------------------------------
## Method `Mixgb.train$impute`
## ------------------------------------------------
MIXGB=Mixgb.train$new(withNA.df)
mixgb.obj=MIXGB$impute(m = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.