Skip to content

Is the code block itemset.count(item) < length - 1 necessary in apriori_algorithm.py? #12943

@phanngoctuan1990

Description

@phanngoctuan1990

What would you like to share?

Hi,

I noticed the following code in apriori_algorithm.py:

if item not in itemset or itemset.count(item) < length - 1:

From my testing with standard datasets (where each item appears at most once in an itemset), the block or itemset.count(item) < length - 1 never seems to be triggered. Is this condition necessary, or could it be removed for cleaner code?

Thank you!

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting triageAwaiting triage from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions