Code Monkey home page Code Monkey logo

hfms-backend's Introduction

Heart Failure Management System (Backend)

Setup

  1. Create python virtual environment python3 -m venv venv
  2. Activate virtual environment source venv/bin/activate
  3. Install library needed in requirements.txt pip install -r requirements.txt

Run Flask Server

  1. Open terminal and type

        flask -app flaskr/webserver run
  2. Hit API Endpoint with Web API Testing Client (Thunder Client, Postman API, etc.)

  3. Get Prediction

        json = {
            column1: value1,
            column2: value2, ...
        }
    
        requests.post('/predict/', data=json)
  4. Get Recommendation

        json = {
            column1: value1, # user existing lifestyle
            column2: value2, ...
            columnN: valueN # user characteristic
        }
    
        requests.post('/recommendation/', data=json)

    Will get the result of user recommended lifestyle with risk comparison with existing lifestyle. Here are one of response example

    "lifestyle" : {
        "Column1": {
             "changeStatus": "True",
             "comparison": "<= 140.372 (-0.001-140.372)",
             "description": "Minutes outdoors 9am - 5pm not work day",
             "recommendedValueInterval": "(-0.001, 140.372]"
           },
        "ColumnN": {
             "changeStatus": "Status of change compared with existing user lifestyle",
             "comparison": "<= 140.372 (-0.001-140.372)",
             "description": "Lifestyle description",
             "recommendedValueInterval": "(pd.Interval]"
            }
    },
    "currentRisk": 99.98880624771118,
    "riskAfterRecommendation": 0.022367404017132,
    "riskReduction": 99.96643884369405,
    "timeGenerated": "2024-05-17",
    "timeTaken": "14.709s"
    "status": 200,
    "statusMessage": "Success retrieving recommendation data"
  5. Get accepted data schema for JSON data by accessing both endpoint with GET HTTP Request method.

hfms-backend's People

Contributors

naufalbasara avatar

Watchers

Kostas Georgiou 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.