Skip to content

Commit

Permalink
[docs] Update documentation examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
annoviko committed Apr 18, 2019
1 parent fd9117e commit 98aa0dd
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 55 deletions.
2 changes: 0 additions & 2 deletions pyclustering/cluster/agglomerative.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class agglomerative:
@brief Class represents agglomerative algorithm for cluster analysis.
@details Agglomerative algorithm considers each data point (object) as a separate cluster at the beggining and
step by step finds the best pair of clusters for merge until required amount of clusters is obtained.
CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
Example of agglomerative algorithm where centroid link is used:
@code
Expand Down
59 changes: 22 additions & 37 deletions pyclustering/cluster/birch.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,29 @@ class birch:
"""!
@brief Class represents clustering algorithm BIRCH.
Example:
Example how to extract clusters from 'OldFaithful' sample using BIRCH algorithm:
@code
# sample for cluster analysis (represented by list)
sample = read_sample(path_to_sample);
# create object of birch that uses CCORE for processing
birch_instance = birch(sample, 2, 5, 5, 0.05, measurement_type.CENTROID_EUCLIDIAN_DISTANCE, 200, True);
# cluster analysis
birch_instance.process();
# obtain results of clustering
clusters = birch_instance.get_clusters();
from pyclustering.cluster.birch import birch, measurement_type
from pyclustering.cluster import cluster_visualizer
from pyclustering.utils import read_sample
from pyclustering.samples.definitions import FAMOUS_SAMPLES
# Sample for cluster analysis (represented by list)
sample = read_sample(FAMOUS_SAMPLES.SAMPLE_OLD_FAITHFUL)
# Create BIRCH algorithm
birch_instance = birch(sample, 2)
# Cluster analysis
birch_instance.process()
# Obtain results of clustering
clusters = birch_instance.get_clusters()
# Visualize allocated clusters
visualizer = cluster_visualizer()
visualizer.append_clusters(clusters, sample)
visualizer.show()
@endcode
"""
Expand All @@ -69,31 +79,6 @@ def __init__(self, data, number_clusters, branching_factor = 5, max_node_entries
@remark Despite eight arguments only the first two is mandatory, others can be ommitted. In this case default values are used for instance creation.
Example how to extract clusters from 'OldFaithful' sample using BIRCH algorithm:
@code
from pyclustering.cluster.birch import birch, measurement_type
from pyclustering.cluster import cluster_visualizer
from pyclustering.utils import read_sample
from pyclustering.samples.definitions import FAMOUS_SAMPLES
# Sample for cluster analysis (represented by list)
sample = read_sample(FAMOUS_SAMPLES.SAMPLE_OLD_FAITHFUL)
# Create BIRCH algorithm
birch_instance = birch(sample, 2)
# Cluster analysis
birch_instance.process()
# Obtain results of clustering
clusters = birch_instance.get_clusters()
# Visualize allocated clusters
visualizer = cluster_visualizer()
visualizer.append_clusters(clusters, sample)
visualizer.show()
@endcode
"""

self.__pointer_data = data;
Expand Down
2 changes: 0 additions & 2 deletions pyclustering/cluster/hsyncnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class hsyncnet(syncnet):
"""!
@brief Class represents clustering algorithm HSyncNet. HSyncNet is bio-inspired algorithm that is based on oscillatory network that uses modified Kuramoto model.
@details CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
Example:
@code
from pyclustering.cluster.hsyncnet import hsyncnet
Expand Down
4 changes: 1 addition & 3 deletions pyclustering/cluster/kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,7 @@ def frame_generation(index_iteration):
class kmeans:
"""!
@brief Class represents K-Means clustering algorithm.
@details CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
CCORE implementation of the algorithm uses thread pool to parallelize the clustering process.
@details CCORE implementation of the algorithm uses thread pool to parallelize the clustering process.
K-Means clustering results depend on initial centers. Algorithm K-Means++ can used for initialization
initial centers from module 'pyclustering.cluster.center_initializer'.
Expand Down
2 changes: 0 additions & 2 deletions pyclustering/cluster/kmedians.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class kmedians:
@brief Class represents clustering algorithm K-Medians.
@details The algorithm is less sensitive to outliers than K-Means. Medians are calculated instead of centroids.
CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
Example:
@code
from pyclustering.cluster.kmedians import kmedians
Expand Down
2 changes: 0 additions & 2 deletions pyclustering/cluster/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,6 @@ class optics:
Clustering-ordering information contains information about internal structures of data set in terms of density and proper connectivity radius can be obtained
for allocation required amount of clusters using this diagram. In case of usage additional input parameter 'amount of clusters' connectivity radius should be
bigger than real - because it will be calculated by the algorithms if requested amount of clusters is not allocated.
CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
@image html optics_example_clustering.png "Scheme how does OPTICS works. At the beginning only one cluster is allocated, but two is requested. At the second step OPTICS calculates connectivity radius using cluster-ordering and performs final cluster allocation."
Expand Down
1 change: 0 additions & 1 deletion pyclustering/cluster/rock.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
class rock:
"""!
@brief Class represents clustering algorithm ROCK.
@details CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
Example:
@code
Expand Down
2 changes: 0 additions & 2 deletions pyclustering/cluster/somsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class somsc:
@brief Class represents simple clustering algorithm based on self-organized feature map.
@details This algorithm uses amount of clusters that should be allocated as a size of SOM map. Captured objects by neurons are clusters.
Algorithm is able to process data with Gaussian distribution that has spherical forms.
CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
Example:
@code
Expand Down
2 changes: 0 additions & 2 deletions pyclustering/cluster/syncnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ class syncnet(sync_network):
@brief Class represents clustering algorithm SyncNet.
@details SyncNet is bio-inspired algorithm that is based on oscillatory network that uses modified Kuramoto model. Each attribute of a data object
is considered as a phase oscillator.
CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
Example:
@code
Expand Down
2 changes: 0 additions & 2 deletions pyclustering/cluster/xmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ class xmeans:
and then dynamically increases them. X-means uses specified splitting criterion to control
the process of splitting clusters. Method K-Means++ can be used for calculation of initial centers.
CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
CCORE implementation of the algorithm uses thread pool to parallelize the clustering process.
Here example how to perform cluster analysis using X-Means algorithm:
Expand Down

0 comments on commit 98aa0dd

Please sign in to comment.