Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Biggest thing is how to code getting the pairs, then support and confidence. I mostly understand obtaining the initial pass/first count of all of the

image text in transcribed

Biggest thing is how to code getting the pairs, then support and confidence. I mostly understand obtaining the initial pass/first count of all of the basket items, but am a little stuck getting them into pairs and also computing the scores needed (at the same time??)

Here is the first 50 rows of our data set just as an example:

FRO11987 ELE17451 ELE89019 SNA90258 GRO99222 GRO99222 GRO12298 FRO12685 ELE91550 SNA11465 ELE26917 ELE52966 FRO90334 SNA30755 ELE17451 FRO84225 SNA80192 ELE17451 GRO73461 DAI22896 SNA99873 FRO86643 ELE17451 ELE37798 FRO86643 GRO56989 ELE23393 SNA11465 ELE17451 SNA69641 FRO86643 FRO78087 SNA11465 GRO39357 ELE28573 ELE11375 DAI54444 ELE17451 GRO73461 DAI22896 SNA99873 FRO18919 DAI50921 SNA80192 GRO75578 ELE17451 ELE59935 FRO18919 ELE23393 SNA80192 SNA85662 SNA91554 DAI22177 ELE17451 SNA69641 FRO18919 SNA90258 ELE28573 ELE11375 DAI14125 FRO78087 ELE17451 GRO73461 DAI22896 SNA80192 SNA85662 SNA90258 DAI46755 FRO81176 ELE66810 DAI49199 DAI91535 GRO94758 ELE94711 DAI22177 ELE17451 SNA69641 DAI91535 GRO94758 GRO99222 FRO76833 FRO81176 SNA80192 DAI54690 ELE37798 GRO56989 ELE17451 GRO73461 DAI22896 GRO99222 SNA47306 GRO36567 ELE82555 SNA17715 SNA94781 DAI87514 GRO48282 GRO12935 SNA55952 DAI93692 DAI92253 FRO82427 ELE26917 DAI22177 GRO99222 DAI48891 GRO36567 ELE82555 SNA17715 SNA94781 DAI87514 SNA55952 DAI93692 GRO12935 GRO48282 DAI92253 FRO82427 ELE17451 ELE37798 GRO56989 ELE28573 ELE11375 ELE27376 FRO78087 ELE17451 GRO73461 DAI22896 SNA99873 FRO47475 FRO18919 SNA90258 GRO75578 FRO78087 GRO39357 DAI17810 FRO17376 DAI38969 DAI50913 DAI22896 FRO47475 FRO18919 SNA90258 ELE11111 FRO86643 ELE26917 GRO99222 DAI22177 ELE17451 ELE59935 SNA66979 FRO92261 FRO47475 FRO76487 FRO86643 GRO39369 FRO78087 GRO22575 GRO39357 GRO48971 FRO32293 ELE17451 FRO98729 FRO18919 SNA90258 ELE11111 FRO86643 ELE26917 GRO99222 GRO39369 DAI95741 FRO78087 GRO39357 GRO75578 FRO86643 SNA11465 ELE17451 ELE37798 GRO56989 ELE28573 ELE11375 DAI44355 FRO78087 ELE17451 GRO73461 DAI22896 SNA80192 SNA47306 GRO36567 FRO75418 FRO70974 GRO49037 GRO30386 FRO41069 ELE96863 FRO16142 ELE52446 SNA91554 GRO99222 DAI88808 FRO18919 SNA90258 ELE17451 ELE89019 FRO92261 FRO36081 DAI35347 SNA63157 GRO49037 ELE73246 SNA80192 DAI48891 GRO36567 FRO75418 SNA55952 DAI93692 ELE66067 ELE96863 ELE37798 GRO56989 ELE17451 DAI22534 SNA93860 SNA84406 SNA26720 ELE98347 SNA80192 DAI54690 DAI22896 ELE96863 GRO99222 ELE28573 ELE11375 ELE76964 FRO78087 ELE17451 GRO73461 DAI22896 GRO99222 SNA47306 GRO36567 SNA63157 GRO49037 SNA55952 DAI93692 FRO19520 FRO13639 FRO24098 FRO98878 DAI22177 ELE17451 ELE59935 FRO98878 GRO99222 SNA55952 DAI93692 FRO19520 DAI35347 FRO24098 DAI38156 ELE26917 ELE37798 GRO56989 ELE17451 GRO73461 DAI22896 SNA72163 DAI55911 FRO31317 SNA59903 DAI59119 SNA55952 FRO87042 GRO48498 DAI95741 DAI18334 FRO38366 ELE96863 SNA70487 FRO19520 GRO99222 DAI35347 FRO13639 FRO24098 DAI38156 ELE26917 DAI22177 ELE17451 ELE89019 FRO31317 ELE20196 DAI59119 FRO60023 GRO94047 ELE17451 DAI22534 GRO73461 SNA84406 SNA26720 SNA40380 GRO99222 GRO91763 GRO48498 DAI95741 DAI18334 FRO38366 ELE96863 SNA70487 DAI35347 SNA63157 FRO24098 ELE73246 ELE26917 ELE17451 GRO73461 GRO15017 FRO98184 GRO59710 DAI35347 SNA17715 SNA44593 DAI87514 ELE26917 ELE52966 GRO99222 GRO12935 GRO48282 SNA94781 ELE30182 DAI35347 FRO98878 GRO99222 ELE96863 SNA70487 FRO24098 DAI38156 ELE26917 ELE18435 SNA99873 FRO41069 FRO98184 SNA45033 SNA17715 ELE30182 DAI22177 ELE17451 ELE37798 DAI35347 FRO24098 DAI63921 ELE59935 GRO15017 DAI95860 GRO56989 ELE28573 ELE11375 FRO70489 FRO78087 SNA18336 GRO39070 GRO99222 FRO74481 ELE69204 ELE66600 FRO62970 FRO78087 ELE17451 SNA54161 SNA83730 DAI63921 ELE59935 FRO79301 ELE17451 DAI22534 FRO62970 FRO78087 SNA85034 DAI91290 DAI63921 FRO79301 SNA83730 ELE89019 ELE59935 ELE14480 GRO82070 GRO39070 GRO99222 ELE89019 FRO78087 DAI62779 ELE17451 ELE59935 DAI35347 SNA86836 GRO34288 SNA55762 GRO99222 SNA17715 SNA80064 DAI62779 ELE17451 DAI63921 GRO68850 GRO32230 ELE26917 SNA99873 FRO31317 DAI32480 SNA14713 SNA99873 ELE91337 DAI69239 GRO99222 GRO27756 SNA93641 ELE52966 SNA14713 DAI62779 ELE17451 DAI47060 FRO31317 FRO61250 SNA14713 DAI49253 SNA62203 ELE41924 FRO41069 GRO17442 SNA63157 SNA43319 DAI62779 ELE17451 FRO44363 SNA58915 DAI48919 FRO35353 SNA99873 GRO38983 FRO31317 ELE68605 DAI63921 DAI47060

