Learn R Programming

CAST (version 0.9.0)

plot: Plot CAST classes

Description

Generic plot function for CAST Classes

A plotting function for a forward feature selection result. Each point is the mean performance of a model run. Error bars represent the standard errors from cross validation. Marked points show the best model from each number of variables until a further variable could not improve the results. If type=="selected", the contribution of the selected variables to the model performance is shown.

Density plot of nearest neighbor distances in geographic space or feature space between training data as well as between training data and prediction locations. Optional, the nearest neighbor distances between training data and test data or between training data and CV iterations is shown. The plot can be used to check the suitability of a chosen CV method to be representative to estimate map accuracy.

Plot the DI and errormetric from Cross-Validation with the modelled relationship

Usage

# S3 method for trainDI
plot(x, ...)

# S3 method for aoa plot(x, samplesize = 1000, ...)

# S3 method for nndm plot(x, ...)

# S3 method for knndm plot(x, ...)

# S3 method for ffs plot( x, plotType = "all", palette = rainbow, reverse = FALSE, marker = "black", size = 1.5, lwd = 0.5, pch = 21, ... )

# S3 method for geodist plot(x, unit = "m", stat = "density", ...)

# S3 method for errorModel plot(x, ...)

Value

a ggplot

a ggplot

Arguments

x

errorModel, see DItoErrormetric

...

other params

samplesize

numeric. How many prediction samples should be plotted?

plotType

character. Either "all" or "selected"

palette

A color palette

reverse

Character. Should the palette be reversed?

marker

Character. Color to mark the best models

size

Numeric. Size of the points

lwd

Numeric. Width of the error bars

pch

Numeric. Type of point marking the best models

unit

character. Only if type=="geo" and only applied to the plot. Supported: "m" or "km".

stat

"density" for density plot or "ecdf" for empirical cumulative distribution function plot.

Author

Marvin Ludwig, Hanna Meyer

Carles Milà

Marvin Ludwig and Hanna Meyer

See Also

ffs, bss

Examples

Run this code
if (FALSE) {
data(splotdata)
splotdata <- st_drop_geometry(splotdata)
ffsmodel <- ffs(splotdata[,6:16], splotdata$Species_richness, ntree = 10)
plot(ffsmodel)
#plot performance of selected variables only:
plot(ffsmodel,plotType="selected")
}

Run the code above in your browser using DataLab