From 95176eb74e8872bf4860f190f1a0a33ebd1f64f0 Mon Sep 17 00:00:00 2001 From: CharleyPeng1 Date: Tue, 7 Mar 2017 14:14:50 +1100 Subject: [PATCH 1/2] Update README.rst --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index 69c92f8..b1d533a 100644 --- a/README.rst +++ b/README.rst @@ -30,6 +30,7 @@ Installation Choose one from the following. +- Install with pip :code:`pip install apyori`. - Put *apyori.py* into your project. - Run :code:`python setup.py install`. From 2c62732e56648fa3533ad02c9fb490cb20e2647c Mon Sep 17 00:00:00 2001 From: Yufei Wang Date: Wed, 20 Oct 2021 23:31:31 +0800 Subject: [PATCH 2/2] Add parameter name validity check Someone may incorrectly pass in the parameter name, e.g., the example code in https://www.kaggle.com/meetnagadia/market-basket-analysis --- apyori.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apyori.py b/apyori.py index b618e63..5471bf7 100755 --- a/apyori.py +++ b/apyori.py @@ -260,6 +260,9 @@ def apriori(transactions, **kwargs): max_length -- The maximum length of the relation (integer). """ # Parse the arguments. + for k in kwargs.keys(): + assert k in ['min_support', 'min_confidence', 'min_lift', 'max_length', '_gen_support_records', + '_gen_ordered_statistics', '_filter_ordered_statistics'], "%s is not a valid key" % k min_support = kwargs.get('min_support', 0.1) min_confidence = kwargs.get('min_confidence', 0.0) min_lift = kwargs.get('min_lift', 0.0)