eval_npred: Calculate soil classes per pixel

View source: R/dsmartr_evaluate.R

eval_npredR Documentation

Calculate soil classes per pixel

Description

Calculates and maps the number of distinct soil classes predicted. Requires outputs of collate.

Usage

eval_npred(
  tallied_preds = NULL,
  cpus = 1,
  n_iterations = NULL,
  noise_cutoff = NULL
)

Arguments

tallied_preds

RasterBrick; 'tallied_predictions' output by collate.

cpus

Integer; number of processors to use in parallel.

n_iterations

Optional Integer; the number of iterations supplied to iterate.

noise_cutoff

Optional Decimal; proportion of predictions to be considered 'noise' and ignored. Acceptable values range between 0 and 1 inclusive. Defaults to 0.

Value

n_classes_predicted: RasterLayer depicting the number of distinct soils predicted per pixel more than n_iterations * noise_cutoff times. Written to disk as GeoTIFF.

Note

Fewer classes predicted on a pixel generally indicates higher internal model confidence at that location.

Examples

## Not run: 
# run iterate() and collate() with the example data then:
nxpred <- eval_npred(tallied_preds = collated[['tallied_predictions']],
                     cpus = max(1, (parallel::detectCores() - 1)),
                     n_iterations = nlayers(iteration_maps),
                     noise_cutoff = 0.1)

## End(Not run)

obrl-soil/dsmartr documentation built on Feb. 1, 2024, 10:57 p.m.