pyclustering.cluster.hsyncnet.hsyncnet Class Reference

Class represents clustering algorithm HSyncNet. More...

+ Inheritance diagram for pyclustering.cluster.hsyncnet.hsyncnet:
+ Collaboration diagram for pyclustering.cluster.hsyncnet.hsyncnet:

Public Member Functions

def __init__ (self, source_data, number_clusters, osc_initial_phases=initial_type.RANDOM_GAUSSIAN, initial_neighbors=3, increase_persent=0.15, ccore=True)
 Costructor of the oscillatory network hSyncNet for cluster analysis. More...
 
def __del__ (self)
 Destructor of oscillatory network HSyncNet.
 
def process (self, order=0.998, solution=solve_type.FAST, collect_dynamic=False)
 Performs clustering of input data set in line with input parameters. More...
 
- Public Member Functions inherited from pyclustering.cluster.syncnet.syncnet
def __init__ (self, sample, radius, conn_repr=conn_represent.MATRIX, initial_phases=initial_type.RANDOM_GAUSSIAN, enable_conn_weight=False, ccore=True)
 Contructor of the oscillatory network SYNC for cluster analysis. More...
 
def __del__ (self)
 Destructor of oscillatory network is based on Kuramoto model.
 
def process (self, order=0.998, solution=solve_type.FAST, collect_dynamic=True)
 Peforms cluster analysis using simulation of the oscillatory network. More...
 
def show_network (self)
 Shows connections in the network. More...
 
- Public Member Functions inherited from pyclustering.nnet.sync.sync_network
def __init__ (self, num_osc, weight=1, frequency=0, type_conn=conn_type.ALL_TO_ALL, representation=conn_represent.MATRIX, initial_phases=initial_type.RANDOM_GAUSSIAN, ccore=True)
 Constructor of oscillatory network is based on Kuramoto model. More...
 
def __del__ (self)
 Destructor of oscillatory network is based on Kuramoto model.
 
def sync_order (self)
 Calculates current level of global synchorization (order parameter) in the network. More...
 
def sync_local_order (self)
 Calculates current level of local (partial) synchronization in the network. More...
 
def simulate (self, steps, time, solution=solve_type.FAST, collect_dynamic=True)
 Performs static simulation of Sync oscillatory network. More...
 
def simulate_dynamic (self, order=0.998, solution=solve_type.FAST, collect_dynamic=False, step=0.1, int_step=0.01, threshold_changes=0.0000001)
 Performs dynamic simulation of the network until stop condition is not reached. More...
 
def simulate_static (self, steps, time, solution=solve_type.FAST, collect_dynamic=False)
 Performs static simulation of oscillatory network. More...
 
def get_neighbors (self, index)
 Finds neighbors of the oscillator with specified index. More...
 
def has_connection (self, i, j)
 Returns True if there is connection between i and j oscillators and False - if connection doesn't exist. More...
 
- Public Member Functions inherited from pyclustering.nnet.network
def height (self)
 Height of the network grid (that is defined by amout of oscillators in each column), this value is zero in case of non-grid structure. More...
 
def width (self)
 Width of the network grid, this value is zero in case of non-grid structure. More...
 
def structure (self)
 Type of network structure that is used for connecting oscillators.
 
def __init__ (self, num_osc, type_conn=conn_type.ALL_TO_ALL, conn_repr=conn_represent.MATRIX, height=None, width=None)
 Constructor of the network. More...
 
def __len__ (self)
 Returns size of the network that is defined by amount of oscillators.
 
def has_connection (self, i, j)
 Returns True if there is connection between i and j oscillators and False - if connection doesn't exist. More...
 
def set_connection (self, i, j)
 Couples two specified oscillators in the network with dynamic connections. More...
 
def get_neighbors (self, index)
 Finds neighbors of the oscillator with specified index. More...
 

Detailed Description

Class represents clustering algorithm HSyncNet.

HSyncNet is bio-inspired algorithm that is based on oscillatory network that uses modified Kuramoto model.

Example:

from pyclustering.cluster.hsyncnet import hsyncnet
from pyclustering.nnet.sync import sync_visualizer
from pyclustering.utils import read_sample, draw_clusters
from pyclustering.samples.definitions import SIMPLE_SAMPLES
# Read list of points for cluster analysis.
sample = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE2)
# Create network for allocation of three clusters.
network = hsyncnet(sample, 3)
# Run cluster analysis and output dynamic of the network.
analyser = network.process(0.995, collect_dynamic=True)
# Get allocated clusters.
clusters = analyser.allocate_clusters(eps=0.1)
# Show output dynamic of the network.
sync_visualizer.show_output_dynamic(analyser)
# Show allocated clusters.
draw_clusters(sample, clusters)

Definition at line 38 of file hsyncnet.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.cluster.hsyncnet.hsyncnet.__init__ (   self,
  source_data,
  number_clusters,
  osc_initial_phases = initial_type.RANDOM_GAUSSIAN,
  initial_neighbors = 3,
  increase_persent = 0.15,
  ccore = True 
)

Costructor of the oscillatory network hSyncNet for cluster analysis.

Parameters
[in]source_data(list): Input data set defines structure of the network.
[in]number_clusters(uint): Number of clusters that should be allocated.
[in]osc_initial_phases(initial_type): Type of initialization of initial values of phases of oscillators.
[in]initial_neighbors(uint): Defines initial connectivity-radius by average distance to connect specified amount of oscillators (points).
[in]increase_persent(double): Percent of increasing of radius connectivity on each iteration (input values in range (0.0; 1.0) correspond to (0%; 100%)).
[in]ccore(bool): If True than DLL CCORE (C++ solution) will be used for solving.

Definition at line 70 of file hsyncnet.py.

Member Function Documentation

◆ process()

def pyclustering.cluster.hsyncnet.hsyncnet.process (   self,
  order = 0.998,
  solution = solve_type.FAST,
  collect_dynamic = False 
)

Performs clustering of input data set in line with input parameters.

Parameters
[in]order(double): Level of local synchronization between oscillator that defines end of synchronization process, range [0..1].
[in]solution(solve_type) Type of solving differential equation.
[in]collect_dynamic(bool): If True - returns whole history of process synchronization otherwise - only final state (when process of clustering is over).
Returns
(tuple) Returns dynamic of the network as tuple of lists on each iteration (time, oscillator_phases) that depends on collect_dynamic parameter.
See also
get_clusters()

Definition at line 109 of file hsyncnet.py.


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