Mixgb | R Documentation |
Set up an xgboost imputer object with specified hyperparameters and then obtain multiple imputed datasets
new()
Create a new Mixgb
object. This is used to set up the multiple imputation imputer using xgboost.
Mixgb$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 )
data
A data frame with missing values
nrounds
Max number of boosting iterations. Default: 50
max_depth
Maximum depth of the tree. Default: 6
gamma
Default: 0.1
eta
Default: 0.3
nthread
Default: 4
early_stopping_rounds
Default: 10,
colsample_bytree
Default: 1
min_child_weight
Default: 1
subsample
Default: 1
pmm.k
Default: 5
pmm.type
Default: "auto" (used to be NULL)
pmm.link
Default: "logit"
scale_pos_weight
Default:1
initial.imp
Default: "random"
tree_method
Default: "auto" (can set to "gpu_hist" for machine with NVIDIA GPUs)
gpu_id
Device ordinal. Default: 0
predictor
The type of predictor algorithm to use. Default: "auto" (other options: "cpu_predictor","gpu_predictor")
print_every_n
Default: 10L
verbose
Default: 0
MIXGB=Mixgb$new(withNA.df) MIXGB=Mixgb$new(withNA.df,nrounds=50,max_depth=6)
impute()
Use the imputer to impute missing values and obtain multiple datasets
Mixgb$impute(m = 5)
m
the number of imputed datasets. Default: 5
MIXGB=Mixgb$new(withNA.df) imputation.list=MIXGB$impute(m = 5)
## ------------------------------------------------
## Method `Mixgb$new`
## ------------------------------------------------
MIXGB=Mixgb$new(withNA.df)
MIXGB=Mixgb$new(withNA.df,nrounds=50,max_depth=6)
## ------------------------------------------------
## Method `Mixgb$impute`
## ------------------------------------------------
MIXGB=Mixgb$new(withNA.df)
imputation.list=MIXGB$impute(m = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.