Exercise

Passing two tests

Put yourself in the shoes of one of the university students. You have two tests coming up in different subjects, and you're running out of time to study. You want to know how much time you have to study each subject to maximize the probability of passing both tests. Fortunately, there's data that you can use.

For subject A, you already fitted a logistic model in model_A, and for subject B you fitted a model in model_B. As well as preloading LogisticRegression from sklearn.linear_model and numpy as np, expit(), the inverse of the logistic function, has been imported for you from scipy.special.

Instructions 1/4

undefined XP
  • 1

    Use model_A to predict if you'll pass the test with 6, 7, 8, 9, or 10 hours of study and model_B with 3, 4, 5, or 6.

  • 2

    Get the probability of passing for test A with 8.6 hours of study and test B with 4.7 hours of study.

  • 3

    Calculate the hours you need to study to have 0.5 probability of passing the test using the formula -intercept/slope.

  • 4

    Calculate the joint probability of passing test A and test B.