- Linear regression with gradient descent in Python3.11. Please see the
linear-regression-gradient-descent
directory for writeup and code.
using chatgpt + python3.11
Used chatgpt to come up with the plotting code and to help corroborate the math for what I'm trying to do.
Table of contents:
- Linear regression
- Gradient descent
- Implementation
Fit a line of best fit to a set of points. Line of best fit is given by
The $n$th dimensional gradient of a scalar field
The function on which we want to compute the gradient will be the mean squared error function, defined as follows.
It also suffices to minimize this since this quantity is strictly positive without having to invoke an absolute value.
Just implemented based on these ideas. Here is the ChatGPT chat log: https://chat.openai.com/share/f39d9cc3-cce3-4995-8631-795156078b20.