I have grouped my data into say 3 clusters. So, each cluster has a group of similar users who bought similar items. Each cluster has a pattern. Now, not every user follows this pattern exactly as there are some errors in the model which can not be 100 percent accurate.
I have to create a report in python, which contains the information for each user like
- userid
- How many items correctly matched the cluster pattern
- How many items did not match the cluster pattern due to error.
I have followed the basic approach with the below pseudo code:
foreach cluster
get cluster pattern
foreach user under this cluster
compare if the itemid of user and itemid in the cluster are same
save such items in a list
or
save in another list
Now since this is a huge result, I need to create a pdf of results in python and store it. How can I do this? Are there easy and alternate ways to do this ?