Quadratic Polynomial Regression Model Solved Example in Machine Learning
Regression modeling is a process of determining a relationship between one or more independent variables and one dependent or output variable.
Example:
1. Predicting the price of the car given the car model, year of manufacturing, mileage, engine capacity.
2. Predicting the height of a person given the age of the person.
Polynomial Regression
Let there be only one independent variable x and the relationship between x, and dependent variable y, be modeled as,
y=a0+a1*x+a2*x2 +………+ +an*xn
for some positive integer n >1, then we have a polynomial regression.
Problem Deninition:
Find a quadratic regression model for the following data:
X | Y |
3 | 2.5 |
4 | 3.2 |
5 | 3.8 |
6 | 6.5 |
7 | 11.5 |
Solution:
Let the quadratic polynomial regression model be
y=a0+a1*x+a2*x2
The values of a0, a1, and a2 are calculated using the following system of equations:
First, we calculate the required variables and note them in the following table.
x | y | x2 | x3 | x4 | y*x | y*x2 | |
3 | 2.5 | 9 | 27 | 81 | 7.5 | 22.5 | |
4 | 3.2 | 16 | 64 | 256 | 12.8 | 51.2 | |
5 | 3.8 | 25 | 125 | 625 | 19 | 95 | |
6 | 6.5 | 36 | 216 | 1296 | 39 | 234 | |
7 | 12 | 49 | 343 | 2401 | 80.5 | 563.5 | |
Σ | 25 | 27.5 | 135 | 775 | 4659 | 158.8 | 966.2 |
Using the given data we,
Solving this system of equations we get
a0=12.4285714
a1=-5.5128571
a2=0.7642857
The required quadratic polynomial model is
y=12.4285714 -5.5128571 * x +0.7642857 * x2
Now, given the value of x (independent variable), we can calculate the value of y (dependent or output variable).
Video Tutorial of Quadratic Polynomial Regression Model
Summary
This tutorial discusses the Quadratic Polynomial Regression Model Solved Example in Machine Learning. If you like the tutorial share it with your friends. Like the Facebook page for regular updates and YouTube channel for video tutorials.