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

MDSplot

Multi-dimensional Scaling Plot of Proximity matrix from randomForest


Description

Plot the scaling coordinates of the proximity matrix from randomForest.

Usage

MDSplot(rf, fac, k=2, palette=NULL, pch=20, ...)

Arguments

rf

an object of class randomForest that contains the proximity component.

fac

a factor that was used as response to train rf.

k

number of dimensions for the scaling coordinates.

palette

colors to use to distinguish the classes; length must be the equal to the number of levels.

pch

plotting symbols to use.

...

other graphical parameters.

Value

The output of cmdscale on 1 - rf$proximity is returned invisibly.

Note

If k > 2, pairs is used to produce the scatterplot matrix of the coordinates.

Author(s)

Robert Gentleman, with slight modifications by Andy Liaw

See Also

Examples

set.seed(1)
data(iris)
iris.rf <- randomForest(Species ~ ., iris, proximity=TRUE,
                        keep.forest=FALSE)
MDSplot(iris.rf, iris$Species)
## Using different symbols for the classes:
MDSplot(iris.rf, iris$Species, palette=rep(1, 3), pch=as.numeric(iris$Species))

randomForest

Breiman and Cutler's Random Forests for Classification and Regression

v4.6-14
GPL (>= 2)
Authors
Fortran original by Leo Breiman and Adele Cutler, R port by Andy Liaw and Matthew Wiener.
Initial release
2018-03-22

We don't support your browser anymore

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