Coder Social home page Coder Social logo

nihadtp / covid19patientprediction Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5 KB

MAchie learning model developed to predict recovery of covid19 patient based on sex, age and state there living.

Scala 100.00%
machine-learning data-science data-mining random-forest-classifier covid19 covid19india distributed-computing

covid19patientprediction's Introduction

covid19PatientDeathPredictionProbability

This project uses Random Forest classifier module in spark ml library to predict probability of recovery of a covid19 patient based on there age, sex and state they are residing.

##Probability of recovery of different states from age 10 to 90

image

  • Here x-axis is age and y-axis probability percentage.
  • Here we can notice that probability decreases as age increases.
  • Also probability of recovery is different for different states duu to difference in population, civic sense, hygiene etc
  • By dividing whole dataset into 80-20 as training and test data. It is calculated to be accurate upto 93%
  • Main data source are from covid19API in CSV format(Almost 50% data did not have sufficeint information)

Prequisites

  1. Scala 2.11.12
  2. Spark 2.4.6
  3. SBT 1.0
  4. Cassandra 4.0
  5. cqlsh 5.0.1

Cassandra Set up

  • Log into cassandra cqlsh and create Keyspace called covid19 and table called prediction
cqlsh> CREATE TABLE covid19.prediction(sex text, age float, state text, p_sex double, p_state double, p_state double,\ PRIMARY KEY (state_prop, country_prop, date, uuid));

Steps to build jar

  1. First clone github project to a folder

  2. Download csv data soircce to local covidAPI

  3. In src/main/scala/covid19PredictionApp.scala file. Edit the following

val rawData = spark.read.format("csv")
      .option("header", "true")
      .load("/home/nihad/machine_learning/patient_data/*.csv")

Under load function function put in your correct path

  1. Then build fat jar using sbt assembly plugin
sbt assembly
  1. In target folder you will find covid19Prediction-assembly.jar file

  2. Start your cassandra service

  3. Go to spark folder

spark-submit ~/pathtoyourtargetfolder/covid19Prediction-assembly.jar

Here app starts and fetches data from the folder, converts them to Dataframe and trains using Random Forest classifier And predicted values are then written to cassandra table.

covid19patientprediction's People

Contributors

nihadtp avatar

Watchers

 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.