This repository is the code of Final Project (part4) for course Database Systems by Prof. Jean-Claude Franchitti. We have deploy the application using Microsoft Azure Cloud Service at here. Please feel free to try out!
The code is using Flask micro-framework. It also uses PostgreSQL as a database. Input data will be passed through RestFUL API for backend processing. CRUD operations are implemented using Object–Relational Mapping (ORM), and data is then stored in PostgreSQL database. We integreated an XGBoost model for insurance cost prediction. The prediction function is also called by RestFUL API.
This repository is based on a lab from the NYU DevOps and Agile Methodologies graduate course CSCI-GA.2820-001 on Behavior Driven Development with Flask and Behave
Many enterprises still rely on structured data in traditional relational databases and data warehouses. However, to drive business growth, digital transformation, and enhance user experience and organizational excellence, they need real-time insights. To achieve this, enterprises are developing additional data sources to manage large amounts of unstructured data, enabling semi real-time big data analytics and the creation of machine/deep learning and AI digital solutions.
We try to build a project following this idea, and provide a end-to-end web app integrating relational database and ML models.
In this project, We focus on the business use case of insurance cost prediction: customer's health condition and daily habits are significant indicators to their insurance cost, and insurance companies rely heavily on precise prediction models to provide appropriate insurance policies and products. With machine learning models, for insurance companies, we help them accelerate cost assessment procedures, and lower their risks on unpredicted insurance claims; for customers, we help them get their suitable insurance products.
./service/routes.py -- the main Service using Python Flask
./service/models.py -- the data models for persistence
./service/common -- a collection of status, error handlers and logging setup
./tests/test_routes.py -- unit test cases for the server
./tests/test_models.py -- unit test cases for the model
docker pull gorgeous/dbs-webapp-24su:v6
docker docker run --rm -p 8080:8080 --platform linux/amd64 gorgeous/dbs-webapp-24su:v6
Now you can access in your browser with this URL: http://localhost:8080/
We have deploy the application using Microsoft Azure Cloud Service at here. Please feel free to try out!
-
To Create a health record:
- Fill out the form with valid data. (Leave Record ID blank; age must be positive integer; BMI must be positive number)
- Click "Create" button.
- Wait the record id appears in the form, together with a flash message says "success"
-
To Retrieve a health record:
- Enter record id.
- Click "Retrieve" button.
- If succcess: all the fields will be filled with data, If fail: flash message says "404 Not Found"
-
To Update a health record:
- Fill out the form with valid data, including Record ID of the record you want to modify.
- Click "Update" button.
- If success, then a flash message says "success". If you retrieve the record later, the fields will be updated.
-
To Delete a health record:
- Enter record id.
- Click "Delete" button.
- If succcess: then a flash message says "Record has been Deleted!"; If the record does not exist: then a flash message says "Server error!"
-
To predict the cost of a health record:
- After you create the record !!!
- Enter the record id.
- Click "Predict" button.
- If succcess: then a flash message says "Success" and the predicted results will be displayed in the result table below.
- Cost: predicted insurance cost
- Suggestion: suggestions to the insurance operator. (Accept, Conditional Accept, and Refuse)
- Plan: different level of plans could be applied. (Normal, Enhanced Version, Extra Condition Version, and Only Endorsed by Manager)
Copyright (c) 2016, 2024, John J. Rofrano. All rights reserved.
Licensed under the Apache License. See LICENSE
This repository is part of the NYU graduate class CSCI-GA.2810-001: DevOps and Agile Methodologies taught by John Rofrano, Adjunct Instructor, NYU Courant Institute, Graduate Division, Computer Science.




