GithubHelp home page GithubHelp logo

gargargargar / the-happiness-project Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 4.0 13.39 MB

2020 Hacklytics Project

License: MIT License

Python 1.87% Jupyter Notebook 98.13%
happiness-score lasso-regression country-happiness dataset socioeconomic-factors

the-happiness-project's Introduction

The Happiness Project

Pinpointing the factors that make countries the happiest!

Inspired by the 2020 Hacklytics' theme of analyzing data for social good, we focused on people's perception of countries around the world. We wanted to

  1. Determine which significant socioeconomic factors have the most effect on a country's happiness, and
  2. Create a model that accurately predicts the happiness value of any given country based on 10-20 of its socioeconomic factors.

What We Accomplished

At the conclusion of the hackathon/datathon, we were able to create a lasso regression that had a ~73% accuracy of predicting a nation's happiness value. We further identified 10 of the most important socioeconomic development factors that affected a country's happiness score, listed as follows:

  1. Life expectancy of females at birth
  2. Urban population (% of total population)
  3. Access to electricity (% of population)
  4. People using at least basic water drinking services
  5. Birth rate, crude
  6. GDP per capita (constant 2010 US$)
  7. Urban population
  8. Urban population growth
  9. Fixed broadband subscriptions
  10. Incidence of tuberculosis (per 100,000 people)

This project was created by Chris Fan, Jinghan (Michael) Chen, Garcia (Hung-Wei) Lu, and Michael Oh-Yang.

Phase 1 - Identifying Datasets

We initially identified World Bank's World Development Indicators as a major reference dataset. We realized that we wanted to utilize this comprehensive set of data, which includes around 1400 different features for a nation and up to 50 years worth of datapoints, to find out how different socioeconomic factors affect people's lives and how indicative these factors can be of people's lives.

Screenshot of the raw World Development Indicators dataset

We researched further to find out what would be a good indicator for people's quality of lives, and we discovered the World Happiness Report dataset available on Kaggle. Our goal now focused on

  1. determining correlation between the development indicators and the happiness scores, and
  2. creating a regression that can predict happiness scores based on the development indicators.

Phase 2 - Dataset Cleaning

While the World Development Indicators (WDI) dataset was relatively comprehensive, there were still a fair number (out of 1400) of features that were significantly lacking in data availability. Based on the fact that our happiness value dataset only contained data from 2015-2018, we cleaned the WDI dataset to

  1. only contain data form 2015-2019, and
  2. only contain features lacked data for no less than 20 countries.

Screenshot of clean dataset

In consideration of future model-building, we decided to pick 15 indicators out of the 100 we have left after data cleaning. We achieved this through

  1. analyzing the correlation between the 100 indicators and the happiness score, and Initial correlation analysis
  2. using Anaconda's Orange to create a decision tree. Decision tree

Phase 3 - Lasso Regression

With the now-clean dataset, we plugged each countries happiness scores and development indicators into scikit-learn's lasso regression model. We tested a few test size values to optimize the result, and our final model, using a test size of 0.2, yielded a accuracy rating of 73%. We also identified the most influential factors as determined by our lasso regression, listed by our results.

References

Dataset Sources

the-happiness-project's People

Contributors

chrisfence avatar gargargargar avatar jinghanchen99 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.