Skip to content

This repository contains code for a life expectancy prediction system using linear regression and Flask. The model is trained on a dataset of life expectancy data and is deployed on the web. Contributions are welcome.

License

Notifications You must be signed in to change notification settings

axewhyzed/Life-Expectancy-Prediction-Model-using-Flask

Repository files navigation

Life-Expectancy-Predictor-using-Linear-Regression-and-Flask

This project is a life expectancy prediction system that uses linear regression to predict life expectancy based on various factors such as adult mortality, alcohol consumption, percentage expenditure, Hepatitis B, Measles, Body Mass Index (BMI), Polio, total expenditure, Diphtheria, HIV/AIDS, Gross Domestic Product (GDP), population, income composition of resources, and schooling. The model is deployed on the web using Flask.

Code

The linear_reg.py script contains the code to generate the linear regression model. The script loads the Life Expectancy Data from a CSV file, drops unnecessary columns, and removes missing values. The remaining columns are used to train the linear regression model. The trained model is saved to a pickle file for later use.

The app.py script contains the code for the Flask deployment server. The trained model is loaded from the pickle file and used to predict life expectancy based on the user's input values. The predicted value is displayed on the web page.

Usage

To use this life expectancy prediction system, clone the repository and run the Flask app using the following command:

python app.py

Then, navigate to http://localhost:5000 in your web browser. Enter the required input values and click on the "Predict" button. The predicted life expectancy value will be displayed on the screen.

Dataset

The Life_Expectancy_Data.csv file used in this project is taken from Kaggle

Contributing

Contributions are always welcome! Please feel free to submit a pull request or open an issue if you find a bug or have a suggestion for improvement.

Support the Project

You can support the project by adding a star to it !

About

This repository contains code for a life expectancy prediction system using linear regression and Flask. The model is trained on a dataset of life expectancy data and is deployed on the web. Contributions are welcome.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published