Description Usage Arguments Value See Also Examples
Given a list of models, this function runs validate
on each. See details for a description of how the data is encapsulated
for return.
1 | modelsValid(models, valid, ...)
|
models |
is either a list of model objects on which to find error statistics, or a single model to evaluate. |
valid |
a validation dataset with which to test the accuracy of the models provided. |
... |
(optional) other parameters to pass to |
As with modelAccs
, this function returns different values depending on whether the model is categorical or
continuous. For categorical data it returns a named list of accuracy statistics:
confMatrix
= confusion matrix
userAcc
= user accuracy
prodAcc
= producer accuracy
overallAcc
= overall accuracy
kappa
= kappa
For continuous data:
overallAcc
= overall r-squared
mse
= mean squared error
classAcc
for more on the computation of continuous and categorical accuracies, and modelAccs
for the
corresponding function that will compute accuracy based on the dataset used for model building.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # With categorical data
data ('siteData')
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])
mV <- modelsValid(modelRun,valid)
str(mV,2)
# 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,]
mV <- modelsValid(modelRun,valid)
str(mV,2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.