fgkm {siatclust} | R Documentation |
Perform an feature group weighting subspace k-means.
fgkm(x, k, strGroup, lambda, eta, maxiter=100, delta=0.000001, maxrestart=10)
x |
numeric matrix of observations and features. |
k |
target number of clusters. |
strGroup |
a string give the group information, formated as "0-9:10-19:20-49" |
lambda |
parameter of feature weight distribution. |
eta |
parameter of group weight distribution. |
delta |
maximum change allowed between iterations for convergence. |
maxiter |
maximum number of iterations. |
maxrestart |
maximum number of restarts. Default is 10 so that we stand a good chance of getting a full set of clusters. Normally, any empty clusters that result are removed from the result, and so we may obtain fewer than k clusters if we don't allow restarts(i.e., maxrestart=0). If < 0, then there is no limit on the number of restarts and we are much likely to get a full set of k clusters. |
The feature group weighting k-means clustering algorithm is a extension to ewkm, which itself is a soft subspace clustering method.
The algorithm weights subspaces in both feature groups and individual features.
Always check the number of iterations, the number of restarts, and the total number of iterations as they give a good indication of whether the algorithm converged.
Return an object of class "kmeans" and "fgkm", compatible with other function that work kmeans objects, such as the 'print' method. The object is a list with the following components in addition to the components of the kmeans object:
cluster |
A vector of integer (from 1:k) indicating the cluster to which each point is allocated. |
centers |
A matrix of cluster centers. |
featureWeight |
A matrix of weights recording the relative importance of each feature for each cluster. |
groupWeight |
A matrix of group weights recording the relative importance of each feature goup for each cluster. |
iterations |
This report on the number of iterations before termination. Check this to see whether the maxiters was reached. If so then teh algorithm may not be converging, and thus the resulting clustering may not be particularly good. |
restarts |
The number of times the clustering restarted because of a disappearing cluster resulting from one or more k-means having no observations associated with it. An number here greater than zero indicates that the algorithm is not converging on a clustering for the given k. It is recommeded that k be reduced. |
totalIterations |
The total number of iterations over all restarts. |
totolCost |
The total cost calculated in the cost function. |
Longfei Xiao lf.xiao@siat.ac.cn
X. Chen, et al., A feature group weighting method for subspace clustering of high-dimensional data, Pattern Recognition(2011), doi:10.1016/j.patcog.2011.06.004
# The data fgkm.sample has 600 objects and 50 dimensions. # Scale the data before clustering x <- scale(fgkm.sample) # Group information is formated as below. # Each feature is separated by ':'. strGroup <- "0-9:10-19:20-49" # Use the fgkm algorithm. myfgkm <- fgkm(x, 3, strGroup, 3, 1) # You can print the clustering result now. myfgkm$cluster myfgkm$featureWeight myfgkm$groupWeight myfgkm$iterations myfgkm$restarts myfgkm$totiters myfgkm$totss # Use a cluster validation method from package 'clv'. # real.cluster is the real class label of the data 'fgkm.sample'. real.cluster <- rep(1:3, each=200) # std.ext() returns four values SS, SD, DS, DD. std <- std.ext(as.integer(myfgkm$cluster), real.cluster) # Rand index clv.Rand(std) # Jaccard coefficient clv.Jaccard(std)