## 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=a _{0}+a_{1}*x+a_{2}*x^{2} +………+ +a_{n}*x^{n} **

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=a_{0}+a_{1}*x+a_{2}*x^{2}

The values of **a _{0}, a_{1}, and a_{2} **are calculated using the following system of equations:

First, we calculate the required variables and note them in the following table.

x | y | x^{2} | x^{3} | x^{4} | y*x | y*x^{2} | |

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

a_{0}=12.4285714

a_{1}=-5.5128571

a_{2}=0.7642857

The required quadratic polynomial model is

**y=12.4285714 -5.5128571 * x +0.7642857 * x ^{2}**

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.