Question

Python Question: The Pennsylvania Chocolate Institute of Health has identified a new type of disease caused...

Python

Question: The Pennsylvania Chocolate Institute of Health has identified a new type of disease caused by a diet containing insufficient amount of chocolate. Treatment requires expensive imported chocolates, covered by most insurance plans. There are only two types of patients: A. Healthy chocolate eaters B. Patients suffering from low chocolate levels The insurance company has developed a test (machine learning model) which predicts p, the probability that the current patient is of type A. The company is experimenting with a cost model: • The cost of treating a patient of type A is α • The cost of treating a patient of type B is some number treatB • The cost of not treating a patient of type A is some number notTreatA • The cost of not treating a patient of type B is some number notTreatB

Template

def q1(p,treatB, notTreatA, notTreatB):

Fill in the function q1(p, treatB, notTreatA, notTreatB), where p is the predicted probability the patient is of type A. The output of this function should be the value of α for which the insurance company is indifferent between treating and not treating the patient.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

def q1(p,treatB,notTreatA,notTreatB):

CostB = min(notTreatB,treatB)

CostA = ((1-p)/p)*CostB

if (notTreatA >= CostA):

return CostA

else:

return notTreatA

  

Add a comment
Know the answer?
Add Answer to:
Python Question: The Pennsylvania Chocolate Institute of Health has identified a new type of disease caused...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • what discuss can you make about medicalization and chronic disease and illness? Adult Lealth Nursing Ethics...

    what discuss can you make about medicalization and chronic disease and illness? Adult Lealth Nursing Ethics mie B. Butts OBJECTIVES After reading this chapter, the reader should be able to do the following: 1. Explore the concept of medicalization as it relates to the societal shift away from physician predominance of the 1970s. 2. Differentiate among the following terms: compliance, noncompliance, adherence, nonadherence, and concordance. 3. Examine cultural views with regard to self-determination, decision making, and American healthcare professionals' values...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT