1. Learn
  2. /
  3. Courses
  4. /
  5. Survival Analysis in Python

Exercise

How do prior arrests impact re-arrest rate?

During the study of the prison data, you obtain new information about each convict, such as the number of convictions prior to current incarceration prio.

You want to visualize how different values of prio impact the baseline survival function modeled with WeibullAFTFitter.

The WeibullAFTFitter class has been imported and a new instance aft has been created. The matplotlib.pyplot library is imported as plt, and the pandas and numpy libraries are imported as pd and np, respectively. Use the console to explore the DataFrame and its column names as needed.

Instructions 1/3

undefined XP
    1
    2
    3
  • Fit the prison DataFrame to WeibullAFTFitter class instance aft.