pyclustering.cluster.clique.clique_block Class Reference

CLIQUE block contains information about its logical location in grid, spatial location in data space and points that are covered by the block. More...

Public Member Functions

def __init__ (self, logical_location=None, spatial_location=None, points=None, visited=False)
 Initializes CLIQUE block. More...
 
def __str__ (self)
 Returns string representation of the block using its logical location in CLIQUE grid.
 
def __repr__ (self)
 Returns string representation of the block using its logical location in CLIQUE grid.
 
def logical_location (self)
 Logical location is represented by coordinates in CLIQUE grid, for example, in case of 2x2 grid blocks may have following coordinates: [0, 0], [0, 1], [1, 0], [1, 1]. More...
 
def logical_location (self, location)
 Assign logical location to CLIQUE block. More...
 
def spatial_location (self)
 Spatial location is represented by real data space coordinates. More...
 
def spatial_location (self, location)
 Assign spatial location to CLIQUE block. More...
 
def dimensions (self)
 Amount of dimensions where CLIQUE block is located. More...
 
def points (self)
 Points that belong to the CLIQUE block. More...
 
def visited (self)
 Defines whether block is visited during cluster analysis. More...
 
def visited (self, visited)
 Marks or unmarks block as a visited. More...
 
def capture_points (self, data, point_availability)
 Finds points that belong to this block using availability map to reduce computational complexity by checking whether the point belongs to the block. More...
 
def get_location_neighbors (self, edge)
 Forms list of logical location of each neighbor for this particular CLIQUE block. More...
 

Detailed Description

CLIQUE block contains information about its logical location in grid, spatial location in data space and points that are covered by the block.

Definition at line 228 of file clique.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.cluster.clique.clique_block.__init__ (   self,
  logical_location = None,
  spatial_location = None,
  points = None,
  visited = False 
)

Initializes CLIQUE block.

Parameters
[in]logical_location(list): Logical location of the block in CLIQUE grid.
[in]spatial_location(spatial_block): Spatial location in data space.
[in]points(array_like): Points that belong to this block (can be obtained by method 'capture_points', this parameter is used by CLIQUE in case of processing by C++ implementation when clustering result are passed back to Python code.
[in]visited(bool): Marks if block is visited during clustering process.

Definition at line 235 of file clique.py.

Member Function Documentation

◆ capture_points()

def pyclustering.cluster.clique.clique_block.capture_points (   self,
  data,
  point_availability 
)

Finds points that belong to this block using availability map to reduce computational complexity by checking whether the point belongs to the block.

Algorithm complexity of this method is O(n).

Parameters
[in]data(array_like): Data where points are represented as coordinates.
[in]point_availability(array_like): Contains boolean values that denote whether point is already belong to another CLIQUE block.

Definition at line 350 of file clique.py.

◆ dimensions()

def pyclustering.cluster.clique.clique_block.dimensions (   self)

Amount of dimensions where CLIQUE block is located.

Returns
(uint) Amount of dimensions where CLIQUE block is located.

Definition at line 306 of file clique.py.

◆ get_location_neighbors()

def pyclustering.cluster.clique.clique_block.get_location_neighbors (   self,
  edge 
)

Forms list of logical location of each neighbor for this particular CLIQUE block.

Parameters
[in]edge(uint): Amount of intervals in each dimension that is used for clustering process.
Returns
(list) Logical location of each neighbor for this particular CLIQUE block.

Definition at line 367 of file clique.py.

◆ logical_location() [1/2]

def pyclustering.cluster.clique.clique_block.logical_location (   self)

Logical location is represented by coordinates in CLIQUE grid, for example, in case of 2x2 grid blocks may have following coordinates: [0, 0], [0, 1], [1, 0], [1, 1].

Returns
(list) Logical location of the block in CLIQUE grid.

Definition at line 267 of file clique.py.

Referenced by pyclustering.cluster.clique.clique_block.logical_location().

◆ logical_location() [2/2]

def pyclustering.cluster.clique.clique_block.logical_location (   self,
  location 
)

Assign logical location to CLIQUE block.

Parameters
[in]location(list): New logical location of the block in CLIQUE grid.

Definition at line 277 of file clique.py.

◆ points()

def pyclustering.cluster.clique.clique_block.points (   self)

Points that belong to the CLIQUE block.

Points are represented by indexes that correspond to points in input data space.

Returns
(array_like) Points that belong to the CLIQUE block.
See also
capture_points

Definition at line 315 of file clique.py.

◆ spatial_location() [1/2]

def pyclustering.cluster.clique.clique_block.spatial_location (   self)

Spatial location is represented by real data space coordinates.

Returns
(spatial_block) Spatial block that describes location in data space.

Definition at line 287 of file clique.py.

Referenced by pyclustering.cluster.clique.clique_block.spatial_location().

◆ spatial_location() [2/2]

def pyclustering.cluster.clique.clique_block.spatial_location (   self,
  location 
)

Assign spatial location to CLIQUE block.

Parameters
[in]location(spatial_block): New spatial location of the block.

Definition at line 296 of file clique.py.

◆ visited() [1/2]

def pyclustering.cluster.clique.clique_block.visited (   self)

Defines whether block is visited during cluster analysis.

If cluster analysis has not been performed then value will False.

Returns
(bool) True if block has been visited during processing, False otherwise.

Definition at line 328 of file clique.py.

Referenced by pyclustering.cluster.clique.clique_block.visited().

◆ visited() [2/2]

def pyclustering.cluster.clique.clique_block.visited (   self,
  visited 
)

Marks or unmarks block as a visited.

This setter is used by CLIQUE algorithm.

Parameters
[in]visited(bool): New visited state for the CLIQUE block.

Definition at line 339 of file clique.py.


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