The per-fold work shared by crossValidateSpread() (both folds, one job) and crossValidateSpreadOneFold() (one fold, one job – the heldOutFold parameter). The fit's runName (and so its Cache key, see fitSpread()) is suffixed by k, so fold 1, fold 2 and a full fit (plain sim$.runName, no suffix) never share a cache entry.

fitAndScoreFold(sim, covs, thresh, fold, k)

Arguments

sim

a simList.

covs

mod$covsX1000.

thresh

mod$thresh.

fold

integer vector, one element per year in names(covs$historicalFires), from cvFolds().

k

integer; the fold (1 or 2) to hold out.

Value

data.table: this fold's simulated held-out years (fireSenseUtils::simulateFireSizes()), with fold.