Calculates a contingency table and various statistics for use in image
classification accuracy assessment and map comparison. Contingency table
includes user's, producer's, and overall accuracies for an image
classification, and quantity disagreement
Q and allocation
A are calculated based on Pontius
and Millones (2011). Standard errors for 95 percent confidence intervals for
the user's, producer's and overall accuracies are calculated as in Foody and
Stehman (2009) Table 21.3. To avoid bias due to the use of a sample
contingency table, the contingency table will be converted to a population
contingency table if the variable 'pop' is provided. For an accuracy
assessment using testing data from a simple random sample, 'pop' does not
need to be provided (see Details).
1 2 3 4 5 6 7 8 9 10 11 12 13
accuracy(x, test_data, pop, class_col, reclass_mat) ## S4 method for signature 'train,ANY,ANY,missing' accuracy(x, test_data, pop, class_col, reclass_mat) ## S4 method for signature 'RasterLayer,pixel_data,ANY,missing' accuracy(x, test_data, pop, class_col, reclass_mat) ## S4 method for signature 'RasterLayer,SpatialPolygonsDataFrame,ANY,character' accuracy(x, test_data, pop, class_col, reclass_mat)
either a classification model with a
a reclassification matrix to be used in the case of a
model fit by
x can be one of:
A prediction model as output from one of the
classify functions. If
x is a model, and testing data
is included in the model,
test_data can both be
missing, and accuracy will still run (though the output will in this case
be biased unless the testing data is from a simple random sample). If
x is a
test_data must be supplied.
RasterLayer with a predicted map.
test_data can be one of:
NULL. If test_data is
accuracy will try to use
testing data included in
x. This will only work if
is a model of class
train from the
caret package, and
if the model was run using the one of the
SpatialPolygonsDataFrame object, in which case
will extract the predicted classes within each polygon from
This will only work if
x is a
pixel_data object, in which case
accuracy will use the
training_flag indicator to separate testing and
pop can be one of:
NULL, in which case the sample frequencies will be used as estimates of the population frequencies of each class.
A list of length equal to the number of classes in the map giving the total number of pixels in the population for each class.
A predicted cover map from as a
RasterLayer, from which the
class frequencies will be tabulated and used as the population
Pontius, R. G., and M. Millones. 2011. Death to Kappa: birth of quantity disagreement and allocation disagreement for accuracy assessment. International Journal of Remote Sensing 32:4407-4429.
Olofsson, P., G. M. Foody, S. V. Stehman, and C. E. Woodcock. 2013. Making better use of accuracy data in land change studies: Estimating accuracy and area and quantifying uncertainty using stratified estimation. Remote Sensing of Environment 129:122-131.
Foody, G.M., Stehman, S.V., 2009. Accuracy Assessment, in: Warner, T.A., Nellis, M.D., Foody, G.M. (Eds.), The SAGE Handbook of Remote Sensing. SAGE.
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.