CommencerCommencer gratuitement

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 DataFrame current_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!

Cet exercice fait partie du cours

Survival Analysis in Python

Afficher le cours

Exercice interactif pratique

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

# Predict survival function conditional on existing durations
____.predict_survival_function(____)
Modifier et exécuter le code