人力资源分析简介

HR Analytics:用 Python 预测员工流失

Hrant Davtyan

Assistant Professor of Data Science American University of Armenia

什么是人力资源分析?

  • 亦称 People analytics(人员分析)
  • 一种以数据驱动的用工管理方法
HR Analytics:用 Python 预测员工流失

HR 分析解决的问题

  • 招聘/测评
  • 留任
  • 绩效评估
  • 学习与发展
  • 协作/团队构成
  • 其他(如缺勤)
HR Analytics:用 Python 预测员工流失

员工流失

  • 员工流失:员工离开公司的过程
  • 亦称员工减员或员工流转(churn)
  • 可能带来高成本
  • 影响招聘与留任决策
HR Analytics:用 Python 预测员工流失

课程结构

  1. 描述与处理数据集
  2. 预测员工流失
  3. 评估与调优预测
  4. 选择最终模型
HR Analytics:用 Python 预测员工流失
import pandas as pd
data = pd.read_csv("turnover.csv")

data.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 14999 entries, 0 to 14998
Data columns (total 10 columns):
satisfaction_level       14999 non-null float64
last_evaluation          14999 non-null float64
number_project           14999 non-null int64
average_montly_hours     14999 non-null int64
time_spend_company       14999 non-null int64
work_accident            14999 non-null int64
churn                    14999 non-null int64
promotion_last_5years    14999 non-null int64
department               14999 non-null object
salary                   14999 non-null object
dtypes: float64(2), int64(6), object(2)
memory usage: 1.1+ MB
HR Analytics:用 Python 预测员工流失

数据集

data.head()
   satisfaction  evaluation  number_of_projects  ...  promotion  department  salary
0          0.38        0.53                   2  ...          0       sales     low
1          0.80        0.86                   5  ...          0       sales  medium
2          0.11        0.88                   7  ...          0       sales  medium
3          0.72        0.87                   5  ...          0       sales     low
4          0.37        0.52                   2  ...          0       sales     low
HR Analytics:用 Python 预测员工流失

唯一值

print(data.salary.unique())
array(['low', 'medium', 'high'], dtype=object)
HR Analytics:用 Python 预测员工流失

让我们练习!

HR Analytics:用 Python 预测员工流失

Preparing Video For Download...