Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Linear Regression Practice Lab – Week 2

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.

Description

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.

Core Concepts Covered:

  • 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

Files Included

  • gradient_descent_lab.ipynb: Main Jupyter notebook containing the full implementation and visualizations
  • lab_utils_uni.py: Helper functions for computing cost and gradients
  • data/: 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.

Technologies Used

  • Python 3
  • NumPy
  • Matplotlib
  • Jupyter Notebook

Course

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

License

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 ⭐!

About

This is an implementation of univariate linear regression using gradient descent to fit a line to data. It applies the complete process of cost computation, gradient calculation, and iterative optimization. Part of Week 2 (Course 1) from the Machine Learning Specialization by Andrew Ng.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors