Linear Regression (from scratch)
Project Type: Machine Learning | Regression
Tools Used: Python, NumPy, Pandas, Matplotlib
Dataset: Scikit Learn Diabetes dataset
Objective
The goal of this project is to implement linear regression without using Scikit Learn, to gain a deeper understanding of how linear regression works. The model predicts continuous outcomes based on input features, demonstrating how the underlying mathematics, optimization, and evaluation methods work in practice.
Key Steps
- Data Exploration: Examined the dataset to ensure it was clean and without null values. Understood key features and any relationships between the input variables and the target variable.
- Model Implementation: Built two linear regression models from scratch. One implemented Ordinary Least Squares regression, the other used Gradient Descent.
- Model Evaluation: Assessed the model’s performance using metrics like Mean Squared Error (MSE) and R².
Results
The model successfully predicted the target variable with reasonable accuracy. The performance was evaluated against Scikit Learn’s linear regression and results were close in value.
🔗 View my blog post: Link
🔗 View Notebook on GitHub: GitHub Link
🔗 View Interactive Notebook (nbviewer): nbviewer Link