pyclustering  0.10.1
pyclustring is a Python, C++ data mining library.
pyclustering.cluster.cure.cure Class Reference

Class represents clustering algorithm CURE with KD-tree optimization. More...

Public Member Functions

def __init__ (self, data, number_cluster, number_represent_points=5, compression=0.5, ccore=True)
 Constructor of clustering algorithm CURE. More...
 
def process (self)
 Performs cluster analysis in line with rules of CURE algorithm. More...
 
def get_clusters (self)
 Returns list of allocated clusters, each cluster contains indexes of objects in list of data. More...
 
def get_representors (self)
 Returns list of point-representors of each cluster. More...
 
def get_means (self)
 Returns list of mean values of each cluster. More...
 
def get_cluster_encoding (self)
 Returns clustering result representation type that indicate how clusters are encoded. More...
 

Detailed Description

Class represents clustering algorithm CURE with KD-tree optimization.

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

Here is an example how to perform cluster analysis of sample 'Lsun':

from pyclustering.cluster import cluster_visualizer;
from pyclustering.cluster.cure import cure;
from pyclustering.utils import read_sample;
from pyclustering.samples.definitions import FCPS_SAMPLES;
# Input data in following format [ [0.1, 0.5], [0.3, 0.1], ... ].
input_data = read_sample(FCPS_SAMPLES.SAMPLE_LSUN);
# Allocate three clusters.
cure_instance = cure(input_data, 3);
cure_instance.process();
clusters = cure_instance.get_clusters();
# Visualize allocated clusters.
visualizer = cluster_visualizer();
visualizer.append_clusters(clusters, input_data);
visualizer.show();

Definition at line 74 of file cure.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.cluster.cure.cure.__init__ (   self,
  data,
  number_cluster,
  number_represent_points = 5,
  compression = 0.5,
  ccore = True 
)

Constructor of clustering algorithm CURE.

Parameters
[in]data(array_like): Input data that should be processed.
[in]number_cluster(uint): Number of clusters that should be allocated.
[in]number_represent_points(uint): Number of representative points for each cluster.
[in]compression(double): Coefficient defines level of shrinking of representation points toward the mean of the new created cluster after merging on each step. Usually it destributed from 0 to 1.
[in]ccore(bool): If True then CCORE (C++ solution) will be used for solving.

Definition at line 102 of file cure.py.

Member Function Documentation

◆ get_cluster_encoding()

def pyclustering.cluster.cure.cure.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 278 of file cure.py.

◆ get_clusters()

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

Returns list of allocated clusters, each cluster contains indexes of objects in list of data.

Returns
(list) List of allocated clusters.
See also
process()
get_representors()
get_means()

Definition at line 233 of file cure.py.

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

◆ get_means()

def pyclustering.cluster.cure.cure.get_means (   self)

Returns list of mean values of each cluster.

Cluster index should be used for navigation between mean values.

Returns
(list) List of mean values of each cluster.
See also
get_clusters()
get_representors()

Definition at line 263 of file cure.py.

◆ get_representors()

def pyclustering.cluster.cure.cure.get_representors (   self)

Returns list of point-representors of each cluster.

Cluster index should be used for navigation between lists of point-representors.

Returns
(list) List of point-representors of each cluster.
See also
get_clusters()
get_means()

Definition at line 248 of file cure.py.

◆ process()

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

Performs cluster analysis in line with rules of CURE algorithm.

Returns
(cure) Returns itself (CURE instance).
See also
get_clusters()

Definition at line 131 of file cure.py.


The documentation for this class was generated from the following file:
pyclustering.cluster.cure
Cluster analysis algorithm: CURE.
Definition: cure.py:1
pyclustering.cluster
pyclustering module for cluster analysis.
Definition: __init__.py:1
pyclustering.utils
Utils that are used by modules of pyclustering.
Definition: __init__.py:1
pyclustering.utils.read_sample
def read_sample(filename)
Returns data sample from simple text file.
Definition: __init__.py:30