rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.82k stars 853 forks source link

build confusion matrix from frequent_patterns #1054

Open wdduncan opened 1 year ago

wdduncan commented 1 year ago

When calculating the frequent itemsets and rules, is possible to get the raw numbers needed to build a confusion matrix?

E.g.: After executing this:

frequent_itemsets = apriori(data, min_support=0.2, use_colnames=True)
rules = association_rules(frequent_itemsets, metric="support", min_threshold=0.2)

Is a way to build a confusion matrix like this?:

C not_C
A A+C A+not_C
not_A not_A+C not_A+not_C