Code Monkey home page Code Monkey logo

apriori's Introduction

Apriori

data = [
    ["A", "B", "E"],
    ["B", "D"],
    ["B", "C"],
    ["A", "B", "D"],
    ["A", "C"],
    ["B", "C"],
    ["A", "C"],
    ["A", "B", "C", "E"],
    ["A", "B", "C"]
]

print

support----------------------------------------------------------------
{'E': 2}
{'B': 7}
{'A': 6}
{'C': 6}
{'D': 2}
{'A,D': 1}
{'C,E': 1}
{'B,C': 4}
{'B,E': 2}
{'B,D': 2}
{'A,B': 4}
{'A,C': 4}
{'A,E': 2}
{'B,C,E': 1}
{'A,B,E': 2}
{'A,C,E': 1}
{'A,B,C': 2}
{'A,B,D': 1}
{'A,B,C,E': 1}
confidence----------------------------------------------------------------
The rule is:
A --> E--B--C 0.16666666666666666
B --> E--A--C 0.14285714285714285
C --> E--B--A 0.16666666666666666
E --> B--A--C 0.5
A--B --> E--C 0.25
A--C --> E--B 0.25
A--E --> B--C 0.5
B--C --> E--A 0.25
B--E --> A--C 0.5
C--E --> A--B 1.0
A--B--C --> E 0.5
A--B--E --> C 0.5
A--C--E --> B 1.0
B--C--E --> A 1.0
The associative rule is:
C--E --> A--B : 1.0
A--C--E --> B : 1.0
B--C--E --> A : 1.0

apriori's People

Contributors

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