Git Product home page Git Product logo

covid19-survival-calculator's Introduction

COVID-19 Survival Calculator

COVID-19 Global Hackathon

This calculator is a web application that allows users who have coronavirus (COVID-19) to calculate the probability of their survival. We devised a machine learning algorithm that can accurately predict this value, taking into account a wide variety of factors, including information such as pre-existing medical conditions and local population statistics.


Technologies used in this project

XGBoostDjangoPostgreSQLPandasJinjaNokogiri

  • XGBoost
    • Developed a gradient boosting machine learning algorithm to accurately predict coronavirus survival rate (ensembled with a LightGB model for 95% AUC)
  • LightGBM
    • Developed a gradient boosted model with optimized hyperparameters to predict coronavirus survival (ensembled with an XGBoost model for 95% AUC)
  • Django
    • Created a custom REST API for the front-end to call for making predictions and storing user data
  • PostgreSQL
    • Maintained a database to efficiently access and update the aggregated datasets with new user data and live COVID-19 updates
  • Pandas
    • Ran data analysis on many online datasets to accumulate appropriate training data for our machine learning model
  • Jinja
    • Utilized templating engine to efficiently produce a functional front-end
  • Nokogiri
    • Web scraped COVID-19 status pages to download and form datasets

Programming languages

PythonJavaScriptRuby

  • Python (3.7.7)
    • Project's main programming language
    • Created the machine learning algorithm and back-end API
  • JavaScript
    • Used for developing the front-end website, along with Jinja and HTML/CSS
  • Ruby
    • Required for web scraping COVID-19 status pages for live data

Online datasets

How it works

This calculator is meant for patients who have tested positive for coronavirus to calculate their chance of survival. It can also be used by doctors to determine which patients to treat first.

When the user visits the website, the website provides the user with a form with several input fields that are needed for the prediction algorithm, including age, gender, days between symptom onset and hospitalization, travel to any high risk areas, and any pre-existing medical conditions. Once this form is submitted, the website collects this data, along with the user's public IP address, and sends the data to the back-end API's primary endpoint for prediction. The back-end then uses an external API to geolocate the user to a specific country and region. The user's country and region is then cross-referenced with the live mortality rate datasets and population density datasets. All of this data is saved into the PostgreSQL database to be later converted into a new, merged dataset for retraining the model. Finally, the data is inputted into the gradient boosting machine learning algorithm to formulate an accurate prediction of the probability of survival.

Machine learning models used

All of these factors are used to train two machine learning models: an XGBoost model and a LightGBM model. Both models employ algorithms that use gradient boosting to make predictions. XGBoost starts with one model, calculates the loss function of that model, creates a new model with parameters that minimize this loss function through gradient descent, and then adds that model to an ensemble. LightGBM is similar, but runs slightly faster with the risk of increased overfitting based on leaf-wise splitting of decision trees.

The results from both models are weighted according to their relative accuracy to produce a weighted average. Any medical condition the user selects is then accounted for by inputting this weighted average into a sigmoid function with different weights for different medical conditions. This adjusted average is then displayed to the user on the website.

Team

covid19-survival-calculator's People

Contributors

computer-geek64 avatar pranavpusarla avatar varunlakshmanan 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.