Exercise

Employee churn study

Acquiring new employees as replacements incurs hiring costs and training costs. You want to predict how long current employees will stay. This exercise focuses on the first steps to prepare to make predictions.

You have a DataFrame called employees. It contains data about 1470 employees (churned and present) and how their survey answers. The survey is across the following dimensions:

  • environment_satisfaction
  • job_satisfaction
  • relationship_satisfaction
  • work_life_balance

Additionally, years_at_company means the duration employees have worked and attrition indicates if the employee has churned (1 if churn, 0 otherwise).

Sample rows are printed for you in the console. The CoxPHFitter class is imported for you from the lifelines package.

Instructions 1/2

undefined XP
    1
    2
  • Instantiate a CoxPHFitter object.
  • Fit the CoxPHFitter model object with your data using all other columns.