Hi All,
I've been following an unsupervised random forest (RF) routine. Unsupervised Random Forest Example - Dan Oehm | Gradient Descending
In standard unsupervised RF fashion: the RF proximity matrix is extracted, and then clustered using something like partitioning around medoids (PAM).
Thus far, I don't have a problem with the implementation. My only problem is labelling the axes on the cluster plot.
I would like unlabelled axes, or axes simply labelled X, and Y. (instead of the two dimensions of the iris dataset).
Would someone be able to show me how to recode the ggplot below to present the axes as unlabelled, or simply as X and Y, please?
Would be massively appreciated.
install.packages("randomForest")
install.package("caret")
install.packages("cluster")
install.packages("RColorBrewer")
install.packages("ggplot2")
install.packages("dplyr")
#LOAD PACKAGES
library(randomForest)
library(caret)
library(cluster)
library(RColorBrewer)
library(ggplot2)
library(dplyr)
#SET COLOUR FORMAT
mycol <- colorRampPalette(colors = c("#25591f","#818c3c", "#72601b"))
#DATA
data(iris)
#UNSUPERVISED RANDOM FOREST
rf <- randomForest(iris[,-5], mtry = 2, ntree = 100, proximity = TRUE)
#PROXIMITY MATRIX
prox <- rf$proximity
#PAM WITH 3 CLUSTERS
pam.rf <- pam(prox, 3)
#GGPLOT
Clusters <- as.factor(pam.rf$cluster)
Species <- iris$Species
ggplot(iris, aes(x = Petal.Length, y = Petal.Width, col = Clusters, pch = Species)) + geom_point(size = 3) +
scale_color_manual(values = mycol(3))