Skip to content

๐ŸŽฏ Predict exam scores based on study time using your very own implementation of linear regression from scratch! Visualized, optimized, and beginner-friendly.

Notifications You must be signed in to change notification settings

OnlineBunker/linear-regression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Linear Regression from Scratch (Gradient Descent)

This repository contains a simple implementation of Linear Regression using Gradient Descent in Python. The goal is to learn the relationship between study hours and exam scores from a small dataset.


๐Ÿ“Œ Project Overview

  • ๐Ÿ”ข Predict exam scores based on study hours.
  • ๐Ÿงฎ Implements gradient descent manually without any ML libraries.
  • ๐Ÿ“‰ Tracks error (MSE) across epochs.
  • ๐Ÿ“ˆ Plots for data, regression line, and MSE per epoch.

๐Ÿ“ Files Included

File/Folder Description
linear_regression.py Core script containing the linear regression implementation
data2.csv Dataset: study hours vs exam scores
images/ Folder containing generated plots

๐Ÿงช Dataset

The dataset contains two columns:

  • studytime (float): Number of hours studied
  • score (float): Exam score received

๐Ÿ“ท Visualizations

๐Ÿ“Š Data Points

Scatter Plot of Data

๐Ÿ“ˆ Linear Regression Fit

Fitted Line

๐Ÿง  Loss (MSE) vs Epochs

Loss Curve


๐Ÿš€ How to Run

python linear_regression.py

Make sure data2.csv is present in the same directory as linear_regression.py.


๐Ÿ™‹โ€โ™‚๏ธ Author

Yash Dhankhar

Feel free to use, learn, and modify!


About

๐ŸŽฏ Predict exam scores based on study time using your very own implementation of linear regression from scratch! Visualized, optimized, and beginner-friendly.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages