Description Usage Arguments Details Value Constraints Examples
hkmeans
performs Hierarchial k-means clustering on FLTable objects.
1 |
x |
an object of class FLTable, wide or deep |
centers |
the number of clusters |
levels |
no.of.levels in the hierarchy |
iter.max |
the maximum number of iterations allowed |
nstart |
the initial number of random sets |
excludeCols |
the comma separated character string of columns to be excluded |
classSpec |
list describing the categorical dummy variables |
whereconditions |
takes the where_clause as a string |
The DB Lytix function called is FLHKMeans.Hierarchical K-Means clusters the training data. The relationship of observations to clusters has hard edges. It re-clusters the training data in each cluster until the desired hierarchical level is reached.
hkmeans
returns a list which replicates equivalent R output
from hkmeans
in stats package.The mapping table can be viewed
using object$mapping
if input is wide table.
If classSpec is not specified, the categorical variables are excluded from analysis by default.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | widetable <- FLTable(getTestTableName("tblAbaloneWide"), "ObsID",
whereconditions = "ObsID< 101")
hkmeansobject <- hkmeans(widetable,3,2,20,1,"Rings,SEX")
hkmeansobject$cluster
hkmeansobject$size
hkmeansobject$withinss
hkmeansobject$totss
hkmeansobject$betweenss
print(hkmeansobject)
plot(hkmeansobject)
#One can specify ClassSpec and transform categorical variables
#before clustering. This increases the number of variables in the plot
#because categorical variable is split into binary numerical variables.
#The clusters may not be well-defined as is observed in the case below:-
hkmeansobjectnew <- hkmeans(widetable,3,2,20,1,"Rings,SEX",list("DummyCat(D)","SEX(M)"))
plot(hkmeansobjectnew)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.