International Journal of Computer Applications |
Foundation of Computer Science (FCS), NY, USA |
Volume 186 - Number 27 |
Year of Publication: 2024 |
Authors: Ahmad Farhan AlShammari |
10.5120/ijca2024923806 |
Ahmad Farhan AlShammari . Implementation of Polynomial Regression using Least Squares and Gradient Descent in Python. International Journal of Computer Applications. 186, 27 ( Jun 2024), 20-26. DOI=10.5120/ijca2024923806
The goal of this research is to develop a polynomial regression program using least squares and gradient descent in Python. Polynomial regression helps to predict the output data based on the features of the input data using a polynomial function of degree (n). Least squares is used to minimize the error between the observed and predicted data. Gradient descent is used to find the optimal solution that provides the minimum value of error function. The basic steps of polynomial regression using least squares and gradient descent are explained: preparing observed data, computing matrix of features, initializing weights, computing predicted data, computing error function, computing partial derivatives, updating weights, computing final predictions, and plotting predicted data. The developed program was tested on an experimental dataset. The program successfully performed the basic steps of polynomial regression using least squares and gradient descent and provided the required results.