View source: R/xgboostImpute.R
| xgboostImpute | R Documentation |
Impute missing values based on a random forest model using xgboost::xgboost()
xgboostImpute(
formula,
data,
imp_var = TRUE,
imp_suffix = "imp",
verbose = FALSE,
nrounds = 100,
objective = NULL,
...
)
formula |
model formula for the imputation |
data |
A |
imp_var |
|
imp_suffix |
suffix used for TF imputation variables |
verbose |
Show the number of observations used for training
and evaluating the RF-Model. This parameter is also passed down to
|
nrounds |
max number of boosting iterations,
argument passed to |
objective |
objective for xgboost,
argument passed to |
... |
Arguments passed to |
the imputed data set.
Other imputation methods:
hotdeck(),
impPCA(),
imputeCellEM(),
imputeCellIRMI(),
imputeCellM(),
imputeCellMCD(),
imputeCellwise(),
imputeRobust(),
imputeRobustChain(),
irmi(),
kNN(),
matchImpute(),
medianSamp(),
rangerImpute(),
regressionImp(),
sampleCat(),
vimmi,
vimpute()
data(sleep)
sleepx <- sleep
sleepx$Pred <- as.factor(LETTERS[sleepx$Pred])
sleepx$Pred[1] <- NA
# a numeric and a factor target imputed at once; nrounds = 30 keeps the
# example fast (the default is 100 boosting rounds)
imp <- xgboostImpute(Dream + Pred ~ BodyWgt + BrainWgt, data = sleepx, nrounds = 30)
head(imp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.