rfPermute (version 2.1.81)

proximityPlot: Plot Random Forest Proximity Scores

Description

Create a plot of Random Forest proximity scores using multi-dimensional scaling.

Usage

proximityPlot(
  rf,
  dim.x = 1,
  dim.y = 2,
  legend.loc = c("top", "bottom", "left", "right"),
  point.size = 2,
  circle.size = 8,
  circle.border = 1,
  hull.alpha = 0.3,
  plot = TRUE
)

Arguments

rf

A randomForest object.

dim.x, dim.y

Numeric values giving x and y dimensions to plot from multidimensional scaling of proximity scores.

legend.loc

Character keyword specifying location of legend. Can be "bottom", "top", "left", "right".

point.size

Size of central points.

circle.size

Size of circles around correctly classified points as argument to 'cex'. Set to NULL for no circles.

circle.border

Width of circle border.

hull.alpha

value giving alpha transparency level for convex hull shading. Setting to NULL produces no shading. Ignored for regression models.

plot

logical determining whether or not to show plot.

Value

a list with prox.cmd: the MDS scores of the selected dimensions, and g the ggplot object.

Details

Produces a scatter plot of proximity scores for dim.x and dim.y dimensions from a multidimensional scale (MDS) conversion of proximity scores from a randomForest object. For classification models, a convex hull is drawn around the a-priori classes with points colored according to original (inner) and predicted (outer) class.

Examples

Run this code
# NOT RUN {
data(symb.metab)

rf <- randomForest(type ~ ., symb.metab, proximity = TRUE)
proximityPlot(rf)

# }

Run the code above in your browser using DataLab