Git Product home page Git Product logo

apyori's Introduction

Apyori

Apyori is a simple implementation of Apriori algorithm with Python 2.7 and 3.3 - 3.5, provided as APIs and as commandline interfaces.

https://travis-ci.org/ymoch/apyori.svg?branch=master https://coveralls.io/repos/github/ymoch/apyori/badge.svg?branch=master

Module Features

  • Consisted of only one file and depends on no other libraries, which enable you to use it portably.
  • Able to used as APIs.

Application Features

  • Supports a JSON output format.
  • Supports a TSV output format for 2-items relations.

Installation

Choose one from the following.

  • Install with pip pip install apyori.
  • Put apyori.py into your project.
  • Run python setup.py install.

API Usage

Here is a basic example:

from apyori import apriori

transactions = [
    ['beer', 'nuts'],
    ['beer', 'cheese'],
]
results = list(apriori(transactions))

For more details, see apyori.apriori pydoc.

CLI Usage

First, prepare input data as tab-separated transactions.

  • Each item is separated with a tab.
  • Each transactions is separated with a line feed code.

Second, run the application. Input data is given as a standard input or file paths.

  • Run with python apyori.py command.
  • If installed, you can also run with apyori-run command.

For more details, use '-h' option.

Samples

Basic usage

apyori-run < data/integration_test_input_1.tsv

Use TSV output

apyori-run -f tsv < data/integration_test_input_1.tsv

Fields of output mean:

  • Base item.
  • Appended item.
  • Support.
  • Confidence.
  • Lift.

Specify the minimum support

apyori-run -s 0.5 < data/integration_test_input_1.tsv

Specify the minimum confidence

apyori-run -c 0.5 < data/integration_test_input_1.tsv

apyori's People

Contributors

charleypeng1 avatar ymoch 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.