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

Provides service for creating 2-D animation using BANG clustering results. More...

Public Member Functions

def __init__ (self, directory, clusters)
 Creates BANG animator instance. More...
 
def animate (self, animation_velocity=75, movie_fps=25, movie_filename=None)
 Animates clustering process that is performed by BANG algorithm. More...
 

Detailed Description

Provides service for creating 2-D animation using BANG clustering results.

The animator does not support visualization of clustering process where non 2-dimensional was used.

Code example of animation of BANG clustering process:

from pyclustering.cluster.bang import bang, bang_animator
from pyclustering.utils import read_sample
from pyclustering.samples.definitions import FCPS_SAMPLES
# Read data two dimensional data.
data = read_sample(FCPS_SAMPLES.SAMPLE_LSUN)
# Create instance of BANG algorithm.
bang_instance = bang(data, 9)
bang_instance.process()
# Obtain clustering results.
clusters = bang_instance.get_clusters()
noise = bang_instance.get_noise()
directory = bang_instance.get_directory()
# Create BANG animation using class 'bang_animator':
animator = bang_animator(directory, clusters)
animator.animate()

Definition at line 204 of file bang.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.cluster.bang.bang_animator.__init__ (   self,
  directory,
  clusters 
)

Creates BANG animator instance.

Parameters
[in]directory(bang_directory): BANG directory that was formed during BANG clustering process.
[in]clusters(list): Allocated clusters during BANG clustering process.

Definition at line 233 of file bang.py.

Member Function Documentation

◆ animate()

def pyclustering.cluster.bang.bang_animator.animate (   self,
  animation_velocity = 75,
  movie_fps = 25,
  movie_filename = None 
)

Animates clustering process that is performed by BANG algorithm.

Parameters
[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]movie_filename(string): If it is specified then animation will be stored to file that is specified in this parameter.

Definition at line 337 of file bang.py.


The documentation for this class was generated from the following file:
pyclustering.cluster.bang
Cluster analysis algorithm: BANG.
Definition: bang.py:1
pyclustering.utils
Utils that are used by modules of pyclustering.
Definition: __init__.py:1
pyclustering.utils.read_sample
def read_sample(filename)
Returns data sample from simple text file.
Definition: __init__.py:30