Fit a gradient boosting regression model with XGBoost

fit_xgb(
  formula,
  data,
  params = list(max_depth = 3, eta = 0.01, objective = "reg:squarederror"),
  nrounds = 1000,
  nthread = -1,
  ...
)

Arguments

formula

An object of class formula with a symbolic description of the model to be fitted.

data

A data.frame containing the variables in the model.

params

A list with model parameters. For details, see xgboost

nrounds

Max number of boosting iterations.

...

Other parameters for the model fitting function.

Value

A list with two data frames: gof contains goodness of fit measures of the fit and coefs contains the fitted coefficients.