A comprehensive data analysis project examining 10 years (2015–2024) of World Happiness Report data across 175 countries and 10 global regions, combining Exploratory Data Analysis with Machine Learning to uncover what truly drives national happiness.
- Overview
- Dataset
- Project Structure
- Methodology
- Key Findings
- Machine Learning
- India Deep Dive
- Tech Stack
- How to Run
- Author
This project analyzes the World Happiness Report — an annual publication by the UN Sustainable Development Solutions Network — to understand:
- What factors most strongly predict national happiness?
- How do happiness levels vary across regions and over time?
- Where does India stand, and what can be improved?
The analysis combines statistical EDA (correlation analysis, distribution analysis, regional comparisons) with Machine Learning (Linear Regression & Random Forest) to validate findings from multiple angles.
| Attribute | Detail |
|---|---|
| Source | World Happiness Report (Gallup World Poll) |
| Records | 1,502 |
| Countries | 175 |
| Regions | 10 |
| Time Span | 2015 – 2024 |
| Features | 11 columns |
| Feature | Description |
|---|---|
| Happiness Score | Overall happiness rating |
| GDP per Capita | Economic output per person |
| Social Support | Having someone to count on |
| Healthy Life Expectancy | Expected years of healthy life |
| Freedom to Make Life Choices | Perceived personal freedom |
| Generosity | Willingness to donate |
| Perceptions of Corruption | Trust in government & business |
World-Happiness-Index-Analysis/
├── data/
│ └── world_happiness_combined.xlsx # Source dataset
├── notebook/
│ └── world_happiness_analysis.ipynb # Complete analysis notebook
├── presentation/
│ └── Keshav Agarwal_1000.pptx # PowerPoint presentation
├── report/
│ ├── World_Happiness_Analysis_Report.pdf # Detailed PDF report
│ └── charts/ # 17 exported visualizations
│ ├── 01_distribution.png
│ ├── 02_region_avg.png
│ ├── ...
│ └── 17_india_factors_trend.png
├── .gitignore
└── README.md
Raw Data (Excel)
→ Data Cleaning (3 missing values fixed via Mode imputation)
→ Univariate Analysis (distributions, box plots)
→ Bivariate Analysis (correlations, scatter plots)
→ Regional Analysis (trends, comparisons)
→ India Deep Dive (benchmarking, factor decomposition)
→ Machine Learning (Linear Regression + Random Forest)
→ Conclusions & Report
- 3 missing values in
Regional indicatorfor Greece, Cyprus, and Gambia - Fixed using Mode imputation (most frequent region from other years)
- Zero duplicates confirmed; data integrity verified
- GDP per Capita is the strongest predictor of happiness — confirmed by both correlation analysis and ML feature importance
- Social Support is the second strongest predictor — community bonds matter enormously
- Nordic countries (Finland, Denmark, Norway) consistently dominate the top rankings
- Sub-Saharan Africa consistently ranks lowest
- Latin America scores higher than GDP would predict — suggesting unmeasured cultural factors
- Generosity and Corruption Perception have the weakest influence on happiness
Two models were trained to predict Happiness Score from the 6 contributing factors:
| Model | Purpose |
|---|---|
| Linear Regression | Baseline — interpretable, outputs feature coefficients |
| Random Forest Regressor | Advanced — captures non-linear patterns, outputs feature importance |
- Data Split: 80% train / 20% test (random_state=42)
- Metrics: R² Score, MAE, RMSE
- Result: Random Forest outperforms Linear Regression, confirming non-linear relationships between factors
- Feature Importance: GDP per Capita > Social Support > Health > Freedom > Corruption > Generosity
- India consistently ranks in the lower half among 175 countries
- Happiness score falls below the global average but near the South Asia average
- GDP per Capita is a relative strength vs. South Asian neighbors
- Social Support and Freedom are the weakest factors dragging India's score down
- Economic growth alone has not translated into proportional citizen happiness
| Tool | Purpose |
|---|---|
| Python 3 | Programming language |
| Jupyter Notebook | Interactive analysis |
| pandas | Data manipulation |
| numpy | Numerical computing |
| matplotlib | Visualization |
| seaborn | Statistical visualization |
| scikit-learn | Machine Learning (LinearRegression, RandomForestRegressor) |
-
Clone the repository
git clone https://github.com/KeshavAg08/World-Happiness-Index-Analysis.git cd World-Happiness-Index-Analysis -
Install dependencies
pip install pandas numpy matplotlib seaborn scikit-learn openpyxl
-
Open the notebook
jupyter notebook notebook/world_happiness_analysis.ipynb
-
Run all cells to reproduce the analysis and generate charts
The project generates 17 charts covering:
| Charts | Content |
|---|---|
| 01–02 | Score distribution, regional averages |
| 03–04 | Top 10 and Bottom 10 countries |
| 05 | Global happiness trend over time |
| 06–08 | Correlation heatmap, feature importance, GDP scatter |
| 09–12 | India: trend, comparison, neighbors, factors |
| 13–14 | Regional trends and box plots |
| 15–17 | Feature distributions, box plots, India factor trends |
Keshav Agarwal