predict_glmnet_raster: predict cv.glmnet model to ratser

Description Usage Arguments Author(s)

View source: R/prediction.R

Description

This function is to predict the glmnet model object on raster data. It accepts the quadratic transformation if it was provided in the original model fit.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
predict_glmnet_raster(
  r,
  model,
  slambda = "lambda.1se",
  type = "response",
  quadraticObj = NULL,
  factors = NULL,
  filename = NULL,
  verbose = TRUE
)

Arguments

r

a raster file

model

cv.glmnet model object

slambda

the values of the penalty lambda in cv.glmnet model. The default if "lambda.1se", alternatively "lambda.min" can be used. See predict.cv.glment help file in the glmnet pakage.

type

the prediction type. Could be "link" or "response". The default is "response".

quadraticObj

a make_quadratic object. If the model is fitted with the quadratic terms created by make_quadratic function, provide the make_quadratic object here.

factors

factor variables in the model

filename

output file directory for the predicted map. If provided, the map will be save on the disk.

verbose

logical. Control amount of printing...

Author(s)

Roozbeh Valavi


rvalavi/myspatial documentation built on May 15, 2021, 12:14 a.m.