modifyClusters: Change number of clusters (and clusters shape) on the fly

View source: R/RandomUniformForestsCPP.R

modifyClustersR Documentation

Change number of clusters (and clusters shape) on the fly

Description

Modify on the fly the number of clusters in the unsupervised mode of Random Uniform Forests. Once the unsupervised model is built, one can change the clustering scheme, adding or merging clusters without computing again the model. Average silhouette coefficient or variance between clusters are automatically adjusted in order to assess the new scheme.

Usage

modifyClusters(object, decreaseBy = NULL, increaseBy = NULL, seed = 2014)

Arguments

object

an object of class unsupervised.

decreaseBy

decrease the current number of clusters by the value of 'decreaseBy'.

increaseBy

decrease the current number of clusters by the value of 'increaseBy'.

seed

see unsupervised.randomUniformForest.

Value

An object of class unsupervised.

Author(s)

Saip Ciss saip.ciss@wanadoo.fr

See Also

mergeClusters

Examples

## not run
## load iris data
# data(iris)

## run unsupervised modelling, removing labels and committing 4 clusters
# iris.rufUnsupervised = unsupervised.randomUniformForest(iris[,-5], threads = 1, clusters = 4)

## view a summary
# iris.rufUnsupervised

## plot clusters 
# plot(iris.rufUnsupervised)

## modify clusters, decreasing them by  one
# iris.rufUnsupervisedNew = modifyClusters(iris.rufUnsupervised, decreaseBy = 1)

## assess fitting comparing average Silhouette before and after
# iris.rufUnsupervisedNew

## plot to see the new clusters
# plot(iris.rufUnsupervisedNew) 

randomUniformForest documentation built on June 22, 2022, 1:05 a.m.