n_predicted: Number of classes predicted

View source: R/dsmartr_evaluate.R

n_predictedR Documentation

Number of classes predicted

Description

Counts how many different soil classes were predicted on a pixel

Usage

n_predicted(input = NULL, n_iterations = NULL, noise_cutoff = NULL)

Arguments

input

A vector of integers n soil classes long, where the integers refer to the number of times a soil class was predicted.

n_iterations

Integer; the total number of model runs.

noise_cutoff

Decimal; proportion of predictions to be considered 'noise' and ignored. Allowable values range between 0 and 1.

Value

Integer; the number of distinct soil classes predicted on the pixel (optionally, above a supplied threshold).

Note

This is a helper function and not widely applicable. It is expected to be used in concert with raster::calc(), applied to a stack of tallied soil class predictions produced by dsmartr::eval_npred().

Examples

## Not run: 
# a set of tallies from the heronvale demo data
counts_19291 <- as.integer(c(0, 1, 3, 0,  0, 0, 17,  0, 8, 0, 0, 6, 0, 0, 12,
1, 0, 0, 0, 0, 12, 0, 0, 8, 0,  0, 0,  0, 12, 1, 3, 5, 2, 9, 0,  0, 0, 0))
n_soils <- n_soils_predicted(counts_19291)
n_soils_10 <- n_soils_predicted(counts_19291, 100, 0.1)

## End(Not run)


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