Kenny Hsieh
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    IBM HR Analytics Employee Attrition & Performance === ###### tags: `Data Science` `Human Resource` `People Analytics` Digi+ Talent III Internship Project [Kenny Hsieh](https://www.facebook.com/kennyhiseh1111), 2017/9/29 ## Description [Kaggle Feature Dataset](https://www.kaggle.com/pavansubhasht/ibm-hr-analytics-attrition-dataset) This is a fictional data set created by IBM data scientists. Aim to uncover the factors that lead to **employee attrition** and construct the binary classcification prediction model. ## Dataset Overview 1470 observations **Dependent Variable** : Attrition **Independent Variable** (31 different variables in total) : - Basic Info: Age, Gender, Education, Education Field, Martial Status, Distance From Home - Work Info: Department, Job Role, Job Level, Over Time, Business Travel, Performance Rating, Stock Option Level, Job Involvement - Statisfaction: Work-Life Balance, Job Satisfaction, Relationship Satisfaction, Enviroment Satisfaction - Salary Related: Monthly Income, Monthly Rate, Daily Rate, Hourly Rate, Percent Salary Hike - Time Related: Total Working Years,Traning Time Last Year,Years At Company,Years In Current Role,Years Since Last Promotion,Years With Current Manager,Num Companies Worked ## Exploratary Data Analysis, EDA ### The Distribution of Attrition There are 1470 observations, consists of 237 obs attrition(leave), and the rest of 1233 obs are all non-attrition(stay). As we seen here, the proportion of attrition or not is near **16%(237/1470)**, shows that **this dataset is highly unbalanced**. Thus, during the modeling process, we should work out [some techniques](https://www.analyticsvidhya.com/blog/2017/03/imbalanced-classification-problem/) to tackle this problem. ![](https://i.imgur.com/RgzKcFY.jpg) ### The Distribution of Age The majority of employee are between 28 - 36 years old, while the range of age are 18 - 60. ![](https://i.imgur.com/s7nHBmn.jpg) ### Correlation Heatmap From the plot, we can clearly observe quite a lot of feeatures are poorly correlated with one another. This would be greatful for us to construct the predictive model, we don't have to apply complex feature engineering, in order to reduce correalation between features. ![](https://i.imgur.com/5bKnd4O.jpg) ### The Distribution of Monthly Income A large majority of **low monthly income** tends to leave than the group of high monthly income. ![](https://i.imgur.com/rzStSBc.jpg) ### OverTime or not There is a relatively higher percentage of people **working overtime** in the group of those who left. ![](https://i.imgur.com/Z1Ovv9W.jpg) ### Education The plot shows that the employee of **Bachelor** degree tends to leave company than the people have any other degrees. (1 'Below College', 2 'College', 3 'Bachelor', 4 'Master', 5 'Doctor') ![](https://i.imgur.com/t0d5Otb.jpg) ### Department The ratio of Attrition in **Sales Dept**. is 20%(92/446), the highest among other departments, which is greater than R&D Dept. by 7%. (Three Dept. in company: R&D, Sales, HRM) ![](https://i.imgur.com/d5N1RYu.jpg) ### Business Travel Fequency 70% of the employee are Travel_Rarely, where about 12% are Non-Travel and 18% are Travel_Frequently. There seems to be a clear indication that **those who left travelled more frequently compared to others**. ![](https://i.imgur.com/y4wa7r6.jpg) ### Martial Status **The employee whose status labeled single** have clear indication to leave the company, while the others who are married tend to be stable. ![](https://i.imgur.com/ZJuY9GM.jpg) ### The Relationship between Work-Life Balance & Distance From Home Those who rated their work-life balance relatively low were **commuting from farther away** in comparison with those who rated their work-life balance as perfect. ![](https://i.imgur.com/hY20Ou1.jpg) ## Model Stage **Accuracy Baseline: 83%** Due to the imbalance, random guessing all the employee won't leave would archieve **Acc: 83%(1233 / 1470)**. Guessing whole the prediction to majority seems to be unrealistic, though it could get you a high Acc score. We should put more attention on how well does model predicts the minority, thus, focusing on **Receiver Operating Curve AUC(ROC-AUC)** in this case. Applying **Ensemble Learning** Methodolgy to construct robust predictive model. Then using **Synthetic Minority Over-sampling Technique(SMOTE)** to solve the imbalanced problem. - Majority Voting Commitee : Random Forest - Gradient Boosting : XGBoost - XGBoost + SMOTE ### 1. Random Forest #### The importance features of RF ![](https://i.imgur.com/ZKarR0K.jpg =700x) **Top Decisive Variables :** Monthly Income, Total Working Years, OverTime, Age.. #### Metrics ![](https://i.imgur.com/O1GabTl.png) ### 2. XGBoost (eXtreme Gradient Boosting) #### The importance features of XGBoost ![](https://i.imgur.com/iSjW8dJ.jpg =600x) **Top Decisive Variables :** Total Working Year, Monthly Income, Enviroment Statisfication, OverTime, Education_Marketing... #### Metrics ![](https://i.imgur.com/v6LSM9m.png) ### 3. XGBoost with SMOTE (solve the imbalanced problem) #### The importance features of XGBoost with SMOTE ![](https://i.imgur.com/RNDxY0i.jpg =700x) **Top Decisive Variables :** OverTime, Job Satisfaction, Stock Option Level, Work-Life Balance, Age. #### Metrics ![](https://i.imgur.com/TatkCKt.png) ### Comparison As the result, **XGBoost with SMOTE** performs outstanding. Not only Acc but also ROC-AUC are highest among three models we constructed. | Model | Accuracy | ROC-AUC | | -------- | -------- | -------- | | Random Forest | 0.8665 | 0.5959 | | XGBoost | 0.8552 | 0.6059 | | **XGBoost with SMOTE** | **0.8946** | **0.8923** | ## Conclusion We have constructed a simple pipeline of predicting employee attrition, from some basic Exploratory Data Analysis to implementing Ensemble Learning models in the form of a Random Forest and XGBoost. In addition, we tackle the imbalanced data with SMOTE strategy to make the model more practical. **The final model takes less than five seconds to run and it even returns a 89% accuracy and 0.8921 auc score in its predictions.** ### Reference - [Workday, market application publishier](https://www.workday.com) - [The Geeks Arrive In HR: People Analytics Is Here](https://www.forbes.com/sites/joshbersin/2015/02/01/geeks-arrive-in-hr-people-analytics-is-here/3/#40ff20a29841) - [The Datafication of HR: People Science is Here](https://www.slideshare.net/jbersin/the-datafication-of-hr-people-science-is-here) - [Project Oxygen: 8 Ways Google Resuscitated Management](https://blog.impraise.com/360-feedback/project-oxygen-8-ways-google-resuscitated-management) - [There’s No Such Thing as Big Data in HR](https://hbr.org/2017/06/theres-no-such-thing-as-big-data-in-hr) - [人資大未來 - 挖掘巨量資料,探尋問題癥結](https://www.slideshare.net/ssuser9c0ce41/2013-sd?next_slideshow=1) - [大數據分析「潛進」辦公室,決定你的薪水還可預測你何時會離職](https://technews.tw/2014/11/10/big-data-into-office-predict-when-you-will-leave/)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully