Association Rule: Numerical Question

 


Question:

Suppose there are 100 items, numbered from 1 to 100, and also 100 transactions, also numbered from

1 to 100. Item i is in transaction t if and only if i is a factor of t. For example, Transaction 6 contains

items {1, 2, 3, 6}. If minimum support is 5, which items are frequent? What will be the confidence

of the following association rule: {5, 7} → {2}?

Answer:

Items are frequent if their support is at least the minimum support of 5. In this context, support refers to the number of transactions that contain the item. An item i is in transaction t if i is a factor of t.

Let's count the support for each item ii (i.e., the number of transactions t such that i is a factor of t).

  • Item 1: It is a factor of all transactions (1 through 100). Thus, its support is 100.
  • Item 2: It is a factor of all even transactions. Thus, its support is 50 (2, 4, 6, ..., 100).
  • Item 3: It is a factor of transactions 3, 6, 9, ..., 99. Its support is 33.
  • Item 4: It is a factor of transactions 4, 8, 12, ..., 100. Its support is 25.
  • Item 5: It is a factor of transactions 5, 10, 15, ..., 100. Its support is 20.
  • Item 6: It is a factor of transactions 6, 12, 18, ..., 96. Its support is 16.
  • Item 7: It is a factor of transactions 7, 14, 21, ..., 98. Its support is 14.
  • Item 8: It is a factor of transactions 8, 16, 24, ..., 96. Its support is 12.
  • Item 9: It is a factor of transactions 9, 18, 27, ..., 99. Its support is 11.
  • Item 10: It is a factor of transactions 10, 20, 30, ..., 100. Its support is 10.
  • Item 11: It is a factor of transactions 11, 22, 33, ..., 99. Its support is 9.
  • Item 12: It is a factor of transactions 12, 24, 36, ..., 96. Its support is 8.
  • Item 13: It is a factor of transactions 13, 26, 39, ..., 91. Its support is 7.
  • Item 14: It is a factor of transactions 14, 28, 42, ..., 98. Its support is 7.
  • Item 15: It is a factor of transactions 15, 30, 45, ..., 90. Its support is 6.
  • Item 16: It is a factor of transactions 16, 32, 48, ..., 96. Its support is 6.
  • Item 17: It is a factor of transactions 17, 34, 51, ..., 85. Its support is 5.
  • Item 18: It is a factor of transactions 18, 36, 54, ..., 90. Its support is 6.
  • Item 19: It is a factor of transactions 19, 38, 57, ..., 95. Its support is 5.
  • Item 20: It is a factor of transactions 20, 40, 60, ..., 100. Its support is 5.
  • Items 1 through 20 are frequent since their supports are at least 5. Items beyond 20 will have fewer supports as they appear less frequently.

    Calculate Confidence of the Association Rule {5,7} to 2:

    Support of {5,7}\{5, 7\}{5,7} is a subset of transactions that are multiples of both 5 and 7 (i.e., multiples of 35). The transactions are 35, 70. Thus, support of {5,7} is 2.

    Support of {5,7,2}\{5, 7, 2\}{5,7,2} is a subset of transactions that are multiples of 35 and also contain 2, which are only 70. Thus, support of {5,7,2} is 1.

    Confidence of {5,7}{2}\{5, 7\} \rightarrow \{2\}Confidence({5,7}{2}) Support{5,7,2} / Support{5,71/2​ =0.5

    Summary:

    Frequent items: Items 1 through 20.

    Association rule {5,7}{2}\{5, 7\} \rightarrow \{2\}:

    • Support: 1
    • Confidence: 0.5


    Raghunath

    I am studying in M.SC Data Science at the Department of Computer Science and Engineering, Kalyani University. I am an enthusiast blogger.

    Post a Comment

    Previous Post Next Post