pam: K-Medoids Clustering.

Description Usage Arguments Details Value Constraints See Also Examples

Description

pam performs k-medoids clustering on FLTable objects.

Usage

1
pam(x, k, ...)

Arguments

x

an object of class FLTable, can be wide or deep table

k

the number of clusters

diss

logical if x is dissimilarity matrix

metric

only "euclidean" distance supported currently

medoids

initial medoids. Not used currently.

Stand

logical indicating if standardization should be done before calculating diss matrix.

cluster.only

logical if only clustering vector is needed as output

do.swap

logical indicating if swap phase is needed. currently always TRUE

keep.diss

logicals indicating if the dissimilarities and/or input data x should be kept in the result

keep.data

logicals indicating if the dissimilarities and/or input data x should be kept in the result

pomance

logical or integer in 0:2 specifying algorithmic short cuts. currently always FALSE

trace.lev

integer specifying a trace level for printing diagnostics during the build and swap phase of the algorithm. currently always 0

iter.max

the maximum number of iterations allowed

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

distTable

name of the in-database table having dissimilarity matrix or distance table

Details

The DB Lytix function called is FLKMedoids. K-Medoids clusters the training data. The algorithm used is PAM (Partitioning Around Medoids).

Value

pam gives a list which replicates equivalent R output from pam in cluster package. The mapping table can be viewed using object$mapping if input is wide table.

Constraints

Plotting time increases with size of data and even fail for large datasets because data is fetched to R session for plotting. If classSpec is not specified, the categorical variables are excluded from analysis by default.

See Also

pam for R function reference implementation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
widetable  <- FLTable("iris", "rownames")
kmedoidsobject <- pam(widetable,3)
print(kmedoidsobject)
plot(kmedoidsobject)
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:-
widetable  <- FLTable("iris", "obsid")
pamobjectnew <- pam(widetable,3,classSpec=list("Species(setosa)"))
plot(pamobjectnew)

Fuzzy-Logix/AdapteR documentation built on May 6, 2019, 5:07 p.m.