Git Product home page Git Product logo

bipin-k-balan / medical-insurance-cost-prediction Goto Github PK

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

Machine Learning based web application which helps users to choose an appropriate insurance premuim for subscription by predicting it based on user's details like living style, gender, smoker or not etc.

Jupyter Notebook 98.05% Python 0.21% CSS 0.52% JavaScript 0.22% HTML 1.00%
sklearn-pipeline statistical-analysis data-visualization machine-learning-algorithms linear-regressions random-forests flask-app heroku-deployement

medical-insurance-cost-prediction's Introduction

Medical-Insurance-predictor

Goal: Different persons have different body types and different living culture. So the diseases effection on them or the treatment expense for them also vary with respect to these situations. For example medical insurance premium of a smoker person may require more amount than a normal person without any bad habbits, since the probability of occurance of chronic disease are more for smokers. The main aim of this application is to help users to get overall idea about the appropriate medical insurance premium suitable for their living culture, gender and some other factors.

This is an Machine Learning based Web application deployed in heroku which will forecast the medical insurance cost based on some input features. The web application has designed in such a way that we can do predictions in 2 modes. We can get the insurance premium prediction based on providing input features from the web interface or if we want to get predictions for large dataset, we can also upload the csv file and model will give the predictions as a csv file and we can download deom the webpage using download button. Main features are Age, gender, body mass index, childrens, smoker or not, locality.

screenshot1

Data collection and training

The data is collected, after that seperated train and test data and created seperate data cleaning, transformation and feature engineering pipelines to avoid data leakage. Sklearn pipelines has been used for train data and test data preprocessing and transformations seperately inorder to reduce the complexity and for clean code approach. The jupyter notebook file attached above has contains all the Exploratory data analysis, creating sklearn pipelines and model selection in detail. 5 seperate pipelines has been used to train different regression models (Vanilla Linear regression, Lasso and Ridge versions of Linear Regressions, Decision tree, Random Forest) and also performed grid search CV for hyper parameter tuning. From the metrics results best model (Random forest is giving good accuracy than other models where decision tree is more overfitted to the dataset) has been selected and saved as pikle file. Coding has been modularized for the future enhancement.

randforest

Web Integration and Deployment

Flask micro web framework is used to create the API calls to the from the python backend code that wrapeed around saved machine learning model to the front end web interface which uses css, html and few java script codes. The code in github is pushed to heroku for deployment. Since this is for testing purpose we did not worked on the latency and replicas of same applications. If thats the case we can dokerize it and deploy it on Kubernetes orchestration framework with auto scaling based on the CPU resource utilization.

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.