0
votes

While going through Andrew NG's Coursera course on machine learning . I found this particular thing that prices of a house might goes down after certain value of x in Quadratic regression equation. Can anyone explain why is it so?

1

1 Answers

1
votes

Andrew Ng is trying to show that a Quadratic function doesn't really make sense to represent the price of houses.

This what the graph of a quadratic function might look like --> Quadratic equation - ax^2 + bx + c

The values of a, b and c were chosen randomly for this example.

As you can see in the figure, the graph first rises to a maximum and then begins to dip. This isn't representative of the real-world since the price of a house wouldn't normally come down with an increasingly larger house.

He recommends that we use a different polynomial function to represent this problem better, such as the cubic function.

Cubic equation - ax^3 + bx^2 + cx + d

The values of a, b, c and d were chosen randomly for this example.

In reality, we would use a different method altogether for choosing the best polynomial function to fit a problem. We would try different polynomial functions on a cross-validation dataset and have an algorithm choose the best suited one. We could also manually chose a polynomial function for a dataset if we already know the trend that our data would follow (due to prior mathematical or physical knowledge).