You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I tried using the assosciative_rules() function for a project of mine and noticed that I was getting the following error:
TypeError: association_rules() missing 1 required positional argument: 'num_itemsets'
I suspect that this is an oversight in the source code as the previous release didn't have this bug. I hope that this would be addressed and patched.
The num_itemsets argument either used to be optional or used to not exist, hence the example code not including it. So I'd bet that this is a bug.
If this was intentional, I'm confused as to why this argument is required. It seems to me like the desired value of num_itemsets is going to be equal to the length of the frequent_itemsets argument in the vast majority of cases, so I think this argument should be optional and set to len(frequent_itemsets) if not provided.
This would be one line of code, so I might just make a PR for it.
It's somewhat ambiguous as to whether it represents the length of the df or df_orig arguments, and either way it seems that its value could be derived from its corresponding DataFrame (whichever one it is).
Reading the PR also made me realize that I'm way out of my depth here, so I'll leave the creation of a new PR to someone more familiar with the codebase and the underlying math.
Hi,
I tried using the assosciative_rules() function for a project of mine and noticed that I was getting the following error:
TypeError: association_rules() missing 1 required positional argument: 'num_itemsets'
I suspect that this is an oversight in the source code as the previous release didn't have this bug. I hope that this would be addressed and patched.
Code to reproduce the bug
The example code from the User Guide of the association_rules() function can be used to reproduce this bug.
https://rasbt.github.io/mlxtend/user_guide/frequent_patterns/association_rules/
Expected Results
Results from the User Guide of the association_rules() function.
Actual Results
Traceback (most recent call last):
File "c:\Users\siddh\OneDrive\Desktop\bug-report.py", line 25, in
association_rules(frequent_itemsets, metric="confidence", min_threshold=0.7)
TypeError: association_rules() missing 1 required positional argument: 'num_itemsets'
Versions
MLxtend 0.23.2
Windows-10-10.0.22631-SP0
Python 3.11.8 | packaged by Anaconda, Inc. | (main, Feb 26 2024, 21:34:05) [MSC v.1916 64 bit (AMD64)]
Scikit-learn 1.5.2
NumPy 1.26.4
SciPy 1.11.4
The text was updated successfully, but these errors were encountered: