pyclustering.cluster.bang.bang_block Class Reference

BANG-block that represent spatial region in data space. More...

Public Member Functions

def __init__ (self, data, region, level, space_block, cache_points=False)
 Create BANG-block. More...
 
def __str__ (self)
 Returns string representation of BANG-block using region number and level where block is located.
 
def __len__ (self)
 Returns block size defined by amount of points that are contained by this block.
 
def get_region (self)
 Returns region number of BANG-block. More...
 
def get_density (self)
 Returns density of the BANG-block. More...
 
def get_cluster (self)
 Return index of cluster to which the BANG-block belongs to. More...
 
def get_spatial_block (self)
 Return spatial block - BANG-block description in data space. More...
 
def get_points (self)
 Return points that covers by the BANG-block. More...
 
def set_cluster (self, index)
 Assign cluster to the BANG-block by index. More...
 
def is_neighbor (self, block)
 Performs calculation to check whether specified block is neighbor to the current. More...
 
def split (self, split_dimension, cache_points)
 Split BANG-block into two new blocks in specified dimension. More...
 

Detailed Description

BANG-block that represent spatial region in data space.

Definition at line 752 of file bang.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.cluster.bang.bang_block.__init__ (   self,
  data,
  region,
  level,
  space_block,
  cache_points = False 
)

Create BANG-block.

Parameters
[in]data(list): List of points that are processed.
[in]region(uint): Region number - unique value on a level.
[in]level(uint): Level number where block is created.
[in]space_block(spatial_block): Spatial block description in data space.
[in]cache_points(bool): if True then points are stored in memory (used for leaf blocks).

Definition at line 757 of file bang.py.

Member Function Documentation

◆ get_cluster()

def pyclustering.cluster.bang.bang_block.get_cluster (   self)

Return index of cluster to which the BANG-block belongs to.

Index of cluster may have None value if the block was not assigned to any cluster.

Returns
(uint) Index of cluster or None if the block does not belong to any cluster.

Definition at line 818 of file bang.py.

◆ get_density()

def pyclustering.cluster.bang.bang_block.get_density (   self)

Returns density of the BANG-block.

Returns
(double) BANG-block density.

Definition at line 808 of file bang.py.

◆ get_points()

def pyclustering.cluster.bang.bang_block.get_points (   self)

Return points that covers by the BANG-block.

Returns
(list) List of point indexes that are covered by the block.

Definition at line 839 of file bang.py.

◆ get_region()

def pyclustering.cluster.bang.bang_block.get_region (   self)

Returns region number of BANG-block.

Region number is unique on among region numbers on a directory level. Pair of region number and level is unique for all directory.

Returns
(uint) Region number.

Definition at line 796 of file bang.py.

◆ get_spatial_block()

def pyclustering.cluster.bang.bang_block.get_spatial_block (   self)

Return spatial block - BANG-block description in data space.

Returns
(spatial_block) Spatial block of the BANG-block.

Definition at line 829 of file bang.py.

Referenced by pyclustering.cluster.bang.bang_block.is_neighbor().

◆ is_neighbor()

def pyclustering.cluster.bang.bang_block.is_neighbor (   self,
  block 
)

Performs calculation to check whether specified block is neighbor to the current.

Parameters
[in]block(bang_block): Other BANG-block that should be checked for neighborhood.
Returns
(bool) True if blocks are neighbors, False if blocks are not neighbors.

Definition at line 862 of file bang.py.

◆ set_cluster()

def pyclustering.cluster.bang.bang_block.set_cluster (   self,
  index 
)

Assign cluster to the BANG-block by index.

Parameters
[in]index(uint): Index cluster that is assigned to BANG-block.

Definition at line 852 of file bang.py.

◆ split()

def pyclustering.cluster.bang.bang_block.split (   self,
  split_dimension,
  cache_points 
)

Split BANG-block into two new blocks in specified dimension.

Parameters
[in]split_dimension(uint): Dimension where block should be split.
[in]cache_points(bool): If True then covered points are cached. Used for leaf blocks.
Returns
(tuple) Pair of BANG-block that were formed from the current.

Definition at line 874 of file bang.py.


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