Welcome to the Linear Regression with Flask API project! This project demonstrates the use of the sklearn library to perform linear regression and the Flask framework to create an API that serves the results of the regression. By following this guide, you will be able to set up the project, understand the functionality of the provided code, and explore the API endpoints.
This repository contains two main components:
- Linear Regression Script (
linearregression.py): This script performs a linear regression analysis on a dataset of student performance. - Flask API (
main.py): This script creates a Flask API to serve the results of the regression analysis.
main.py: The Flask application.linearregression.py: The linear regression script.EDA.ipynb: The exploratory analysis of the used data.studentsperformance.csv: The dataset used for the analysis.requirements.txt: List of Python packages required to run the project.README.md: This documentation file.
flaskmarkdownpandasscikit-learnseabornmatplotlib
Follow these steps to set up and run the project:
git clone https://github.com/xilenAtenea/LinearReg-Prediction
cd LinearReg-Predictionpython -m venv .venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
python main.py
Once the Flask application is running, the application is deployed in render, so you can access the different endpoints through the following links:
View the project documentation.
Download the dataset used for the analysis.
View the scatter plot of real vs. predicted scores along with the regression line.
View the metrics of the linear regression model including mean squared error, coefficients, and intercept.
Please feel free to explore the API and understand how the linear regression model is built and evaluated.

