
Create a plot of Random Forest proximity scores using multi-dimensional scaling.
proximityPlot(
rf,
dim.x = 1,
dim.y = 2,
class.cols = NULL,
legend.type = c("legend", "label", "none"),
legend.loc = c("top", "bottom", "left", "right"),
point.size = 2,
circle.size = 8,
circle.border = 1,
group.type = c("ellipse", "hull", "contour", "none"),
group.alpha = 0.3,
ellipse.level = 0.95,
n.contour.grid = 100,
label.size = 4,
label.alpha = 0.7,
plot = TRUE
)
a randomForest
object.
numeric values giving x and y dimensions to plot from multidimensional scaling of proximity scores.
vector of colors to use for each class.
type of legend to use to label classes.
character keyword specifying location of legend.
Can be "bottom", "top", "left", "right"
.
size of central points. Set to NULL
for no points.
size of circles around points indicating classification. S Set to NULL for no circles.
width of circle border.
type of grouping to display. Ignored for regression models.
value giving alpha transparency level for group shading.
Setting to 0
produces no shading.
the confidence level at which to draw the ellipse.
number of grid points for contour lines.
size of label if legend.type = `label`
.
transparency of label background.
logical determining whether or not to show plot.
a list with:
the MDS scores of the selected dimensions
ggplot
object
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, points are colored according to original (inner)
and predicted (outer) class.
# NOT RUN {
data(symb.metab)
rf <- randomForest(type ~ ., symb.metab, proximity = TRUE)
# With confidence ellipses
proximityPlot(rf)
# With convex hulls
proximityPlot(rf, group.type = "hull")
# With contours
proximityPlot(rf, group.type = "contour")
# Remove the points and just show ellipses
proximityPlot(rf, point.size = NULL, circle.size = NULL, group.alpha = 0.5)
# Labels instead of a legend
proximityPlot(rf, legend.type = "label", point.size = NULL, circle.size = NULL, group.alpha = 0.5)
# }
Run the code above in your browser using DataLab