Giter Site home page Giter Site logo

bide-algorithm's Introduction

Bide algorithm

Implement Bide algorithm for searching closed frequent sequences

Example 1

Samples are referred to J. Wang and J. Han[1].

from bide_alg import *

db = [
    ['c', 'a', 'a', 'b', 'c'],
    ['a', 'b', 'c', 'b'],
    ['c', 'a', 'b', 'c'],
    ['a', 'b', 'b', 'c', 'a']
]

Execute bide algorithm to find closed frequent patterns with the minimum support greater than or equal to 2, minimum length >=0, and maximum length <=5 on db by:

bide_obj = bide_alg(db, 2 , 0, 5)
bide_obj._mine()

Show results:

bide_obj._results
[(['c', 'a'], 3),
 (['c', 'a', 'b', 'c'], 2),
 (['c', 'b'], 3),
 (['a', 'a'], 2),
 (['a', 'b', 'c'], 4),
 (['a', 'b', 'b'], 2)]

Example 2

Given data as follows, each element is a sequence.

from bide_alg import *
db = [
    [0, 1, 2, 3, 4, 4],
    [1, 1, 1, 3, 4, 3],
    [2, 1, 2, 2, 0],
    [1, 1, 1, 2, 2, 4, 3],
]

Execute bide algorithm to find closed frequent patterns with the minimum support greater than or equal to 2, minimum length >=2, and maximum length <=5 on db by:

bide_obj = bide_alg(db, 2 , 2, 5)
bide_obj._mine()

Show result:

bide_obj._results
[([1, 2], 3),
 ([1, 2, 3], 2),
 ([1, 2, 4], 2),
 ([1, 2, 2], 2),
 ([1, 3], 3),
 ([1, 3, 4], 2),
 ([1, 4], 3),
 ([1, 1, 1, 4, 3], 2)]

Reference

  1. J. Wang and J. Han, "BIDE: efficient mining of frequent closed sequences," Proceedings. 20th International Conference on Data Engineering, Boston, MA, USA, 2004, pp. 79-90. doi: 10.1109/ICDE.2004.1319986 keywords: {data mining;optimisation;search problems;pattern mining algorithm;BIDE;sequence closure checking;frequent closed sequence;bidirectional extension;search space;BackScan pruning method;Scan-Skip optimization technique;Data mining;Itemsets;Bidirectional control;Optimization methods;Pattern analysis;Computer science;Runtime;Databases;Proteins;XML}, URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1319986&isnumber=29235

  2. Refer to package prefixspan, https://pypi.org/project/prefixspan/

bide-algorithm's People

Contributors

ronaldyu 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.