{"id":13419110,"url":"https://github.com/annoviko/pyclustering","last_synced_at":"2025-05-14T18:06:57.012Z","repository":{"id":14472250,"uuid":"17184333","full_name":"annoviko/pyclustering","owner":"annoviko","description":"pyclustering is a Python, C++ data mining library.","archived":false,"fork":false,"pushed_at":"2024-02-25T11:40:08.000Z","size":35059,"stargazers_count":1187,"open_issues_count":78,"forks_count":254,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-05-14T03:28:32.195Z","etag":null,"topics":["algorithms","c-plus-plus","clustering","data-mining","data-science","machine-learning","neural-networks","oscillatory-networks","python","python3"],"latest_commit_sha":null,"homepage":"https://pyclustering.github.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"wmluke/angular-bugsnag","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annoviko.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-02-25T18:59:03.000Z","updated_at":"2025-05-10T13:05:40.000Z","dependencies_parsed_at":"2024-01-18T09:56:58.279Z","dependency_job_id":"27fa7273-0c9c-4647-986d-8891c536a7ca","html_url":"https://github.com/annoviko/pyclustering","commit_stats":{"total_commits":1977,"total_committers":23,"mean_commits":85.95652173913044,"dds":"0.12594840667678298","last_synced_commit":"906532e4a5422479cc6813e852f9c3cb48ea7a64"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annoviko%2Fpyclustering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annoviko%2Fpyclustering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annoviko%2Fpyclustering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annoviko%2Fpyclustering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annoviko","download_url":"https://codeload.github.com/annoviko/pyclustering/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198515,"owners_count":22030966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","c-plus-plus","clustering","data-mining","data-science","machine-learning","neural-networks","oscillatory-networks","python","python3"],"created_at":"2024-07-30T22:01:11.476Z","updated_at":"2025-05-14T18:06:51.997Z","avatar_url":"https://github.com/annoviko.png","language":"Python","readme":"Warning - Attention Users\n=========================\n\n**Please be aware that the `pyclustering` library is no longer supported as of 2021 due to personal reasons. There will be no further maintenance, issue addressing, or feature development for this repository.**\n\n**For continued usage, I recommend seeking alternative solutions.**\n\n**Thank you for your understanding.**\n\n\nBuild Status\n============\n\n|Build Status Linux MacOS| |Build Status Win| |Coverage Status| |PyPi| |Download Counter| |JOSS|\n\n\nPyClustering\n============\n\n**pyclustering** is a Python, C++ data mining library (clustering\nalgorithm, oscillatory networks, neural networks). The library provides\nPython and C++ implementations (C++ pyclustering library) of each algorithm or\nmodel. C++ pyclustering library is a part of pyclustering and supported for\nLinux, Windows and MacOS operating systems.\n\n**Version**: 0.11.dev\n\n**License**: The 3-Clause BSD License\n\n**E-Mail**: pyclustering@yandex.ru\n\n**Documentation**: https://pyclustering.github.io/docs/0.10.1/html/\n\n**Homepage**: https://pyclustering.github.io/\n\n**PyClustering Wiki**: https://github.com/annoviko/pyclustering/wiki\n\n\n\nDependencies\n============\n\n**Required packages**: scipy, matplotlib, numpy, Pillow\n\n**Python version**: \u003e=3.6 (32-bit, 64-bit)\n\n**C++ version**: \u003e= 14 (32-bit, 64-bit)\n\n\n\nPerformance\n===========\n\nEach algorithm is implemented using Python and C/C++ language, if your platform is not supported then Python\nimplementation is used, otherwise C/C++. Implementation can be chosen by `ccore` flag (by default it is always\n'True' and it means that C/C++ is used), for example:\n\n.. code:: python\n\n    # As by default - C/C++ part of the library is used\n    xmeans_instance_1 = xmeans(data_points, start_centers, 20, ccore=True);\n\n    # The same - C/C++ part of the library is used by default\n    xmeans_instance_2 = xmeans(data_points, start_centers, 20);\n\n    # Switch off core - Python is used\n    xmeans_instance_3 = xmeans(data_points, start_centers, 20, ccore=False);\n\n\n\nInstallation\n============\n\nInstallation using pip3 tool:\n\n.. code:: bash\n\n    $ pip3 install pyclustering\n\nManual installation from official repository using Makefile:\n\n.. code:: bash\n\n    # get sources of the pyclustering library, for example, from repository\n    $ mkdir pyclustering\n    $ cd pyclustering/\n    $ git clone https://github.com/annoviko/pyclustering.git .\n\n    # compile CCORE library (core of the pyclustering library).\n    $ cd ccore/\n    $ make ccore_64bit      # build for 64-bit OS\n\n    # $ make ccore_32bit    # build for 32-bit OS\n\n    # return to parent folder of the pyclustering library\n    $ cd ../\n\n    # install pyclustering library\n    $ python3 setup.py install\n\n    # optionally - test the library\n    $ python3 setup.py test\n\nManual installation using CMake:\n\n.. code:: bash\n\n    # get sources of the pyclustering library, for example, from repository\n    $ mkdir pyclustering\n    $ cd pyclustering/\n    $ git clone https://github.com/annoviko/pyclustering.git .\n\n    # generate build files.\n    $ mkdir build\n    $ cmake ..\n\n    # build pyclustering-shared target depending on what was generated (Makefile or MSVC solution)\n    # if Makefile has been generated then\n    $ make pyclustering-shared\n\n    # return to parent folder of the pyclustering library\n    $ cd ../\n\n    # install pyclustering library\n    $ python3 setup.py install\n\n    # optionally - test the library\n    $ python3 setup.py test\n\nManual installation using Microsoft Visual Studio solution:\n\n1. Clone repository from: https://github.com/annoviko/pyclustering.git\n2. Open folder `pyclustering/ccore`\n3. Open Visual Studio project `ccore.sln`\n4. Select solution platform: `x86` or `x64`\n5. Build `pyclustering-shared` project.\n6. Add pyclustering folder to python path or install it using setup.py\n\n.. code:: bash\n\n    # install pyclustering library\n    $ python3 setup.py install\n\n    # optionally - test the library\n    $ python3 setup.py test\n\n\n\nProposals, Questions, Bugs\n==========================\n\nIn case of any questions, proposals or bugs related to the pyclustering please contact to pyclustering@yandex.ru or create an issue here.\n\n\n\nPyClustering Status\n===================\n\n+----------------------+------------------------------+-------------------------------------+---------------------------------+\n| Branch               | master                       | 0.10.dev                            | 0.10.1.rel                      |\n+======================+==============================+=====================================+=================================+\n| Build (Linux, MacOS) | |Build Status Linux MacOS|   | |Build Status Linux MacOS 0.10.dev| | |Build Status Linux 0.10.1.rel| |\n+----------------------+------------------------------+-------------------------------------+---------------------------------+\n| Build (Win)          | |Build Status Win|           | |Build Status Win 0.10.dev|         | |Build Status Win 0.10.1.rel|   |\n+----------------------+------------------------------+-------------------------------------+---------------------------------+\n| Code Coverage        | |Coverage Status|            | |Coverage Status 0.10.dev|          | |Coverage Status 0.10.1.rel|    |\n+----------------------+------------------------------+-------------------------------------+---------------------------------+\n\n\n\nCite the Library\n================\n\nIf you are using pyclustering library in a scientific paper, please, cite the library:\n\nNovikov, A., 2019. PyClustering: Data Mining Library. Journal of Open Source Software, 4(36), p.1230. Available at: http://dx.doi.org/10.21105/joss.01230.\n\nBibTeX entry:\n\n.. code::\n\n    @article{Novikov2019,\n        doi         = {10.21105/joss.01230},\n        url         = {https://doi.org/10.21105/joss.01230},\n        year        = 2019,\n        month       = {apr},\n        publisher   = {The Open Journal},\n        volume      = {4},\n        number      = {36},\n        pages       = {1230},\n        author      = {Andrei Novikov},\n        title       = {{PyClustering}: Data Mining Library},\n        journal     = {Journal of Open Source Software}\n    }\n\n\n\nBrief Overview of the Library Content\n=====================================\n\n**Clustering algorithms and methods (module pyclustering.cluster):**\n\n+------------------------+---------+-----+\n| Algorithm              | Python  | C++ |\n+========================+=========+=====+\n| Agglomerative          | ✓       | ✓   |\n+------------------------+---------+-----+\n| BANG                   | ✓       |     |\n+------------------------+---------+-----+\n| BIRCH                  | ✓       |     |\n+------------------------+---------+-----+\n| BSAS                   | ✓       | ✓   |\n+------------------------+---------+-----+\n| CLARANS                | ✓       |     |\n+------------------------+---------+-----+\n| CLIQUE                 | ✓       | ✓   |\n+------------------------+---------+-----+\n| CURE                   | ✓       | ✓   |\n+------------------------+---------+-----+\n| DBSCAN                 | ✓       | ✓   |\n+------------------------+---------+-----+\n| Elbow                  | ✓       | ✓   |\n+------------------------+---------+-----+\n| EMA                    | ✓       |     |\n+------------------------+---------+-----+\n| Fuzzy C-Means          | ✓       | ✓   |\n+------------------------+---------+-----+\n| GA (Genetic Algorithm) | ✓       | ✓   |\n+------------------------+---------+-----+\n| G-Means                | ✓       | ✓   |\n+------------------------+---------+-----+\n| HSyncNet               | ✓       | ✓   |\n+------------------------+---------+-----+\n| K-Means                | ✓       | ✓   |\n+------------------------+---------+-----+\n| K-Means++              | ✓       | ✓   |\n+------------------------+---------+-----+\n| K-Medians              | ✓       | ✓   |\n+------------------------+---------+-----+\n| K-Medoids              | ✓       | ✓   |\n+------------------------+---------+-----+\n| MBSAS                  | ✓       | ✓   |\n+------------------------+---------+-----+\n| OPTICS                 | ✓       | ✓   |\n+------------------------+---------+-----+\n| ROCK                   | ✓       | ✓   |\n+------------------------+---------+-----+\n| Silhouette             | ✓       | ✓   |\n+------------------------+---------+-----+\n| SOM-SC                 | ✓       | ✓   |\n+------------------------+---------+-----+\n| SyncNet                | ✓       | ✓   |\n+------------------------+---------+-----+\n| Sync-SOM               | ✓       |     |\n+------------------------+---------+-----+\n| TTSAS                  | ✓       | ✓   |\n+------------------------+---------+-----+\n| X-Means                | ✓       | ✓   |\n+------------------------+---------+-----+\n\n\n**Oscillatory networks and neural networks (module pyclustering.nnet):**\n\n+--------------------------------------------------------------------------------+---------+-----+\n| Model                                                                          | Python  | C++ |\n+================================================================================+=========+=====+\n| CNN (Chaotic Neural Network)                                                   | ✓       |     |\n+--------------------------------------------------------------------------------+---------+-----+\n| fSync (Oscillatory network based on Landau-Stuart equation and Kuramoto model) | ✓       |     |\n+--------------------------------------------------------------------------------+---------+-----+\n| HHN (Oscillatory network based on Hodgkin-Huxley model)                        | ✓       | ✓   |\n+--------------------------------------------------------------------------------+---------+-----+\n| Hysteresis Oscillatory Network                                                 | ✓       |     |\n+--------------------------------------------------------------------------------+---------+-----+\n| LEGION (Local Excitatory Global Inhibitory Oscillatory Network)                | ✓       | ✓   |\n+--------------------------------------------------------------------------------+---------+-----+\n| PCNN (Pulse-Coupled Neural Network)                                            | ✓       | ✓   |\n+--------------------------------------------------------------------------------+---------+-----+\n| SOM (Self-Organized Map)                                                       | ✓       | ✓   |\n+--------------------------------------------------------------------------------+---------+-----+\n| Sync (Oscillatory network based on Kuramoto model)                             | ✓       | ✓   |\n+--------------------------------------------------------------------------------+---------+-----+\n| SyncPR (Oscillatory network for pattern recognition)                           | ✓       | ✓   |\n+--------------------------------------------------------------------------------+---------+-----+\n| SyncSegm (Oscillatory network for image segmentation)                          | ✓       | ✓   |\n+--------------------------------------------------------------------------------+---------+-----+\n\n\n**Graph Coloring Algorithms (module pyclustering.gcolor):**\n\n+------------------------+---------+-----+\n| Algorithm              | Python  | C++ |\n+========================+=========+=====+\n| DSatur                 | ✓       |     |\n+------------------------+---------+-----+\n| Hysteresis             | ✓       |     |\n+------------------------+---------+-----+\n| GColorSync             | ✓       |     |\n+------------------------+---------+-----+\n\n\n**Containers (module pyclustering.container):**\n\n+------------------------+---------+-----+\n| Algorithm              | Python  | C++ |\n+========================+=========+=====+\n| KD Tree                | ✓       | ✓   |\n+------------------------+---------+-----+\n| CF Tree                | ✓       |     |\n+------------------------+---------+-----+\n\n\n\nExamples in the Library\n=======================\n\nThe library contains examples for each algorithm and oscillatory network model:\n\n**Clustering examples:** ``pyclustering/cluster/examples``\n\n**Graph coloring examples:** ``pyclustering/gcolor/examples``\n\n**Oscillatory network examples:** ``pyclustering/nnet/examples``\n\n.. image:: https://github.com/annoviko/pyclustering/blob/master/docs/img/example_cluster_place.png\n   :alt: Where are examples?\n\n\n\nCode Examples\n=============\n\n**Data clustering by CURE algorithm**\n\n.. code:: python\n\n    from pyclustering.cluster import cluster_visualizer;\n    from pyclustering.cluster.cure import cure;\n    from pyclustering.utils import read_sample;\n    from pyclustering.samples.definitions import FCPS_SAMPLES;\n\n    # Input data in following format [ [0.1, 0.5], [0.3, 0.1], ... ].\n    input_data = read_sample(FCPS_SAMPLES.SAMPLE_LSUN);\n\n    # Allocate three clusters.\n    cure_instance = cure(input_data, 3);\n    cure_instance.process();\n    clusters = cure_instance.get_clusters();\n\n    # Visualize allocated clusters.\n    visualizer = cluster_visualizer();\n    visualizer.append_clusters(clusters, input_data);\n    visualizer.show();\n\n**Data clustering by K-Means algorithm**\n\n.. code:: python\n\n    from pyclustering.cluster.kmeans import kmeans, kmeans_visualizer\n    from pyclustering.cluster.center_initializer import kmeans_plusplus_initializer\n    from pyclustering.samples.definitions import FCPS_SAMPLES\n    from pyclustering.utils import read_sample\n\n    # Load list of points for cluster analysis.\n    sample = read_sample(FCPS_SAMPLES.SAMPLE_TWO_DIAMONDS)\n\n    # Prepare initial centers using K-Means++ method.\n    initial_centers = kmeans_plusplus_initializer(sample, 2).initialize()\n\n    # Create instance of K-Means algorithm with prepared centers.\n    kmeans_instance = kmeans(sample, initial_centers)\n\n    # Run cluster analysis and obtain results.\n    kmeans_instance.process()\n    clusters = kmeans_instance.get_clusters()\n    final_centers = kmeans_instance.get_centers()\n\n    # Visualize obtained results\n    kmeans_visualizer.show_clusters(sample, clusters, final_centers)\n\n**Data clustering by OPTICS algorithm**\n\n.. code:: python\n\n    from pyclustering.cluster import cluster_visualizer\n    from pyclustering.cluster.optics import optics, ordering_analyser, ordering_visualizer\n    from pyclustering.samples.definitions import FCPS_SAMPLES\n    from pyclustering.utils import read_sample\n\n    # Read sample for clustering from some file\n    sample = read_sample(FCPS_SAMPLES.SAMPLE_LSUN)\n\n    # Run cluster analysis where connectivity radius is bigger than real\n    radius = 2.0\n    neighbors = 3\n    amount_of_clusters = 3\n    optics_instance = optics(sample, radius, neighbors, amount_of_clusters)\n\n    # Performs cluster analysis\n    optics_instance.process()\n\n    # Obtain results of clustering\n    clusters = optics_instance.get_clusters()\n    noise = optics_instance.get_noise()\n    ordering = optics_instance.get_ordering()\n\n    # Visualize ordering diagram\n    analyser = ordering_analyser(ordering)\n    ordering_visualizer.show_ordering_diagram(analyser, amount_of_clusters)\n\n    # Visualize clustering results\n    visualizer = cluster_visualizer()\n    visualizer.append_clusters(clusters, sample)\n    visualizer.show()\n\n**Simulation of oscillatory network PCNN**\n\n.. code:: python\n\n    from pyclustering.nnet.pcnn import pcnn_network, pcnn_visualizer\n\n    # Create Pulse-Coupled neural network with 10 oscillators.\n    net = pcnn_network(10)\n\n    # Perform simulation during 100 steps using binary external stimulus.\n    dynamic = net.simulate(50, [1, 1, 1, 0, 0, 0, 0, 1, 1, 1])\n\n    # Allocate synchronous ensembles from the output dynamic.\n    ensembles = dynamic.allocate_sync_ensembles()\n\n    # Show output dynamic.\n    pcnn_visualizer.show_output_dynamic(dynamic, ensembles)\n\n**Simulation of chaotic neural network CNN**\n\n.. code:: python\n\n    from pyclustering.cluster import cluster_visualizer\n    from pyclustering.samples.definitions import SIMPLE_SAMPLES\n    from pyclustering.utils import read_sample\n    from pyclustering.nnet.cnn import cnn_network, cnn_visualizer\n\n    # Load stimulus from file.\n    stimulus = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE3)\n\n    # Create chaotic neural network, amount of neurons should be equal to amount of stimulus.\n    network_instance = cnn_network(len(stimulus))\n\n    # Perform simulation during 100 steps.\n    steps = 100\n    output_dynamic = network_instance.simulate(steps, stimulus)\n\n    # Display output dynamic of the network.\n    cnn_visualizer.show_output_dynamic(output_dynamic)\n\n    # Display dynamic matrix and observation matrix to show clustering phenomenon.\n    cnn_visualizer.show_dynamic_matrix(output_dynamic)\n    cnn_visualizer.show_observation_matrix(output_dynamic)\n\n    # Visualize clustering results.\n    clusters = output_dynamic.allocate_sync_ensembles(10)\n    visualizer = cluster_visualizer()\n    visualizer.append_clusters(clusters, stimulus)\n    visualizer.show()\n\n\n\nIllustrations\n=============\n\n**Cluster allocation on FCPS dataset collection by DBSCAN:**\n\n.. image:: https://github.com/annoviko/pyclustering/blob/master/docs/img/fcps_cluster_analysis.png\n   :alt: Clustering by DBSCAN\n\n**Cluster allocation by OPTICS using cluster-ordering diagram:**\n\n.. image:: https://github.com/annoviko/pyclustering/blob/master/docs/img/optics_example_clustering.png\n   :alt: Clustering by OPTICS\n\n\n**Partial synchronization (clustering) in Sync oscillatory network:**\n\n.. image:: https://github.com/annoviko/pyclustering/blob/master/docs/img/sync_partial_synchronization.png\n   :alt: Partial synchronization in Sync oscillatory network\n\n\n**Cluster visualization by SOM (Self-Organized Feature Map)**\n\n.. image:: https://github.com/annoviko/pyclustering/blob/master/docs/img/target_som_processing.png\n   :alt: Cluster visualization by SOM\n\n\n\n.. |Build Status Linux MacOS| image:: https://travis-ci.org/annoviko/pyclustering.svg?branch=master\n   :target: https://travis-ci.org/annoviko/pyclustering\n.. |Build Status Win| image:: https://ci.appveyor.com/api/projects/status/4uly2exfp49emwn0/branch/master?svg=true\n   :target: https://ci.appveyor.com/project/annoviko/pyclustering/branch/master\n.. |Coverage Status| image:: https://coveralls.io/repos/github/annoviko/pyclustering/badge.svg?branch=master\u0026ts=1\n   :target: https://coveralls.io/github/annoviko/pyclustering?branch=master\n.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4280556.svg\n   :target: https://doi.org/10.5281/zenodo.4280556\n.. |PyPi| image:: https://badge.fury.io/py/pyclustering.svg\n   :target: https://badge.fury.io/py/pyclustering\n.. |Build Status Linux MacOS 0.10.dev| image:: https://travis-ci.org/annoviko/pyclustering.svg?branch=0.10.dev\n   :target: https://travis-ci.org/annoviko/pyclustering\n.. |Build Status Win 0.10.dev| image:: https://ci.appveyor.com/api/projects/status/4uly2exfp49emwn0/branch/0.10.dev?svg=true\n   :target: https://ci.appveyor.com/project/annoviko/pyclustering/branch/0.9.dev\n.. |Coverage Status 0.10.dev| image:: https://coveralls.io/repos/github/annoviko/pyclustering/badge.svg?branch=0.10.dev\u0026ts=1\n   :target: https://coveralls.io/github/annoviko/pyclustering?branch=0.9.dev\n.. |Build Status Linux 0.10.1.rel| image:: https://travis-ci.org/annoviko/pyclustering.svg?branch=0.10.1.rel\n   :target: https://travis-ci.org/annoviko/pyclustering\n.. |Build Status Win 0.10.1.rel| image:: https://ci.appveyor.com/api/projects/status/4uly2exfp49emwn0/branch/0.10.1.rel?svg=true\n   :target: https://ci.appveyor.com/project/annoviko/pyclustering/branch/0.10.1.rel\n.. |Coverage Status 0.10.1.rel| image:: https://coveralls.io/repos/github/annoviko/pyclustering/badge.svg?branch=0.10.1.rel\u0026ts=1\n   :target: https://coveralls.io/github/annoviko/pyclustering?branch=0.10.1.rel\n.. |Download Counter| image:: https://pepy.tech/badge/pyclustering\n   :target: https://pepy.tech/project/pyclustering\n.. |JOSS| image:: http://joss.theoj.org/papers/10.21105/joss.01230/status.svg\n   :target: https://doi.org/10.21105/joss.01230\n","funding_links":[],"categories":["Python","TODO scan for Android support in followings","Others","其他_机器学习与深度学习"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannoviko%2Fpyclustering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannoviko%2Fpyclustering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannoviko%2Fpyclustering/lists"}