Fit pre-tuned XGBoost regression for use in simulations.
fit_xgboost(X, y, params, derivative = FALSE)
list containing a function "fit" which takes matrix input of the same width as X, and returns a vector of predictions. Optionally the list also contains a function "deriv_fit" for numerical difference derivative estimates.
matrix of covariates.
vector of responses.
XGBoost hyperparameters.
logical determining if numerical difference derivative estimate (wrt the first predictor) should also be returned.