SparseClustering: Sparse Clustering

Description Usage Arguments Value Author(s) References Examples

View source: R/SparseClustering.R

Description

Implements the sparse clustering methods of [Witten/Tibshirani, 2010].

Usage

1
2
3
SparseClustering(DataOrDistances, ClusterNo, Strategy="Hierarchical",

PlotIt=F,Silent=FALSE, NoPerms=10,Wbounds, ...)

Arguments

DataOrDistances

Either a [1:n,1:d] matrix of dataset to be clustered. It consists of n cases of d-dimensional data points. Every case has d attributes, variables or features.

or a [1:n,1:n] symmetric distance matrix.

ClusterNo

Numeric indicating number to cluster to find in Tree/ Dendrogramm in case of Strategy="Hierachical" or numer of cluster to use in Strategy="kmeans"

Strategy

(optional) Char selecting methods Hierarchical or kmeans. Default: "Hierarchical"

PlotIt

(optional) Boolean. Default = FALSE = No plotting performed.

Silent

(optional) Boolean: print output or not (Default = FALSE = no output)

NoPerms

(optional), numeric scalar, Number of permutations.

Wbounds

(optional) numeric vector, range of tuning parameters to consider. This is the L1 bound on w, the feature weights [Witten/Tibshirani, 2010].

...

Further arguments passed on to sparcl HierarchicalSparseCluster or KMeansSparseCluster depending on Strategy.

Value

List of

Cls

[1:n] numerical vector with n numbers defining the classification as the main output of the clustering algorithm. It has k unique numbers representing the arbitrary labels of the clustering.

Object

Object defined by clustering algorithm as the other output of this algorithm

Tree

Object Tree if Strategy="Hierachical" is used.

Author(s)

Quirin Stier

References

[Witten/Tibshirani, 2010] Witten, D. and Tibshirani, R.: A Framework for Feature Selection in Clustering. Journal of the American Statistical Association, Vol. 105(490), pp. 713-726, 2010.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Hepta
data("Hepta")
Data = Hepta$Data
V1 = SparseClustering(Data, ClusterNo=7, Strategy="kmeans")
Cls1 = V1$Cls

V2 = SparseClustering(Data, ClusterNo=7, Strategy="Hierarchical")
Cls2 = V2$Cls

InputDistances = parallelDist::parDist(Data, method="euclidean")
DistanceMatrix = as.matrix(InputDistances)
V3 = SparseClustering(DistanceMatrix, ClusterNo=7, Strategy="Hierarchical")
Cls3 = V3$Cls

## Not run: 
set.seed(1)
Data = matrix(rnorm(100*50),ncol=50)
y    = c(rep(1,50),rep(2,50))
Data[y==1,1:25] = Data[y==1,1:25]+2

V1 = SparseClustering(Data, ClusterNo=2, Strategy="kmeans")
Cls1 = V1$Cls

## End(Not run)

FCPS documentation built on July 8, 2021, 1:06 a.m.