Code Monkey home page Code Monkey logo

fp_growth's Introduction

Dylan Fossl

Data Mining Assignment - FP-Growth

Description

This assignment was to implement FP-Growth. The assignment was completed in python version python 3.9.0. FP-Growth is an algorithm for frequent pattern mining of data sets. Its benefit in comparison to Apriori is that it holds all transaction data in memory in a tree structure that allows for a level of compression for memory saving.

Implementation

The goal was to implement FP-Growth as efficiently as possible. In my algorithm I construct the Global FP tree and rather then generating the temporary search trees I simply navigate the global search tree repeatedly with python dictionary "explorationtable" that keeps the context of the particular search iteration.

Input Data Format

The Data is expected to be as follows:
4
1 3 1 3 4
2 3 2 3 5
3 4 1 2 3 5
4 2 2 5

line 1 holds number of transactions. Transaction lines are tab separated with first column be id, second being number of items and third column being space separated item list.

Files

In the "Assignment_2" directory there are three python files titled "FPGrowth.py", "FPGrowthMain.py", and Node.py. FPGrowth.py is a class file that holds the function for my FP-Growth implementation. FPGrowthMain.py will the file main file for running FP-Growth in command line. Node.py is a simple Node class for tree construction.

To run FPGrowthMain in command line simply type in:

python3 FPGrowthMain.py -f [FileDirectory] -m [MinimumSupport] -o [OutputFileDirectory]

FileDirectory can be any file of valid format.

MinimumSupport must be an integer between 0-100.

OutputDirectory directory for output.

fp_growth's People

Contributors

dfossl avatar

Watchers

 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.