MDSplot | R Documentation |
Plot the scaling coordinates of the proximity matrix from randomForest.
MDSplot(rf, fac, k=2, palette=NULL, pch=20, ...)
rf |
an object of class |
fac |
a factor that was used as response to train |
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. |
The output of cmdscale
on 1 - rf$proximity
is
returned invisibly.
If k > 2
, pairs
is used to produce the
scatterplot matrix of the coordinates.
Robert Gentleman, with slight modifications by Andy Liaw
randomForest
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.