我将我的数据分为3个类。因此,每个集群都有一组购买相似商品的相似用户。每个群集都有一个模式。现在,并不是每个用户都完全遵循此模式,因为模型中存在一些不能100%准确的错误。
我必须在python中创建一个报告,其中包含每个用户的信息,例如
- userid
- How many items correctly matched the cluster pattern
- How many items did not match the cluster pattern due to error.
我已经用下面的伪代码遵循了基本方法:
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
现在,由于这是一个巨大的结果,因此我需要在python中创建结果pdf并将其存储。我怎样才能做到这一点?是否有简单且替代的方法来执行此操作?