Apyori is a simple implementation of Apriori algorithm with Python 2.7 and 3.3 - 3.5, provided as APIs and as commandline interfaces.
.. image:: https://travis-ci.org/ymoch/apyori.svg?branch=master :target: https://travis-ci.org/ymoch/apyori .. image:: https://coveralls.io/repos/github/ymoch/apyori/badge.svg?branch=master :target: https://coveralls.io/github/ymoch/apyori?branch=master
Choose one from the following.
pip install apyori
.python setup.py install
.Here is a basic example:
.. code-block:: python
from apyori import apriori
transactions = [
['beer', 'nuts'],
['beer', 'cheese'],
]
results = list(apriori(transactions))
For more details, see apyori.apriori pydoc.
First, prepare input data as tab-separated transactions.
Second, run the application. Input data is given as a standard input or file paths.
python apyori.py
command.apyori-run
command.For more details, use '-h' option.
Basic usage
.. code-block:: shell
apyori-run < data/integration_test_input_1.tsv
Use TSV output
.. code-block:: shell
apyori-run -f tsv < data/integration_test_input_1.tsv
Fields of output mean:
Specify the minimum support
.. code-block:: shell
apyori-run -s 0.5 < data/integration_test_input_1.tsv
Specify the minimum confidence
.. code-block:: shell
apyori-run -c 0.5 < data/integration_test_input_1.tsv