This repository contains my programming assignment for Week 2 of Course 1: Supervised Machine Learning – Regression and Classification from the Machine Learning Specialization by Andrew Ng on Coursera.
In this practice lab, I implemented univariate linear regression from scratch using Python and NumPy. The goal is to understand how gradient descent can be used to minimize the cost function and fit a line to a simple dataset.
- Cost function and Mean Squared Error (MSE)
- Gradient descent optimization
- Model prediction and parameter updates
- Visualization of cost vs iteration
- Plotting the regression line with
matplotlib
gradient_descent_lab.ipynb: Main Jupyter notebook containing the full implementation and visualizationslab_utils_uni.py: Helper functions for computing cost and gradientsdata/: Contains the input data used for training (univariate CSV)
⚠️ This repository includes only my original implementation and learning material in accordance with Coursera’s Honor Code.
- Python 3
- NumPy
- Matplotlib
- Jupyter Notebook
This lab is part of:
Machine Learning Specialization
Instructor: Andrew Ng
Course 1: Supervised Machine Learning – Regression and Classification
Week 2: Gradient Descent in Practice
This repository is for educational and portfolio purposes only. Not intended for direct assignment submission.
If you're also learning ML, feel free to fork this repo or give it a ⭐!