Predict before they leave!
In this exercise, you will use the variables you just created to predict how long current employees will stay.
In the previous exercise, you fitted the data to a CoxPHFitter
model object called cph
. You also created the following variables to use for prediction:
current_employees
: DataFrame for all employees that are still present.current_employees_last_obs
: Series referring to the durations column of DataFramecurrent_employees
.
The model object cph
you just fitted the data to, DataFrame current_employees
, and Series current_employees_last_obs
are loaded for you. Now you can use them to help the HR department with this prediction task!
This exercise is part of the course
Survival Analysis in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Predict survival function conditional on existing durations
____.predict_survival_function(____)