From the course: Python: Working with Predictive Analytics

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Polynomial regression

Polynomial regression - Python Tutorial

From the course: Python: Working with Predictive Analytics

Start my 1-month free trial

Polynomial regression

- [Instructor] We are in the modeling section of the roadmap, starting to polynomial regression. In most cases, data does not contain a linear relationship, and we may need a more complex relationship to work with. We will look into polynomial regression in this session. You can use a linear model to fit nonlinear data. One way to do it is to add powers to each variable as if they were new variables, in other words, new features. Then, we will train a model on these variables. This model will be linear and is called polynomial regression. Suppose you want to calculate the bonus of the employees based on how many years of experience they have on the job. Please open the begin Excel file. Here in this example we can see the years of experience and the bonus values. If we fit a quadratic equation here, which is shown in red, with degree equals to two, the most senior employees will receive a smaller bonus. That does not seem fair. Instead we will fit a more complex, a cubical equation…

Contents