Multi-scale modularity based clustering algorithm
Project description
python-paris: Hierarchical graph clustering algorithm (paris) 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 python_paris
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(['0', '1', '2', '3', '4', '5'])
>>> graph.add_edges_from([(0, 1, 1), (0, 2, 1), (1, 2, 1), (2, 3, 1),
(3, 4, 1), (3, 5, 1), (4, 5, 1)])
Compute a clustering hierarchy of the nodes using paris::
>>> from python_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 Apache License 2.0 licence::
Copyright (C) 2018 Bertrand Charpentier <bercha@kth.se>
=========================
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 python_paris
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(['0', '1', '2', '3', '4', '5'])
>>> graph.add_edges_from([(0, 1, 1), (0, 2, 1), (1, 2, 1), (2, 3, 1),
(3, 4, 1), (3, 5, 1), (4, 5, 1)])
Compute a clustering hierarchy of the nodes using paris::
>>> from python_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 Apache License 2.0 licence::
Copyright (C) 2018 Bertrand Charpentier <bercha@kth.se>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python_paris-0.0.1.tar.gz
(6.3 kB
view details)
File details
Details for the file python_paris-0.0.1.tar.gz
.
File metadata
- Download URL: python_paris-0.0.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7f08e1fcd7bff0a3aa405bed69c0a7372f2b349155fd945da75983cc276a6cd |
|
MD5 | f32a35f9d6a34f360671f2421b82736e |
|
BLAKE2b-256 | 36a7971ed2a24d29a3304793d1d1e3eb4b6b0475ef896d3677742abc895840a6 |