Giter VIP home page Giter VIP logo

gspan's Introduction

gSpan

gSpan是一个频繁子图挖掘算法。

这个程序使用Python实现了gSpan算法。在实现时,参照了gboost

无向图

graphdata/graph.data数据上,在数次运行中,本程序和gboost的输出结果一致。

有向图

当前(时间:2016-10-29),gboost还不支持有向图的频繁子图挖掘。本程序实现了面向有向图的频繁子图挖掘,但是还没有全面测试过,正确性不敢保证。本程序的作者在graphdata/graph.data.directed.1graph.data.simple.5两个数据集上,运行了数次,暂时还未发现错误。

如何运行

$ python main.py [-s min_support] [-n num_graph] [-l min_num_vertices] [-u max_num_vertices] [-d] [-v] [-h] [-p] [-w] database_file_name 
一些例子
  • 从./graphdata/graph.data中读取数据,挖掘支持度最少5000的频繁无向子图
$ python main.py -s 5000 ./graphdata/graph.data
  • 从./graphdata/graph.data中读取数据,挖掘支持度最少5000的频繁无向子图,并将频繁子图可视化(需要安装matplotlib和networkx)
$ python main.py -s 5000 -p ./graphdata/graph.data
  • 从./graphdata/graph.data中读取数据,挖掘支持度最少5000的频繁有向子图
$ python main.py -s 5000 -d ./graphdata/graph.data
  • 查看帮助,输出各个参数的含义
$ python main.py -h

本程序的作者还写了基于Jupyter Notebook的代码,展示了程序的输出,并对图进行了可视化。详见main.ipynb

Refercence

gSpan: Graph-Based Substructure Pattern Mining, by X. Yan and J. Han. Proc. 2002 of Int. Conf. on Data Mining (ICDM'02).

gSpan的一个C++实现。

gspan's People

Contributors

betterenvi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.