Description Usage Arguments Value See Also Examples
This function is a wrapper for classAcc that, given an independent validation dataset, uses the model to come up with new predicted
values. It then calls classAcc
with these two validation datasets (the one generated by the model and the true values) to
report class accuracies.
1 |
model |
the model to test. |
valid |
the validation dataset; must contain all the parameters used in the model. |
... |
other variables to pass to |
Returns the result from classAcc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | data ('siteData')
# With categorical data
gen <- sample(1:nrow(siteData),floor(nrow(siteData)*0.5))
modelRun <- generateModels(data = siteData[sort(gen),],
modelTypes = suppModels,
x = c('brtns','grnns','wetns','dem','slp','asp','hsd'),
y = 'ecoType',
grouping = ecoGroup[['identity','transform']],
echo = FALSE)
valid <- siteData[-gen,]
valid$ecoType <- as.factor(ecoGroup[['identity','transform']][valid$ecoType])
validate(modelRun[[2]],valid)
validModels(modelRun,valid)
# With continuous data
gen <- sample(1:nrow(siteData),floor(nrow(siteData)*0.5))
modelRun <- generateModels(data = siteData[sort(gen),],
modelTypes = contModels,
x = c('brtns','grnns','wetns','dem','slp','asp','hsd'),
y = 'easting',
echo = FALSE)
valid <- siteData[-gen,]
validate(modelRun[[2]],valid)
modelsValid(modelRun,valid)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.