%DeepSee.extensions.clusters.PAM
Class %DeepSee.extensions.clusters.PAM Extends AbstractModel [ System = 4 ]
This class provides an implemantation of Partitioning Around Medoids (PAM) algorithm, a.k.a. K-Medoids (do not mix with K-Means).
The PAM algorithm was developed by Leonard Kaufman and Peter J. Rousseeuw, and this algorithm is very similar to K-means, mostly because both are partitional algorithms, in other words, both break the datasets into groups, and both works trying to minimize the error, but PAM works with Medoids, that are an entity of the dataset that represent the group in which it is inserted, and K-means works with Centroids, that are artificially created entity that represent its cluster.
The PAM algorithm partitionates a dataset of n objects into a number k of clusters, where both the dataset and the number k is an input of the algorithm. This algorithm works with a matrix of dissimilarity, where its goal is to minimize the overall dissimilarity between the representants of each cluster and its members.
Pure PAM algorithm only works when a dataset is well partitioned by its nature. It first generates a random solution and then uses the steepest descent to optimize it. Therefore it is prone to falling into local minimum. Two modifications implemented by subclasses PAMSA (PAM with Simulated Annealing) and CLARA (Clustering for Large Applications) try to alleviate this deficiency.
See Wikipedia article for more information.
Properties
K
Property K As %Integer;
The number of clusters to create
Medoid
Property Medoid [ Internal, MultiDimensional ];
Methods
New
ClassMethod New(dsName As %String, Output sc As %Status) As PAM
Open
ClassMethod Open(dsName As %String, Output sc As %Status) As PAM
Create
ClassMethod Create(dsName As %String, new As %Boolean, Output sc As %Status) As PAM [ Private ]
IsPrepared
Method IsPrepared() As %Boolean
Prepare
Method Prepare() As %Status
Execute
Method Execute() As %Status
ExecuteLoop
Method ExecuteLoop() As %Status [ Internal ]
Init
Method Init() As %Status [ Internal ]
GenerateMedoids
Method GenerateMedoids() [ Internal ]
SetCost
Method SetCost() As %Status [ Internal ]
Assign
Method Assign() As %Status [ Internal ]
Swap
Method Swap(Output changed As %Integer) As %Status [ Internal ]
SwapCluster
Method SwapCluster(k As %Integer, Output changed As %Boolean) As %Status [ Internal ]
ClusterCost
Method ClusterCost(k As %Integer) As %Double
CurrentTotalCost
Method CurrentTotalCost()
TotalCost
Method TotalCost()