CommencerCommencer gratuitement

Visualizing a deployed model's output over time

In this exercise, you will utilize data from two separate months - January and February - to monitor changes in your heart disease model's predictions over time. As you know, your model has been trained to perform a binary classification task of heart disease classification, and you have recorded the model's predictions in the logs for these two months.

Assume that the logs of the model's predictions over the last two months have been generated through Elastic Beanstalk and have been imported as pandas DataFrame, called logs_january and logs_february, with a target column of the predictions for that month. matplotlib.pyplot has been imported as plt.

Cet exercice fait partie du cours

End-to-End Machine Learning

Afficher le cours

Instructions

  • Visualize the distribution of your model's predictions in January and February over time by plotting adjacent bar graphs of the model's target predictions.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

fig, ax = plt.subplots(1, 2, figsize=(15, 6))  # 1 row, 2 columns
# January Plot
logs_january['____'].____.plot(kind=____, ax=ax[0])
ax[0].set_title('Distribution of Predicted Classes - January')
ax[0].set_xlabel('Class')
ax[0].set_ylabel('Frequency')

# February Plot
logs_february['____'].____.plot(____=____, ax=ax[1])
ax[1].set_title('Distribution of Predicted Classes - February')
ax[1].set_xlabel('Class')
ax[1].set_ylabel('Frequency')

plt.tight_layout()
____.____
Modifier et exécuter le code