Skip to contents

Predict with keras

Usage

predict_keras(
  modelNN,
  predInput,
  maskNA = NULL,
  scaleInput = FALSE,
  col_means_train,
  col_stddevs_train,
  batch_size = NULL,
  filename = "",
  tempdirRaster = NULL,
  nCoresRaster = 2
)

Arguments

modelNN

an keras::keras() model.

predInput

data.frame or raster with colnames or layer names matching the expected input for modelRF.

maskNA

value to assign to NAs after scaling and passed to keras::layer_masking().

scaleInput

if TRUE, scale predInput with col_means_train and col col_stddevs_train.

col_means_train

the original mean of the predInput columns.

col_stddevs_train

the original sd of the predInput columns.

batch_size

for fit and predict functions. The bigger the better if it fits your available memory. Integer or "all".

filename

the file to write the raster predictions.

tempdirRaster

path to a directory to save temporal raster files.

nCoresRaster

number of cores used for parallelized raster cores. Use half of the available cores by default.