plot.sits_accuracy: Plot confusion matrix

View source: R/sits_plot.R

plot.sits_accuracyR Documentation

Plot confusion matrix

Description

Plot a bar graph with informations about the confusion matrix

Usage

## S3 method for class 'sits_accuracy'
plot(x, y, ..., title = "Confusion matrix")

Arguments

x

Object of class "plot.sits_accuracy".

y

Ignored.

...

Further specifications for plot.

title

Title of plot.

Value

A plot object produced by the ggplot2 package containing color bars showing the confusion between classes.

Note

Please refer to the sits documentation available in <https://e-sensing.github.io/sitsbook/> for detailed examples.

Author(s)

Gilberto Camara gilberto.camara@inpe.br

Examples

if (sits_run_examples()) {
    # show accuracy for a set of samples
    train_data <- sits_sample(samples_modis_ndvi, frac = 0.5)
    test_data  <- sits_sample(samples_modis_ndvi, frac = 0.5)
    # compute a random forest model
    rfor_model <- sits_train(train_data, sits_rfor())
    # classify training points
    points_class <- sits_classify(
        data = test_data, ml_model = rfor_model
    )
    # calculate accuracy
    acc <- sits_accuracy(points_class)
    # plot accuracy
    plot(acc)
}

sits documentation built on Sept. 11, 2024, 6:36 p.m.