Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1 1 : Your task. ( basket _ rules _ test: 4 points ) . Your final task in this notebook is to mine

Exercise 11: Your task. (basket_rules_test: 4 points). Your final task in this notebook is to mine this dataset for pairwise association rules. In particular, your code should produce (no pun intended!) a final dictionary, basket_rules, that meet these conditions (read carefully!):
The keys are pairs (a,b)
, where a
and b
are item names (as strings).
The values are the corresponding confidence scores, conf(ab)
.
Only include rules ab
where item a
occurs at least MIN_COUNT times and conf(ab)
is at least THRESHOLD.
Pay particular attention to Condition 3: not only do you have to filter by a confidence threshold, but you must exclude rules ab
where the item a
does not appear "often enough." There is a code cell below that defines values of MIN_COUNT and THRESHOLD, but your code should work even if we decide to change those values later on.
Exercise 11: Your task. (basket_rules_test: 4 points). Your final task in this notebook is to mine this dataset for pairwise association rules. In particular,
your code should produce (no pun intended!) a final dictionary, basket_rules, that meet these conditions (read carefully!):
The keys are pairs
(a,b), where
a and
b are item names (as strings).
The values are the corresponding confidence scores, conf(a=>b).
Only include rules
a=>b where item
a occurs at least MIN_COUNT times and
conf(a=>b) is at least THRESHOLD.
Pay particular attention to Condition 3: not only do you have to filter by a confidence threshold, but you must exclude rules
a=>b where the item
a does not appear "often enough." There is a code cell below that defines values of MIN_COUNT and THRESHOLD, but your code should work even if we decide
to change those values later on.
Aside: Why would an analyst want to enforce Condition 3?
Your solution can use the groceries_file string variable defined above as its starting point. And since it's in the same notebook, you may, of course, reuse
any of the code you've written above as needed. Lastly, if you feel you need additional code cells, you can create them after the code cell marked for your
solution but before the code marked, ### TEST CODE ###.
Your solution can use the groceries_file string variable defined above as its starting point. And since it's in the same notebook, you may, of course, reuse any of the code you've written above as needed. Lastly, if you feel you need additional code cells, you can create them after the code cell marked for your solution but before the code marked, ### TEST CODE ###
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions