In: Computer Science
For the table below, calculate the support and confidence of the following rules (show the fractional values, do not calculate with decimals):
broccoli -> rice
rice -> broccoli
tea -> beets
beets -> tea
Customer 1: broccoli, rice, tea
Customer 2: broccoli, tea, beets
Customer 3: broccoli
Customer 4: rice, tea, beets
Customer 5: broccoli
first we need to know basic formula of support and confidence.
Let a rule X -> Y is there.so,
support=no of times when X is purchased Y is also purchased / total no of transaction.
confidence=no of time both X and Y are purchased together / no of transaction in which X is there.
For first rule:
Broccoli -> rice
support=no of times when broccoli is purchased rice is also purchased / total no of transaction.
support=1/5.
confidence=no of time both broccoli and rice are purchased together / no of transaction in which broccoli is there.
confidence=1/4.
Rule 2.
rice -> Broccoli
support=no of times when rice is purchased broccoli is also purchased / total no of transaction.
support=1/5.
confidence=no of time both rice and broccoli are purchased together / no of transaction in which rice is there.
confidence=1/2.
Rule 3.
tea -> Beets
support=no of times when tea is purchased beets is also purchased / total no of transaction.
support=2/5.
confidence=no of time both tea and beets are purchased together / no of transaction in which tea is there.
confidence=2/3.
Rule 4.
Beets -> tea
support=no of times when beets is purchased tea is also purchased / total no of transaction.
support=2/5.
confidence=no of time both beets and tea are purchased together / no of transaction in which Beets is there.
confidence=2/2.