Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.