pyclustering.cluster.dbscan.dbscan Class Reference

Class represents clustering algorithm DBSCAN. More...

Public Member Functions

def __init__ (self, data, eps, neighbors, ccore=True, kwargs)
 Constructor of clustering algorithm DBSCAN. More...
 
def process (self)
 Performs cluster analysis in line with rules of DBSCAN algorithm. More...
 
def get_clusters (self)
 Returns allocated clusters. More...
 
def get_noise (self)
 Returns allocated noise. More...
 
def get_cluster_encoding (self)
 Returns clustering result representation type that indicate how clusters are encoded. More...
 

Detailed Description

Class represents clustering algorithm DBSCAN.

This DBSCAN algorithm is KD-tree optimized.

     CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.

Example:

# sample for cluster analysis (represented by list)
sample = read_sample(path_to_sample);
# create object that uses CCORE for processing
dbscan_instance = dbscan(sample, 0.5, 3, True);
# cluster analysis
dbscan_instance.process();
# obtain results of clustering
clusters = dbscan_instance.get_clusters();
noise = dbscan_instance.get_noise();

Definition at line 37 of file dbscan.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.cluster.dbscan.dbscan.__init__ (   self,
  data,
  eps,
  neighbors,
  ccore = True,
  kwargs 
)

Constructor of clustering algorithm DBSCAN.

Parameters
[in]data(list): Input data that is presented as list of points (objects), each point should be represented by list or tuple.
[in]eps(double): Connectivity radius between points, points may be connected if distance between them less then the radius.
[in]neighbors(uint): minimum number of shared neighbors that is required for establish links between points.
[in]ccore(bool): if True than DLL CCORE (C++ solution) will be used for solving the problem.
[in]**kwargsArbitrary keyword arguments (available arguments: 'data_type').

Keyword Args:

  • data_type (string): Data type of input sample 'data' that is processed by the algorithm ('points', 'distance_matrix').

Definition at line 62 of file dbscan.py.

Member Function Documentation

◆ get_cluster_encoding()

def pyclustering.cluster.dbscan.dbscan.get_cluster_encoding (   self)

Returns clustering result representation type that indicate how clusters are encoded.

Returns
(type_encoding) Clustering result representation.
See also
get_clusters()

Definition at line 157 of file dbscan.py.

◆ get_clusters()

def pyclustering.cluster.dbscan.dbscan.get_clusters (   self)

Returns allocated clusters.

Remarks
Allocated clusters can be returned only after data processing (use method process()). Otherwise empty list is returned.
Returns
(list) List of allocated clusters, each cluster contains indexes of objects in list of data.
See also
process()
get_noise()

Definition at line 125 of file dbscan.py.

Referenced by pyclustering.samples.answer_reader.get_cluster_lengths(), and pyclustering.cluster.optics.optics.process().

◆ get_noise()

def pyclustering.cluster.dbscan.dbscan.get_noise (   self)

Returns allocated noise.

Remarks
Allocated noise can be returned only after data processing (use method process() before). Otherwise empty list is returned.
Returns
(list) List of indexes that are marked as a noise.
See also
process()
get_clusters()

Definition at line 141 of file dbscan.py.

◆ process()

def pyclustering.cluster.dbscan.dbscan.process (   self)

Performs cluster analysis in line with rules of DBSCAN algorithm.

See also
get_clusters()
get_noise()

Definition at line 98 of file dbscan.py.


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