support and confidence

To calculate the association between Coffee and milk.

Association Rule:

Coffee → Milk

Support: How many out of all rows got both?

Sum of common 1s in Coffee and Milk divided by the sum of all items (0 or 1) in Coffee. 3/6 or 1/2 or 50%..!

Confidence: Of the Coffee buyers how many also got Milk?

Sum of all 1s in Coffee divided by Sum of common 1s in Coffee and Milk . 4/3 or 75%.