xgbStandardize: Standardize the format of XGBoost

View source: R/xgbStandardize.r

xgbStandardizeR Documentation

Standardize the format of XGBoost

Description

Call the xgbStandardize function in lieu of the xgboost function to be able to use the xgboost function by using a formula and data frame to learn a model, to use the gridCV function in the buildmodels package and to make predictions.

Usage

xgbStandardize(formula, data, .round = 0, ...)

Arguments

formula

Model formula used to learn or predict the model

data

Input to the model in a data frame format

Details

If numeric values are passed as the dependent variable in the formula, it is converted to a factor rounded to the nearest integer. The rounding can be changed by using the @param .round parameter and passing to it the digits from the @seealso base::round() function.

The xgbStandardize also overrides the behavior of the prediction function for an xgb.standard model. This allows for the pass through of data frame as the data object, and provides the prediction probabilities if decision.value == TRUE.

Value

A model with the list values of xgboost with new values for predictor and predictor.factors

See Also

xgboost::xgboost()

Examples

model.xgb <- xgbStardize(status~., data, nrounds = 100, eta = 0.01)
pred.xgb <- predict(model.xgb, newdata=data)
prob.xgb <- predict(model.xgb, newdata=data, decision.values=TRUE)

joshuaderekwhite/buildmodels documentation built on April 27, 2022, 3:35 a.m.