Description Usage Arguments Details Value References Examples
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
disagreement A
. Q
and 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)

x 
either a classification model with a 
test_data 
a 
pop 
A 
class_col 
required if 
reclass_mat 
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 teamlucc
classify
functions. If x
is a model, and testing data
is included in the model, pop
and 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 RasterLayer
, then test_data
must be supplied.
A RasterLayer
with a predicted map.
test_data
can be one of:
NULL
. If test_data is NULL
, accuracy
will try to use
testing data included in x
. This will only work if x
is a model of class train
from the caret
package, and
if the model was run using the one of the teamlucc
classify
functions.
A SpatialPolygonsDataFrame
object, in which case accuracy
will extract the predicted classes within each polygon from x
.
This will only work if x
is a RasterLayer
.
A pixel_data
object, in which case accuracy
will use the
included training_flag
indicator to separate testing and
training data.
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
frequencies.
accuracyclass
instance
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:44074429.
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:122131.
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  ## Not run:
train_data < get_pixels(L5TSR_1986, L5TSR_1986_2001_training, "class_1986",
training=.6)
model < train_classifier(train_data)
accuracy(L5TSR_1986_rfmodel)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.