Coder Social home page Coder Social logo

alextanhongpin / affinity-analysis Goto Github PK

View Code? Open in Web Editor NEW
4.0 6.0 1.0 151 KB

Study on different approach on data mining techniques, specifically affinity analysis such as FP-Growth, Apriori and Eclat

Jupyter Notebook 73.35% Haskell 4.05% JavaScript 14.66% Scala 1.33% C# 3.41% Python 3.15% Makefile 0.04%
python data-mining fp-growth tree support-count affinity-analysis

affinity-analysis's Introduction

FP-Growth

  1. Calculate the support count of each item in S
  2. Sort items in decreasing support counts
  3. Read transaction n

if has overlapping prefix:

  1. Increment the frequency count for each overlapped item
  2. Create new nodes for none overlapped items
  3. Set the frequency count to one

else:

  1. Create new nodes labelled with the items in t
  2. Set the frequency count to 1
  3. Create pointers to common items

Repeat until there are not more items.

Additional a FP-Tree uses pointers connecting between nodes that have the same items creating a singly linked list.

These pointers are used to access individual items in the tree much faster.

Best Scenario

There is only a single node, because all transactions have the same set of items.

Worst case

Multiple nodes where every transaction has a unique set of items.

Other solution

https://github.com/alextanhongpin/machine-learning-in-action/blob/master/fp_growth.ipynb

Reference

affinity-analysis's People

Contributors

alextanhongpin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sandy4321

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.