pyclustering.container.cftree.cftree Class Reference

CF-Tree representation. More...

Public Member Functions

def root (self)
 
def leafes (self)
 
def amount_nodes (self)
 
def amount_entries (self)
 
def height (self)
 
def branch_factor (self)
 
def threshold (self)
 
def max_entries (self)
 
def type_measurement (self)
 
def __init__ (self, branch_factor, max_entries, threshold, type_measurement=measurement_type.CENTROID_EUCLIDEAN_DISTANCE)
 Create CF-tree. More...
 
def get_level_nodes (self, level)
 Traverses CF-tree to obtain nodes at the specified level. More...
 
def insert_cluster (self, cluster)
 Insert cluster that is represented as list of points where each point is represented by list of coordinates. More...
 
def insert (self, entry)
 Insert clustering feature to the tree. More...
 
def find_nearest_leaf (self, entry, search_node=None)
 Search nearest leaf to the specified clustering feature. More...
 
def show_feature_destibution (self, data=None)
 Shows feature distribution. More...
 

Detailed Description

CF-Tree representation.

A CF-tree is a height-balanced tree with two parameters: branching factor and threshold.

Definition at line 756 of file cftree.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.container.cftree.cftree.__init__ (   self,
  branch_factor,
  max_entries,
  threshold,
  type_measurement = measurement_type.CENTROID_EUCLIDEAN_DISTANCE 
)

Create CF-tree.

Parameters
[in]branch_factor(uint): Maximum number of children for non-leaf nodes.
[in]max_entries(uint): Maximum number of entries for leaf nodes.
[in]threshold(double): Maximum diameter of feature clustering for each leaf node.
[in]type_measurement(measurement_type): Measurement type that is used for calculation distance metrics.

Definition at line 845 of file cftree.py.

Member Function Documentation

◆ amount_entries()

def pyclustering.container.cftree.cftree.amount_entries (   self)
Returns
(uint) Number of entries in the tree.

Definition at line 791 of file cftree.py.

◆ amount_nodes()

def pyclustering.container.cftree.cftree.amount_nodes (   self)
Returns
(unit) Number of nodes (leaf and non-leaf) in the tree.

Definition at line 782 of file cftree.py.

◆ branch_factor()

def pyclustering.container.cftree.cftree.branch_factor (   self)
Returns
(uint) Branching factor of the tree.

Branching factor defines maximum number of successors in each non-leaf node.

Definition at line 809 of file cftree.py.

◆ find_nearest_leaf()

def pyclustering.container.cftree.cftree.find_nearest_leaf (   self,
  entry,
  search_node = None 
)

Search nearest leaf to the specified clustering feature.

Parameters
[in]entry(cfentry): Clustering feature.
[in]search_node(cfnode): Node from that searching should be started, if None then search process will be started for the root.
Returns
(leaf_node) Nearest node to the specified clustering feature.

Definition at line 953 of file cftree.py.

Referenced by pyclustering.container.cftree.cftree.find_nearest_leaf().

◆ get_level_nodes()

def pyclustering.container.cftree.cftree.get_level_nodes (   self,
  level 
)

Traverses CF-tree to obtain nodes at the specified level.

Parameters
[in]level(uint): CF-tree level from that nodes should be returned.
Returns
(list) List of CF-nodes that are located on the specified level of the CF-tree.

Definition at line 875 of file cftree.py.

Referenced by pyclustering.container.cftree.cftree.show_feature_destibution().

◆ height()

def pyclustering.container.cftree.cftree.height (   self)
Returns
(uint) Height of the tree.

Definition at line 800 of file cftree.py.

Referenced by pyclustering.container.cftree.cftree.show_feature_destibution().

◆ insert()

def pyclustering.container.cftree.cftree.insert (   self,
  entry 
)

Insert clustering feature to the tree.

Parameters
[in]entry(cfentry): Clustering feature that should be inserted.

Definition at line 927 of file cftree.py.

Referenced by pyclustering.container.kdtree.kdtree.find_minimal_node(), and pyclustering.container.cftree.cftree.insert_cluster().

◆ insert_cluster()

def pyclustering.container.cftree.cftree.insert_cluster (   self,
  cluster 
)

Insert cluster that is represented as list of points where each point is represented by list of coordinates.

Clustering feature is created for that cluster and inserted to the tree.

Parameters
[in]cluster(list): Cluster that is represented by list of points that should be inserted to the tree.

Definition at line 914 of file cftree.py.

◆ leafes()

def pyclustering.container.cftree.cftree.leafes (   self)
Returns
(list) List of all non-leaf nodes in the tree.

Definition at line 773 of file cftree.py.

◆ max_entries()

def pyclustering.container.cftree.cftree.max_entries (   self)
Returns
(uint) Maximum number of entries in each leaf node.

Definition at line 828 of file cftree.py.

◆ root()

def pyclustering.container.cftree.cftree.root (   self)
Returns
(cfnode) Root of the tree.

Definition at line 764 of file cftree.py.

◆ show_feature_destibution()

def pyclustering.container.cftree.cftree.show_feature_destibution (   self,
  data = None 
)

Shows feature distribution.

Only features in 1D, 2D, 3D space can be visualized.

Parameters
[in]data(list): List of points that will be used for visualization, if it not specified than feature will be displayed only.

Definition at line 1213 of file cftree.py.

◆ threshold()

def pyclustering.container.cftree.cftree.threshold (   self)
Returns
(double) Threshold of the tree that represents maximum diameter of sub-clusters that is formed by leaf node entries.

Definition at line 819 of file cftree.py.

◆ type_measurement()

def pyclustering.container.cftree.cftree.type_measurement (   self)
Returns
(measurement_type) Type that is used for measuring.

Definition at line 837 of file cftree.py.


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