pyclustering.container.cftree.cfentry Class Reference

Clustering feature representation. More...

Public Member Functions

def number_points (self)
 Returns number of points that are encoded. More...
 
def linear_sum (self)
 Returns linear sum. More...
 
def square_sum (self)
 Returns square sum. More...
 
def __init__ (self, number_points, linear_sum, square_sum)
 CF-entry constructor. More...
 
def __copy__ (self)
 
def __repr__ (self)
 
def __str__ (self)
 Default cfentry string representation.
 
def __add__ (self, entry)
 Overloaded operator add. More...
 
def __sub__ (self, entry)
 Overloaded operator sub. More...
 
def __eq__ (self, entry)
 Overloaded operator eq. More...
 
def get_distance (self, entry, type_measurement)
 Calculates distance between two clusters in line with measurement type. More...
 
def get_centroid (self)
 Calculates centroid of cluster that is represented by the entry. More...
 
def get_radius (self)
 Calculates radius of cluster that is represented by the entry. More...
 
def get_diameter (self)
 Calculates diameter of cluster that is represented by the entry. More...
 

Detailed Description

Clustering feature representation.

See also
cfnode
cftree

Definition at line 82 of file cftree.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.container.cftree.cfentry.__init__ (   self,
  number_points,
  linear_sum,
  square_sum 
)

CF-entry constructor.

Parameters
[in]number_points(uint): Number of objects that is represented by the entry.
[in]linear_sum(list): Linear sum of values that represent objects in each dimension.
[in]square_sum(double): Square sum of values that represent objects.

Definition at line 123 of file cftree.py.

Member Function Documentation

◆ __add__()

def pyclustering.container.cftree.cfentry.__add__ (   self,
  entry 
)

Overloaded operator add.

Performs addition of two clustering features.

Parameters
[in]entry(cfentry): Entry that is added to the current.
Returns
(cfentry) Result of addition of two clustering features.

Definition at line 166 of file cftree.py.

◆ __copy__()

def pyclustering.container.cftree.cfentry.__copy__ (   self)
Returns
(cfentry) Makes copy of the cfentry instance.

Definition at line 142 of file cftree.py.

◆ __eq__()

def pyclustering.container.cftree.cfentry.__eq__ (   self,
  entry 
)

Overloaded operator eq.

Performs comparison of two clustering features.

Parameters
[in]entry(cfentry): Entry that is used for comparison with current.
Returns
(bool) True is both clustering features are equals in line with tolerance, otherwise False.

Definition at line 204 of file cftree.py.

◆ __repr__()

def pyclustering.container.cftree.cfentry.__repr__ (   self)

◆ __sub__()

def pyclustering.container.cftree.cfentry.__sub__ (   self,
  entry 
)

Overloaded operator sub.

Performs substraction of two clustering features.

Substraction can't be performed with clustering feature whose description is less then substractor.

Parameters
[in]entry(cfentry): Entry that is substracted from the current.
Returns
(cfentry) Result of substraction of two clustering features.

Definition at line 183 of file cftree.py.

◆ get_centroid()

def pyclustering.container.cftree.cfentry.get_centroid (   self)

Calculates centroid of cluster that is represented by the entry.

It's calculated once when it's requested after the last changes.

Returns
(list) Centroid of cluster that is represented by the entry.

Definition at line 260 of file cftree.py.

Referenced by pyclustering.container.cftree.cfentry.get_distance(), and pyclustering.container.cftree.cfentry.get_radius().

◆ get_diameter()

def pyclustering.container.cftree.cfentry.get_diameter (   self)

Calculates diameter of cluster that is represented by the entry.

It's calculated once when it's requested after the last changes.

Returns
(double) Diameter of cluster that is represented by the entry.

Definition at line 306 of file cftree.py.

◆ get_distance()

def pyclustering.container.cftree.cfentry.get_distance (   self,
  entry,
  type_measurement 
)

Calculates distance between two clusters in line with measurement type.

In case of usage CENTROID_EUCLIDIAN_DISTANCE square euclidian distance will be returned. Square root should be taken from the result for obtaining real euclidian distance between entries.

Parameters
[in]entry(cfentry): Clustering feature to which distance should be obtained.
[in]type_measurement(measurement_type): Distance measurement algorithm between two clusters.
Returns
(double) Distance between two clusters.

Definition at line 226 of file cftree.py.

◆ get_radius()

def pyclustering.container.cftree.cfentry.get_radius (   self)

Calculates radius of cluster that is represented by the entry.

It's calculated once when it's requested after the last changes.

Returns
(double) Radius of cluster that is represented by the entry.

Definition at line 279 of file cftree.py.

◆ linear_sum()

◆ number_points()

def pyclustering.container.cftree.cfentry.number_points (   self)

◆ square_sum()

def pyclustering.container.cftree.cfentry.square_sum (   self)

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