pyclustering
0.10.1
pyclustring is a Python, C++ data mining library.

Represents selforganized feature map (SOM). More...
Public Member Functions  
def  size (self) 
Return size of selforganized map that is defined by total number of neurons. More...  
def  weights (self) 
Return weight of each neuron. More...  
def  awards (self) 
Return amount of captured objects by each neuron after training. More...  
def  capture_objects (self) 
Returns indexes of captured objects by each neuron. More...  
def  __init__ (self, rows, cols, conn_type=type_conn.grid_eight, parameters=None, ccore=True) 
Constructor of selforganized map. More...  
def  __del__ (self) 
Destructor of the selforganized feature map.  
def  __len__ (self) 
Returns size of the network that defines by amount of neuron in it. More...  
def  __getstate__ (self) 
def  __setstate__ (self, som_state) 
def  train (self, data, epochs, autostop=False) 
Trains selforganized feature map (SOM). More...  
def  simulate (self, input_pattern) 
Processes input pattern (no learining) and returns index of neuronwinner. More...  
def  get_winner_number (self) 
Calculates number of winner at the last step of learning process. More...  
def  show_distance_matrix (self) 
Shows gray visualization of Umatrix (distance matrix). More...  
def  get_distance_matrix (self) 
Calculates distance matrix (Umatrix). More...  
def  show_density_matrix (self, surface_divider=20.0) 
Show density matrix (Pmatrix) using kernel density estimation. More...  
def  get_density_matrix (self, surface_divider=20.0) 
Calculates density matrix (PMatrix). More...  
def  show_winner_matrix (self) 
Show a winner matrix where each element corresponds to neuron and value represents amount of won objects from input dataspace at the last training iteration. More...  
def  show_network (self, awards=False, belongs=False, coupling=True, dataset=True, marker_type='o') 
Shows neurons in the dimension of data. More...  
Represents selforganized feature map (SOM).
The selforganizing feature map (SOM) method is a powerful tool for the visualization of of highdimensional data. It converts complex, nonlinear statistical relationships between highdimensional data into simple geometric relationships on a lowdimensional display.
ccore
option can be specified in order to control using C++ implementation of pyclustering library. By default C++ implementation is on. C++ implementation improves performance of the selforganized feature map.
Example:
There is a visualization of 'Target' sample that was done by the selforganized feature map:
def pyclustering.nnet.som.som.__init__  (  self,  
rows,  
cols,  
conn_type = type_conn.grid_eight , 

parameters = None , 

ccore = True 

) 
Constructor of selforganized map.
[in]  rows  (uint): Number of neurons in the column (number of rows). 
[in]  cols  (uint): Number of neurons in the row (number of columns). 
[in]  conn_type  (type_conn): Type of connection between oscillators in the network (grid four, grid eight, honeycomb, function neighbour). 
[in]  parameters  (som_parameters): Other specific parameters. 
[in]  ccore  (bool): If True simulation is performed by CCORE library (C++ implementation of pyclustering). 
def pyclustering.nnet.som.som.__getstate__  (  self  ) 
def pyclustering.nnet.som.som.__len__  (  self  ) 
def pyclustering.nnet.som.som.__setstate__  (  self,  
som_state  
) 
def pyclustering.nnet.som.som.awards  (  self  ) 
def pyclustering.nnet.som.som.capture_objects  (  self  ) 
Returns indexes of captured objects by each neuron.
For example, a network with size 2x2 has been trained on a sample with five objects. Suppose neuron #1 won an object with index 1
, neuron #2 won objects 0
, 3
, 4
, neuron #3 did not won anything and finally neuron #4 won an object with index 2
. Thus, for this example we will have the following output [[1], [0, 3, 4], [], [2]]
.
def pyclustering.nnet.som.som.get_density_matrix  (  self,  
surface_divider = 20.0 

) 
Calculates density matrix (PMatrix).
[in]  surface_divider  (double): Divider in each dimension that affect radius for density measurement. 
Definition at line 767 of file som.py.
Referenced by pyclustering.nnet.som.som.show_density_matrix().
def pyclustering.nnet.som.som.get_distance_matrix  (  self  ) 
Calculates distance matrix (Umatrix).
The UMatrix visualizes based on the distance in input space between a weight vector and its neighbors on map.
Definition at line 717 of file som.py.
Referenced by pyclustering.nnet.som.som.show_distance_matrix().
def pyclustering.nnet.som.som.get_winner_number  (  self  ) 
def pyclustering.nnet.som.som.show_density_matrix  (  self,  
surface_divider = 20.0 

) 
Show density matrix (Pmatrix) using kernel density estimation.
[in]  surface_divider  (double): Divider in each dimension that affect radius for density measurement. 
def pyclustering.nnet.som.som.show_distance_matrix  (  self  ) 
Shows gray visualization of Umatrix (distance matrix).
def pyclustering.nnet.som.som.show_network  (  self,  
awards = False , 

belongs = False , 

coupling = True , 

dataset = True , 

marker_type = 'o' 

) 
Shows neurons in the dimension of data.
[in]  awards  (bool): If True  displays how many objects won each neuron. 
[in]  belongs  (bool): If True  marks each won object by according index of neuronwinner (only when dataset is displayed too). 
[in]  coupling  (bool): If True  displays connections between neurons (except case when function neighbor is used). 
[in]  dataset  (bool): If True  displays inputs data set. 
[in]  marker_type  (string): Defines marker that is used to denote neurons on the plot. 
def pyclustering.nnet.som.som.show_winner_matrix  (  self  ) 
Show a winner matrix where each element corresponds to neuron and value represents amount of won objects from input dataspace at the last training iteration.
def pyclustering.nnet.som.som.simulate  (  self,  
input_pattern  
) 
Processes input pattern (no learining) and returns index of neuronwinner.
Using index of neuron winner catched object can be obtained using property capture_objects.
[in]  input_pattern  (list): Input pattern. 
def pyclustering.nnet.som.som.size  (  self  ) 
def pyclustering.nnet.som.som.train  (  self,  
data,  
epochs,  
autostop = False 

) 
Trains selforganized feature map (SOM).
[in]  data  (list): Input data  list of points where each point is represented by list of features, for example coordinates. 
[in]  epochs  (uint): Number of epochs for training. 
[in]  autostop  (bool): Automatic termination of learning process when adaptation is not occurred. 
def pyclustering.nnet.som.som.weights  (  self  ) 