pyclustering.cluster.kmeans.kmeans_observer Class Reference

Observer of K-Means algorithm that is used to collect information about clustering process on each iteration of the algorithm. More...

Public Member Functions

def __init__ (self)
 Initializer of observer of K-Means algorithm.
 
def __len__ (self)
 Returns amount of steps that were observer during clustering process in K-Means algorithm.
 
def notify (self, clusters, centers)
 This method is called by K-Means algorithm to notify about changes. More...
 
def set_evolution_centers (self, evolution_centers)
 Set evolution of changes of centers during clustering process. More...
 
def get_centers (self, iteration)
 Get method to return centers at specific iteration of clustering process. More...
 
def set_evolution_clusters (self, evolution_clusters)
 Set evolution of changes of centers during clustering process. More...
 
def get_clusters (self, iteration)
 Get method to return allocated clusters at specific iteration of clustering process. More...
 

Detailed Description

Observer of K-Means algorithm that is used to collect information about clustering process on each iteration of the algorithm.

See also
kmeans

Definition at line 49 of file kmeans.py.

Member Function Documentation

◆ get_centers()

def pyclustering.cluster.kmeans.kmeans_observer.get_centers (   self,
  iteration 
)

Get method to return centers at specific iteration of clustering process.

Parameters
[in]iteration(uint): Clustering process iteration at which centers are required.
Returns
(array_like) Centers at specific iteration.

Definition at line 97 of file kmeans.py.

◆ get_clusters()

def pyclustering.cluster.kmeans.kmeans_observer.get_clusters (   self,
  iteration 
)

Get method to return allocated clusters at specific iteration of clustering process.

Parameters
[in]iteration(uint): Clustering process iteration at which clusters are required.
Returns
(array_like) Clusters at specific iteration.

Definition at line 119 of file kmeans.py.

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

◆ notify()

def pyclustering.cluster.kmeans.kmeans_observer.notify (   self,
  clusters,
  centers 
)

This method is called by K-Means algorithm to notify about changes.

Parameters
[in]clusters(array_like): Allocated clusters by K-Means algorithm.
[in]centers(array_like): Allocated centers by K-Means algorithm.

Definition at line 75 of file kmeans.py.

◆ set_evolution_centers()

def pyclustering.cluster.kmeans.kmeans_observer.set_evolution_centers (   self,
  evolution_centers 
)

Set evolution of changes of centers during clustering process.

Parameters
[in]evolution_centers(array_like): Evolution of changes of centers during clustering process.

Definition at line 87 of file kmeans.py.

◆ set_evolution_clusters()

def pyclustering.cluster.kmeans.kmeans_observer.set_evolution_clusters (   self,
  evolution_clusters 
)

Set evolution of changes of centers during clustering process.

Parameters
[in]evolution_clusters(array_like): Evolution of changes of clusters during clustering process.

Definition at line 109 of file kmeans.py.


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