Programming and Experimental Part (60 points) Product Recommendations: The action or practice of selling additional products or ser- vices to existing customers is called cross-selling. Giving product recommendation is one of the examples of cross-selling that are frequently used by online retailers. One simple method to give product recommendations is to recommend products that are frequently browsed together by the customers. Suppose we want to recommend new products to the customer based on the products they have already browsed on the online website. Write a program using the A-priori algorithm to find products which are frequently browsed together. Fix the support to s =100 i.e., product pairs need to occur together at least 100 times to be considered frequent) and find itemsets of size 2 and 3. Use the online browsing behavior dataset provided with this homework. Each line represents a browsing session of a customer. On each line, each string of 8 characters represents the id of an item browsed during that session. The items are separated by spaces. a) Identify pairs of items (X,Y) such that the support of {X,Y} is at least 100. For all such pairs, compute the confidence scores of the corresponding association rules: X Y , Y X. Sort the rules in decreasing order of confidence scores and list the top 5 rules in the writeup. Break ties, if any, by lexicographically increasing order on the left hand side of the rule. b) Identify item triples (X,Y,Z) such that the support of {X,Y,Z} is at least 100. For all such triples, compute the confidence scores of the corresponding association rules: (X,Y) Z, (X, Z) Y, (Y,Z) X. Sort the rules in decreasing order of confidence scores and list the top 5 rules in the writeup. Order the left-hand-side pair lexicographically and break ties, if any, by lexicographical order of the first then the second item in the pair. Programming and Experimental Part (60 points) Product Recommendations: The action or practice of selling additional products or ser- vices to existing customers is called cross-selling. Giving product recommendation is one of the examples of cross-selling that are frequently used by online retailers. One simple method to give product recommendations is to recommend products that are frequently browsed together by the customers. Suppose we want to recommend new products to the customer based on the products they have already browsed on the online website. Write a program using the A-priori algorithm to find products which are frequently browsed together. Fix the support to s =100 i.e., product pairs need to occur together at least 100 times to be considered frequent) and find itemsets of size 2 and 3. Use the online browsing behavior dataset provided with this homework. Each line represents a browsing session of a customer. On each line, each string of 8 characters represents the id of an item browsed during that session. The items are separated by spaces. a) Identify pairs of items (X,Y) such that the support of {X,Y} is at least 100. For all such pairs, compute the confidence scores of the corresponding association rules: X Y , Y X. Sort the rules in decreasing order of confidence scores and list the top 5 rules in the writeup. Break ties, if any, by lexicographically increasing order on the left hand side of the rule. b) Identify item triples (X,Y,Z) such that the support of {X,Y,Z} is at least 100. For all such triples, compute the confidence scores of the corresponding association rules: (X,Y) Z, (X, Z) Y, (Y,Z) X. Sort the rules in decreasing order of confidence scores and list the top 5 rules in the writeup. Order the left-hand-side pair lexicographically and break ties, if any, by lexicographical order of the first then the second item in the pair

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions