Programming Assignment | Get Paper Help

Develop a program in Python that will compute all the two-items associations rules in the form A —> B, based on a given threshold computation method and value by the user for a given market data.

Program will produce the following menu for the user to choose:

MENU

THIS PROGRAM WILL COMPUTE ALL THE RULES in the form A —> B.

Please chose the threshold computation method:

Enter 1 for #(A, B) / #A

Enter 2 for (#(A, B) / #A) / #transactions

Enter E to exit

Once the user chooses the threshold computation method, then user will be asked to set a threshold value to display the association rules between the pairs greater than the threshold as shown below.

Please now enter the threshold value for the rules you want to see. Enter E to exit:

Threshold: 0.30 <—— User enters the value.

 

Then your program will output the Association rules as shown below.

Association rules:

banana —> apple, 0.30

napkin —> apple, 0.45

bread —> gum, 0.60

 

20 //# of transactions

1, 2, gum, bread //transaction id, # of items purchased, item1, item2,…

2, 2, gum, napkin

3, 3, fruit, bread, fork

4, 7, milk, bread, napkin, fork, juice, soup, fruit

5, 4, juice, napkin, milk, bread

6, 2, bread, spoon

7, 1, juice

8, 3, juice, napkin, milk

9, 4, juice, napkin, milk, trash cane

10, 1, trash cane

11, 10, milk, egg, bread, napkin, spoon, trash cane, water, juice, soup, fork

12, 1, egg

13, 3, bread, milk, trash bag

14, 5, gum, salt, fruit, vegetable, bread

15, 1, bread

16, 2, bread, milk

17, 3, bread, salt, egg

18, 2, milk, napkin

19, 3, trash bag, juice, milk

20, 3, trash bag, trash cane, soup

My Master Papers
Calculate your paper price
Pages (550 words)
Approximate price: -