Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Quadratic Regression | Section
Regression with Python

bookQuadratic Regression

The Problem with Linear Regression

Before defining the Polynomial Regression, we'll take a look at the case that the Linear Regression we have learned before doesn't handle well.

Here you can see that our simple linear regression model is doing awful. That is because it tries to fit a straight line to the data points. Yet we can notice that fitting a parabola would be a much better choice for our points.

Quadratic Regression Equation

To build a straight-line model, we used an equation of a line (y=ax+b). So to build a parabolic model, we need the equation of a parabola. That is the quadratic equation: y=ax²+bx+c. Changing the a, b, and c to β would give us the Quadratic Regression Equation:

The model this equation describes is called Quadratic Regression. Like before, we only need to find the best parameters for our data points.

Normal Equation and X̃

As always, the Normal Equation handles finding the best parameters. But we need to define the properly.

We already know how to build the matrix for Multiple Linear Regression. It turns out the matrix for Polynomial Regression is constructed similarly. We can think of as a second feature. This way, we need to add a corresponding new column to the . It will hold the same values as the previous column but squared.

The video below shows how to build the .

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 11

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

bookQuadratic Regression

Sveip for å vise menyen

The Problem with Linear Regression

Before defining the Polynomial Regression, we'll take a look at the case that the Linear Regression we have learned before doesn't handle well.

Here you can see that our simple linear regression model is doing awful. That is because it tries to fit a straight line to the data points. Yet we can notice that fitting a parabola would be a much better choice for our points.

Quadratic Regression Equation

To build a straight-line model, we used an equation of a line (y=ax+b). So to build a parabolic model, we need the equation of a parabola. That is the quadratic equation: y=ax²+bx+c. Changing the a, b, and c to β would give us the Quadratic Regression Equation:

The model this equation describes is called Quadratic Regression. Like before, we only need to find the best parameters for our data points.

Normal Equation and X̃

As always, the Normal Equation handles finding the best parameters. But we need to define the properly.

We already know how to build the matrix for Multiple Linear Regression. It turns out the matrix for Polynomial Regression is constructed similarly. We can think of as a second feature. This way, we need to add a corresponding new column to the . It will hold the same values as the previous column but squared.

The video below shows how to build the .

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 11
some-alt