Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

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.

Value

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

Author(s)

Examples

data(symb.metab)

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

rfPermute

Estimate Permutation p-Values for Random Forest Importance Metrics

v2.1.81
GPL (>= 2)
Authors
Eric Archer [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.