Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HR Analytics & Automation Pipeline

An end-to-end HR analytics project that automates data cleaning, database storage, exploratory analysis, visualization, and automated reporting using Python, SQLite, and Power BI.


Project Overview

This project analyzes employee attrition using the IBM HR Analytics dataset and builds a fully automated analytics pipeline:

  • CSV → Auto Data Cleaning → Feature Engineering
  • SQLite Database Storage
  • Exploratory Data Analysis (EDA) in Python
  • Automated chart generation
  • PDF report generation (fpdf2) with dynamic, data-driven insights
  • Power BI dashboard integration fed directly from cleaned data output

The goal is to simulate a real-world HR analytics workflow used in business environments.


Pipeline Workflow

CSV Dataset (IBM HR Attrition) — new or updated data dropped here
↓
Auto Data Cleaning & Feature Engineering (Python - pandas) — triggers automatically
↓
Save Cleaned Data (CSV) — used as Power BI data source
↓
Store in SQLite Database (employee_attrition table)
↓
Exploratory Data Analysis (Python / pandas)
↓
Generate Charts (matplotlib)
↓
Save Charts as PNG (output/charts/)
↓
Generate PDF Report (fpdf2) — dynamic insights auto-calculated from data
↓
Power BI Dashboard (interactive analysis) — reads from cleaned CSV, refreshes on next open
↓
Final Output: HR Analytics Report + Dashboard Insights

Key Features

✔ Automated data pipeline (ETL) — automatically cleans and processes new data, then updatethe Power BI report
✔ Feature engineering (Income bands, Age groups)
✔ Attrition analysis across departments, roles, and demographics
✔ Automated PDF report generation (fpdf2)
Dynamic, data-driven insights and conclusion — auto-updated when data changes
Styled multi-page PDF — cover page, KPI cards, progress bars, themed charts
Timestamped reports — each PDF records when it was generated
✔ Data visualization (matplotlib) with consistent color theming
✔ Power BI dashboard for interactive insights — always reflects latest cleaned data


Tools & Technologies

  • Python (pandas, matplotlib, seaborn)
  • SQLite
  • fpdf2 (PDF report generation)
  • schedule (automation-ready)
  • Power BI
  • VS Code

Dashboard Overview

The Power BI dashboard connects directly to the cleaned CSV output. Re-running the pipeline with updated raw data will automatically refresh the dashboard on next open.

Executive Overview

Overview

Employee Demographics

Demographics

Attrition Deep Dive

Attrition


Key Analysis

1. Overtime is strongly linked to attrition

Employees who work overtime show significantly higher attrition rates, indicating workload imbalance and work-life pressure as key retention risks.


2. Highest attrition department is auto-detected

The report automatically identifies whichever department has the highest attrition count and rate, no manual updates needed when data changes.


3. Income level influences retention

Employees in lower income bands are more likely to leave. The report calculates and displays the real income gap between employees who left and those who stayed.


4. Job satisfaction impacts attrition

If job satisfaction data is available, the report automatically includes a satisfaction score comparison between leavers and stayers.


5. Conclusion tone adapts to data

The report conclusion dynamically reflects the current attrition rate:

  • Below 10% → "healthy and within acceptable range"
  • 10–20% → "moderate and warrants attention"
  • Above 20% → "high and requires immediate intervention"

Automated Report

The system generates a fully styled, data-driven PDF report containing:

  • Cover page — title banner, KPI summary cards, timestamp
  • Workforce Overview — styled department table with totals
  • Department Analysis — attrition breakdown with visual progress bars
  • Visual Insights — themed matplotlib charts (attrition, income, overtime)
  • Key Insights — auto-calculated findings from live data
  • Conclusion — tone and content driven by actual attrition metrics

All insights and the conclusion are generated programmatically from the database — re-running the script after a data update will automatically reflect the latest findings.


Project Structure


hr-attrition-analysis/
│
├── data/
│ ├── raw/
│ ├── cleaned/
│
├── sql/
│ ├── hr_analytics.db 
│ └── hr_db.sqlite
│
├── scripts/
│ ├── 01_explore.py
│ ├── 02_clean_data.py
│ ├── 03_load_to_sql.py
│
├── notebooks/
│ └── hr_analysis.ipynb
│
├── output/
│ ├── charts/
│ └── figures/
│
├── generate\_report.py 
├── HR_Attrition_Report.pdf 
├── run_pipeline.py 
└── README.md


Conclusion

Workload (overtime), compensation, and department-level pressures are the primary drivers of employee attrition. The automated pipeline ensures that whenever raw HR data is updated, the entire workflow cleaning, database storage, PDF report, and Power BI dashboard reflects the latest state of the workforce without any manual intervention.

About

HR Attrition analysis project with automated reporting, SQL database integration, and Power BI dashboard.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages