Skip to content

xilenAtenea/LinearReg-Prediction

Repository files navigation

Linear Regression with Flask API

Welcome

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.

Repository Overview

This repository contains two main components:

  1. Linear Regression Script (linearregression.py): This script performs a linear regression analysis on a dataset of student performance.
  2. Flask API (main.py): This script creates a Flask API to serve the results of the regression analysis.

Files

  • 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.

Requirements

  • flask
  • markdown
  • pandas
  • scikit-learn
  • seaborn
  • matplotlib

Get Started

Follow these steps to set up and run the project:

1. Clone the repository

git clone https://github.com/xilenAtenea/LinearReg-Prediction
cd LinearReg-Prediction

2. Create a virtual environment

python -m venv .venv
source venv/bin/activate   # On Windows use `venv\Scripts\activate`

3. Install the requirements

pip install -r requirements.txt

4. Run the Flask application

python main.py

API Endpoints

Once the Flask application is running, the application is deployed in render, so you can access the different endpoints through the following links:

Documentation

Documentation

View the project documentation.

Dataset

/dataset

Download the dataset used for the analysis.

Prediction Graph

/predictions

View the scatter plot of real vs. predicted scores along with the regression line.

Metrics

/metrics

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.

Let's Connect!!


    linkedin discord

About

Linear Regression Project and API with Flask deployed in Render

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors