Giter Site home page Giter Site logo

martmallol / nm-life-expectancy Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 28.56 MB

Numerical Methods: "Life Expectancy & Linear Regression" Group Project - 2nd Semester 2021 - Computer Science, UBA

Jupyter Notebook 35.53% CMake 2.15% C 1.52% C++ 50.97% Makefile 0.84% Shell 0.11% Cuda 0.66% Fortran 6.75% Python 1.40% JavaScript 0.04% CSS 0.03%
linear-regression r2-score rmse-score cook-distance least-square-regression life-expectancy prediction residuals t-student-distribution

nm-life-expectancy's Introduction

Numerical Methods: "Life Expectancy and Linear Regression" Group Project

Made by Oscar Álvarez, Andrés Barbuto, Sebastián Bocaccio and Martín Mallol, 2021, 2nd semester

Life Expectancy

Local Setup

  1. Create an empty git repo and clone this project
git init
git remote add origin <new-git-url>
  1. Download the pybindandeigen` repos as submodules
git submodule init
git submodule add https://github.com/eigenteam/eigen-git-mirror
git submodule add https://github.com/pybind/pybind11
git mv eigen-git-mirror eigen
# We choose the versions of eigen and pybind
cd pybind11/ && git checkout v2.2.4 && cd ..
cd eigen && git checkout 3.3.7 && cd ..
  1. Install requirements (Previously, activate the virtual environment in your PC. See below.)
pip install -r requirements.txt
  1. Decompress data
cd data && gunzip *.gz && cd ..
  1. Run Jupyter
jupyter lab

That's it!

Python's virtual environment creation

With Python3 (this one worked best for me)

python3 -m venv your-project-name
source your-project-name/bin/activate

With pyenv

curl https://pyenv.run | bash

Then, it is suggested to add some code lines into the basrch. After that, RESTART THE SHELL and add the following code...

pyenv install 3.6.5
pyenv global 3.6.5
pyenv virtualenv 3.6.5 your-project-name

On the project's directory:

pyenv activate your-project-name

With Conda

conda create --name your-project-name python=3.6.5
conda activate your-project-name

Dependencies installment

pip install -r requirements.txt

How to run Jupyter Notebooks

1st way

cd notebooks
jupyter lab

2nd Way

jupyter notebook

Compilation

Execute the first cell of the cm.ipynb notebook.

Overview

This project tries to analise a vast dataset provided by the World Health Organization. It attempts to compare a country's life expectancy with other attributes, searching for a correlation and explanation on why life expectancy on that country/region has that value.

First, an exploratory analiis is made, looking for outliers or curious cases on the dataset. Then, we add new info to the provided dataset by attaching attributes such as: suicide rates, viruses, geographic location, deseases, etc. With all this information on the palm of our hand, we made multiple experiments searching for a reason on why these characteristics may impact life expectancy on a specific country or region.

Project's directories and files

In data/ one can find the principal dataset and all the .csv files added and utilised on the project.

In notebooks/ reside all the experiments we made.

In src/ C++ code can be found. There, we implemented the Least Square Method.

Finally, Informe.pdf is the essay.

Users should be able to

  • Compile and run the C++ code.
  • Run every Notebook in the project (experiments and testing).
  • Read the essay and compare our conclusions with theirs.

Built with

  • C++
  • Python
  • Jupyter Notebooks
  • Life Expectancy WHO (World Health Organization) dataset

What I learnt

  • Add new information to an existent dataset
  • Find outliers, and similarities on different attributes of an object.
  • Work with linear regression.
  • Apply studentized Residuals, H Leverage, Cook Distance, influence plots.
  • Utilise metrics such as $R^2$, $R^2$ adjusted and RMSE.

nm-life-expectancy's People

Contributors

martmallol avatar

Stargazers

 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.