Implementation of close frequent subgraph mining algorithm cgSpan
Project description
cgSpan
cgSpan is an algorithm for mining closed frequent subgraphs. This implementation of cgSpan is built using an existing implementation for gSpan.
gSpan is an algorithm for mining frequent subgraphs.
This program implements cgSpan with Python. The repository on GitHub is https://github.com/NaazS03/cgSpan
The gSpan implementation referenced by this program can be found on GitHub at https://github.com/betterenvi/gSpan.
Undirected Graphs
This program supports undirected graphs.
How to install
This program supports Python 3.
Method 1
Install this project using pip:
pip install cgspan-mining
Method 2
First, clone the project:
git clone https://github.com/NaazS03/cgSpan.git
cd cgSpan
You can optionally install this project as a third-party library so that you can run it under any path.
python setup.py install
How to run
The command is:
python -m cgspan_mining [-s min_support] [-n num_graph] [-l min_num_vertices] [-u max_num_vertices] [-v True/False] [-p True/False] [-w True/False] [-h] database_file_name
Some examples
- Read graph data from ./graphdata/graph.data, and mine closed subgraphs given min support is 5000
python -m cgspan_mining -s 5000 ./graphdata/graph.data
- Read graph data from ./graphdata/graph.data, mine closed subgraphs given min support is 5000, and visualize these frequent subgraphs(matplotlib and networkx are required)
python -m cgspan_mining -s 5000 -p True ./graphdata/graph.data
- Print help info
python -m cgspan_mining -h
Reference
CloseGraph: Mining Close Frequent Graph Patterns, by X. Yan and J.Han.
gSpan: Graph-Based Substructure Pattern Mining, by X. Yan and J. Han. Proc. 2002 of Int. Conf. on Data Mining (ICDM'02).
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
Built Distribution
File details
Details for the file cgspan_mining-1.0.1.tar.gz
.
File metadata
- Download URL: cgspan_mining-1.0.1.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdaceead84c5d076aee2d9ce933f5377517e220dfc89c4ddbb703c078eaba04b |
|
MD5 | 4f0f3da318b7e5076bc54c7b150e5381 |
|
BLAKE2b-256 | 7a75876837ed107636c7a916cc4aa96ebe22e384e43c599e73e7d0882f7494d3 |
File details
Details for the file cgspan_mining-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: cgspan_mining-1.0.1-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bdb9d04bc0ff60f82be780bbf51e67c1556bdbb27cf317d3c768948071cd04d |
|
MD5 | 651098fc055ce06323f52f07fd477d4d |
|
BLAKE2b-256 | 8a961c1b95c29fc1bdd69711542d487004d50b46392a30b140f1cfff9ca53dcf |