pyclustering  0.10.1
pyclustring is a Python, C++ data mining library.
pyclustering.cluster.kmeans.kmeans_visualizer Class Reference

Visualizer of K-Means algorithm's results. More...

Static Public Member Functions

def show_clusters (sample, clusters, centers, initial_centers=None, **kwargs)
 Display K-Means clustering results. More...
 
def animate_cluster_allocation (data, observer, animation_velocity=500, movie_fps=1, save_movie=None)
 Animates clustering process that is performed by K-Means algorithm. More...
 

Detailed Description

Visualizer of K-Means algorithm's results.

K-Means visualizer provides visualization services that are specific for K-Means algorithm.

Definition at line 113 of file kmeans.py.

Member Function Documentation

◆ animate_cluster_allocation()

def pyclustering.cluster.kmeans.kmeans_visualizer.animate_cluster_allocation (   data,
  observer,
  animation_velocity = 500,
  movie_fps = 1,
  save_movie = None 
)
static

Animates clustering process that is performed by K-Means algorithm.

Parameters
[in]data(list): Dataset that is used for clustering.
[in]observer(kmeans_observer): EM observer that was used for collection information about clustering process.
[in]animation_velocity(uint): Interval between frames in milliseconds (for run-time animation only).
[in]movie_fps(uint): Defines frames per second (for rendering movie only).
[in]save_movie(string): If it is specified then animation will be stored to file that is specified in this parameter.

Definition at line 213 of file kmeans.py.

◆ show_clusters()

def pyclustering.cluster.kmeans.kmeans_visualizer.show_clusters (   sample,
  clusters,
  centers,
  initial_centers = None,
**  kwargs 
)
static

Display K-Means clustering results.

Parameters
[in]sample(list): Dataset that was used for clustering.
[in]clusters(array_like): Clusters that were allocated by the algorithm.
[in]centers(array_like): Centers that were allocated by the algorithm.
[in]initial_centers(array_like): Initial centers that were used by the algorithm, if 'None' then initial centers are not displyed.
[in]**kwargsArbitrary keyword arguments (available arguments: 'figure', 'display', 'offset').

Keyword Args:

  • figure (figure): If 'None' then new is figure is created, otherwise specified figure is used for visualization.
  • display (bool): If 'True' then figure will be shown by the method, otherwise it should be shown manually using matplotlib function 'plt.show()'.
  • offset (uint): Specify axes index on the figure where results should be drawn (only if argument 'figure' is specified).
Returns
(figure) Figure where clusters were drawn.

Definition at line 125 of file kmeans.py.


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