Question: Using python to create a class called Bayesian Scenario which accomplishes the following. It will be accessed the code using two requests. 1) make_me_a_set(n, A,

Using python to create a class called Bayesian Scenario which accomplishes the following.Using python to create a class called Bayesian Scenario which accomplishes the

It will be accessed the code using two requests.

1) make_me_a_set(n, A, B, B_A)

2) make_me_a_set(n, A, B, B_A, B_notA)

Each of these functions should return a pandas data frame that meets the parameters.

Ideally, these sets would be randomly generated rather than simply prescribed but it is up to you.

the df will be of the form

A, B

1,1

0,1

1,1

....

1 and 0 may be replaced with True and False if you wish.

Create a class called Bayesian Scenario which accomplishes the following. O o Given A, B, and B|A, and test proportion and sample size(n) Randomly create a training group and a test group matching the test proportion and n Observe the rates of A, B, AB and B]A and compare to expected values (these should be very very close or you did it wrong.) Output should look like Instantiation should look like www O predicted_A 0.0859 observed 0.0901 predicted_B 0.3019 observed 0.2945 predicted_A B 0.1677 observed 0.1803 predicted_B|A 0.5895 observed 0.5893 O scenario = BayesianScenario (descriptionn, .09, .3, .6) observed error percent error A -0.0466% percent error B 0.0251% percent error AB -0.06994 percent error BA 0.00033 True Error percent error A -0.0456% percent error B 0.0063% percent error A B -0.06838 percent error BA -0.01754 Create a class called Bayesian Scenario which accomplishes the following. O o Given A, B, and B|A, and test proportion and sample size(n) Randomly create a training group and a test group matching the test proportion and n Observe the rates of A, B, AB and B]A and compare to expected values (these should be very very close or you did it wrong.) Output should look like Instantiation should look like www O predicted_A 0.0859 observed 0.0901 predicted_B 0.3019 observed 0.2945 predicted_A B 0.1677 observed 0.1803 predicted_B|A 0.5895 observed 0.5893 O scenario = BayesianScenario (descriptionn, .09, .3, .6) observed error percent error A -0.0466% percent error B 0.0251% percent error AB -0.06994 percent error BA 0.00033 True Error percent error A -0.0456% percent error B 0.0063% percent error A B -0.06838 percent error BA -0.01754

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!