xgb_stack: xgb predictions

Description Usage Arguments Details

View source: R/xgb_stack.R

Description

XGboost prediction on rasterstacks, allowing missing value

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
xgb_stack(
  sr,
  df_var,
  y_var,
  xgbname = "xgb.tif",
  max_depth,
  eta,
  gamma,
  nrounds,
  subsample,
  verbose = 0,
  xgb_lambda,
  xgb_alpha
)

Arguments

sr

raster stack of predictors

df_var

dataframe containing predictors and responses

y_var

specify the name of the response

xgbname

specify the name/directoray of the predicted raster file to save

Details

use as.matrix instead of a sparse matrix model, the R Matrix package is therefore not needed and missing data is kept in, though in situations with lots of zeros, it is less efficient than using a sparse matrix. The same dense array is used in the xgboost_imp, xgboost_LUR, and xgb_pre. The other funciton, predicLA_RF_XGB_tiles used a sparse matrix, which means rows with missing values are missed.


mengluchu/APMtools documentation built on Jan. 27, 2022, 2:41 a.m.