IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Foundations of Probability in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Specify values to predict
hours_of_study_test_A = [[____], [____], [____], [____], [____]]

# Pass values to predict
predicted_outcomes_A = model_A.predict(____)
print(predicted_outcomes_A)

# Specify values to predict
hours_of_study_test_B = [[____], [____], [____], [____]]

# Pass values to predict
predicted_outcomes_B = model_B.____(____)
print(predicted_outcomes_B)
Modifica ed esegui il codice