Giter VIP home page Giter VIP logo

sayamalt / employee-attrition-prediction Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9.77 MB

Successfully established a machine learning model which can accurately predict whether an employee of a given company will leave it in the impending future or not, based on several employee details and employment metrics.

Home Page: https://employee-attrition-prediction-vcut.onrender.com/

License: MIT License

Jupyter Notebook 99.84% Python 0.09% HTML 0.07% Dockerfile 0.01%
binary-classification continuous-deployment continuous-integration cross-validation data-visualization exploratory-data-analysis feature-engineering hyperparameter-optimization machine-learning model-deployment model-training-and-evaluation data-exploration-and-preprocessing

employee-attrition-prediction's Introduction

Employee Attrition Project

Table of Contents

Employee Attrition How to deal with high attrition rate? Employee retention strategies

Overview

This project demonstrates how to deploy a Dockerized machine learning model on the Render platform and set up a continuous integration/continuous deployment (CI/CD) pipeline using GitHub Actions. The goal of this project is to predict employee attrition in an organization using a machine learning model.

Context

HR analytics, also known as people analytics, is a data-driven approach to managing human resources. It involves gathering and analyzing data related to employees, such as recruitment, performance, engagement, and retention, to derive insights and make informed decisions. This project explores the application of HR analytics in a hypothetical organization and showcases its benefits in optimizing workforce management.

Organization Description:

Let's consider a medium-sized technology company called "TechSolutions Inc." The company specializes in software development and has a diverse workforce across different departments, including engineering, marketing, sales, and customer support.

Objectives

The main objectives of this project are as follows:

  1. Understand the factors influencing employee attrition and job satisfaction.
  2. Identify key predictors of employee performance.
  3. Develop strategies to improve employee engagement and retention.

Prerequisites

Docker Installation

If you don't have Docker installed, you can follow the official Docker installation guide to get it set up on your system.

Getting Started

  1. Clone this repository to your local machine:

    git clone https://github.com/your-username/employee-attrition-prediction.git
    cd employee-attrition-prediction
  2. Build the Docker image:

        docker build -t your-container-name:version .
  3. Run the Docker image:

        docker run -d -p 8080:80 --name your-container-name
    • -d: Run the container in detached mode.
    • -p 8080:80: Map port 8080 on your host to port 80 inside the container.
    • --name your-container-name: Assign a name to your container.
    • your-container-name: Use the name you specified when building the container.

Deploying a Dockerized Machine Learning Model to Render

This guide provides step-by-step instructions on deploying a Dockerized machine learning model to Render, a platform for hosting web applications and services. By following this guide, you can make your machine learning model accessible over the internet as a web service.

Prerequisites

Before getting started, make sure you have the following prerequisites:

  • A Render account (Sign up at https://render.com/)
  • A machine learning model packaged in a Docker container
  • Docker installed on your local development machine

Steps

  1. Create a New Web Service on Render

    • Log in to your Render account and click the "Add New" button on the dashboard.
    • Choose "Web Service" as your service type.
  2. Configure Your Web Service

    • Give your service a name and select the appropriate region.
    • Under "Build and Deploy," choose "Use a Dockerfile" and specify the path to your Dockerfile.
    • Click the "Create Web Service" button.
  3. Configure Environment Variables

    If your machine learning model requires any environment variables (e.g., API keys or configuration settings), you can configure them under the "Environment" section in the Render dashboard.

  4. Set Up Custom Domains (Optional)

    If you have a custom domain, you can configure it to point to your Render service. You'll need to set up DNS records and configure SSL if necessary.

  5. Deploy Your Service

    • Push the "Deploy" button in the Render dashboard.
    • Render will automatically build and deploy your Docker container to a web service.
  6. Access Your Deployed Model

    Once the deployment is complete, you can access your machine learning model by visiting the provided URL in your Render dashboard.

Automation Testing

To perform automation testing on the deployed machine learning model, a retrain.py script was written in which the model is initially re-trained on the updated dataset (in case of any changes) and subsequently, the model performance is optimized and evaluated on the test dataset using extensive cross validation and hyperparameter tuning. To assess the model's performance, the pytest module was used to set up various unit test cases. Furthermore, a continuous integration (CI) pipeline was configured using GitHub actions to run the tests automatically on every push to the repository.

Model Monitoring and Logging

A formal and structured approach was adopted to meticulously record the performance evaluation metrics of the model. Leveraging the capabilities of the logger.info function from Python's logging module, I ensured that essential metrics such as accuracy, precision, recall, F1 score and ROC-AUC score were systematically logged. This not only provided real-time insights into the reliability and efficiency of the machine learning model but also facilitated a comprehensive assessment of its predictive performance over time.

CI/CD Pipeline

The CI/CD pipeline is automatically triggered when you push to the main branch. It builds the Docker image, pushes it to Docker Hub, and deploys the model on Render. Configuration details can be found in .github/workflows/main.yaml.

Additional Resources

License

This project is licensed under the MIT License - see the LICENSE file for details.

employee-attrition-prediction's People

Contributors

sayamalt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.