Skip to main content

Multi-scale modularity based clustering algorithm

Project description

paris: Hierarchical graph clustering algorithm and dendrogram processing
=========================

paris is a Python module that provides an implementation of the hierarchical clustering algorithm for graphs, paris.
It provides four algorithms able to process dendrograms in order to extract best clusters, clusterings or distances.

Installation
------------

Install the latest version of cylouvain using ``pip`` ::

$ pip install pyparis

Dependencies
------------

cylouvain requires:

- Python (>= 2.7 or >= 3.4)
- NumPy
- NetworkX

Simple example
--------------

Build a simple graph with NetworkX::

>>> import networkx as nx
>>> graph = nx.Graph()
>>> graph.add_nodes_from(['a', 'b', 'c', 'd', 'e', 'f'])
>>> graph.add_edges_from([('a', 'b'), ('a', 'c'), ('b', 'c'),
('c', 'd'),
('d', 'e'), ('d', 'f'), ('f', 'e')])

Compute a partition of the nodes using cylouvain::

>>> from paris import paris
>>> dendrogram = paris(graph)

Compute the best clusters, clusterings and distances::

>>> best_cluster = best_cluster_cut(dendrogram)
>>> best_homogneous_clustering = best_homogeneous_cut(dendrogram)
>>> best_heterogneous_clustering = best_heterogeneous_cut(dendrogram)
>>> best_distance = best_distance

License
-------

Released under the MIT license::

Copyright (C) 2018 Bertrand Charpentier <bercha@kth.se>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyparis-0.0.1.tar.gz (5.6 kB view details)

Uploaded Source

File details

Details for the file pyparis-0.0.1.tar.gz.

File metadata

  • Download URL: pyparis-0.0.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyparis-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dbe72ceb2311b1fdbbbde6252b1b90f002cfd3c99c88aa2e74e02e6302cde464
MD5 bb07da66908eb027c81cdf540343db40
BLAKE2b-256 eb45cae16ba7c69617371d0b3f9d0f75a8a29cd23aaa6c635005f94d04c3e8e8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page