HR 分析入門

HR 分析:用 Python 預測員工流失

Hrant Davtyan

Assistant Professor of Data Science American University of Armenia

什麼是 HR 分析?

  • 也稱為 People analytics
  • 以資料驅動方式管理職場人力。
HR 分析:用 Python 預測員工流失

HR 分析可解的問題

  • 招募/評量
  • 留任
  • 績效評估
  • 學習與發展
  • 協作/團隊組成
  • 其他(如缺勤)
HR 分析:用 Python 預測員工流失

員工流動(turnover)

  • 員工流動指員工離開公司的過程
  • 亦稱員工流失或員工離職
  • 可能帶來高成本
  • 可能影響公司的招募或留任決策
HR 分析:用 Python 預測員工流失

課程結構

  1. 描述並處理資料集
  2. 預測員工流動
  3. 評估與調校預測
  4. 選定最終模型
HR 分析:用 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 分析:用 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 分析:用 Python 預測員工流失

唯一值

print(data.salary.unique())
array(['low', 'medium', 'high'], dtype=object)
HR 分析:用 Python 預測員工流失

一起來練習吧!

HR 分析:用 Python 預測員工流失

Preparing Video For Download...