Mixgb: Multiple imputation through xgboost R6 class imputer object

MixgbR Documentation

Multiple imputation through xgboost R6 class imputer object

Description

Set up an xgboost imputer object with specified hyperparameters and then obtain multiple imputed datasets

Methods

Public methods


Method new()

Create a new Mixgb object. This is used to set up the multiple imputation imputer using xgboost.

Usage
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
)
Arguments
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

Examples
MIXGB=Mixgb$new(withNA.df)
MIXGB=Mixgb$new(withNA.df,nrounds=50,max_depth=6)

Method impute()

Use the imputer to impute missing values and obtain multiple datasets

Usage
Mixgb$impute(m = 5)
Arguments
m

the number of imputed datasets. Default: 5

Examples
MIXGB=Mixgb$new(withNA.df)
imputation.list=MIXGB$impute(m = 5)

Examples


## ------------------------------------------------
## 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)

agnesdeng/misle documentation built on Sept. 22, 2023, 8:48 p.m.