pyclustering.cluster.clarans.clarans Class Reference

Class represents clustering algorithm CLARANS (a method for clustering objects for spatial data mining). More...

Public Member Functions

def __init__ (self, data, number_clusters, numlocal, maxneighbor)
 Constructor of clustering algorithm CLARANS. More...
 
def process (self)
 Performs cluster analysis in line with rules of CLARANS algorithm. More...
 
def get_clusters (self)
 Returns allocated clusters by the algorithm. More...
 
def get_medoids (self)
 Returns list of medoids of allocated clusters. More...
 
def get_cluster_encoding (self)
 Returns clustering result representation type that indicate how clusters are encoded. More...
 

Detailed Description

Class represents clustering algorithm CLARANS (a method for clustering objects for spatial data mining).

Definition at line 35 of file clarans.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.cluster.clarans.clarans.__init__ (   self,
  data,
  number_clusters,
  numlocal,
  maxneighbor 
)

Constructor of clustering algorithm CLARANS.

The higher the value of maxneighbor, the closer is CLARANS to K-Medoids (PAM - Partitioning Around Medoids), and the longer is each search of a local minima.

Parameters
[in]data(list): Input data that is presented as list of points (objects), each point should be represented by list or tuple.
[in]number_clusters(uint): amount of clusters that should be allocated.
[in]numlocal(uint): the number of local minima obtained (amount of iterations for solving the problem).
[in]maxneighbor(uint): the maximum number of neighbors examined.

Definition at line 41 of file clarans.py.

Member Function Documentation

◆ get_cluster_encoding()

def pyclustering.cluster.clarans.clarans.get_cluster_encoding (   self)

Returns clustering result representation type that indicate how clusters are encoded.

Returns
(type_encoding) Clustering result representation.
See also
get_clusters()

Definition at line 124 of file clarans.py.

◆ get_clusters()

def pyclustering.cluster.clarans.clarans.get_clusters (   self)

Returns allocated clusters by the algorithm.

Remarks
Allocated clusters can be returned only after data processing (use method process()), otherwise empty list is returned.
Returns
(list) List of allocated clusters, each cluster contains indexes of objects in list of data.
See also
process()
get_medoids()

Definition at line 96 of file clarans.py.

Referenced by pyclustering.samples.answer_reader.get_cluster_lengths(), and pyclustering.cluster.optics.optics.process().

◆ get_medoids()

def pyclustering.cluster.clarans.clarans.get_medoids (   self)

Returns list of medoids of allocated clusters.

See also
process()
get_clusters()

Definition at line 112 of file clarans.py.

◆ process()

def pyclustering.cluster.clarans.clarans.process (   self)

Performs cluster analysis in line with rules of CLARANS algorithm.

See also
get_clusters()
get_medoids()

Definition at line 66 of file clarans.py.


The documentation for this class was generated from the following file: