Skip to content

Conversation

yogikiran
Copy link

Changes to function - create_initialset (To convert the initial transaction into frozenset)

Modifications suggested:
When the transactions are converted to frozensets, the support count of the individual item has to be retained to avoid the loss of support count.
for example - in the file small-test-input.txt provided in the same repo, the transactions in line number - 3 and line number - 6 are {2,3}. Here when the transactions are to be converted to frozenset, the corresponding count in the frozenset should be as follows:
{ frozenset{2,3}, 2 }, here number 2 for the value in this dict indicates its occurrence to be twice in the transaction list.

Currently, the value would be { frozenset{2,3}, 1 } which loses the support count information of these items.
The code change provided will retain the support count of individual items, thereby not losing repetitive transaction information from the database. This helps in generating a correct FP Tree and in turn generation of frequent itemsets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant