Description Usage Arguments Value Examples
Unsupervised random forest clustering. A Random forest (RF) classifier is trained to predict
the data labeled as class “True.Data" and a synthetic data labeled as class “Synthetic.Data".
The synthetic data is generated by taking a random sample from each dimension of the true data, with
or without replacement (see RFdist
). The dissimilarity matrix from RFdist
is
then passed to the algorithms in the "flexible point clustering"
fpc
package for clustering and selection of optimal number of clusters through the bootstrap
cluster-wise stability method.
1 2 3 4 5 6 7 8 9 |
data |
data.frame or matrix |
... |
further arguments passed to or from other methods. |
RFdist |
RF distance matrix computed from |
B |
number of bootstraps |
clustermethod |
clustering method, options are |
classification |
type of prediction for finding optimal number of clusters
see |
krange |
integer vector; numbers of clusters to be tried |
kopt |
user provided optimal number of clusters |
run.boot |
(logical) run bootstrap cluster-wise stability ? |
fun |
function to determine mediods, should be |
x |
object of class |
A list with elements:
cluster.model: The cluster model
cluster: cluster memberships
kopt: optimal number of clusters
mediods: a mediod object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
set.seed(12345)
data(iris)
dat <- iris[, -5]
RF.dist <- RFdist(data=dat, ntree = 10, no.rep=20, syn.type = "permute",
importance=TRUE, oob.prox=TRUE, proxConver=FALSE)
#
Clus.res <- UnsupRF(data = dat, RFdist=RF.dist$RFdist,
B = 5, clustermethod=pamkCBI, classification="centroid",
krange= 2:4, kopt=2, run.boot = TRUE)
print(Clus.res)
clusters <- Clus.res$clusters
kopt <- Clus.res$kopt # optimal number of clusters
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.