Implementing polynoming regression?

How to do we implement polynomial regression?
Does it use this code part from the lab:
or does it use

Hello @Adveat_Prasad_Karnik

I think you are talking about the Course 2 Week 3 assignment.

There are two independent steps:

1. model

degree = 10
lmodel = lin_model(degree), y_train)

lin_model instantiate a model, and trains the model with the data (X_train, y_train).

2. data

If your data has polynomial features, then the model is a polynomial regression model. To generate polynomial features, we can use, as you said, the PolynomialFeatures provided by sklearn.


So, if you apply PolynomialFeatures to your raw data, you can call the model learnt with that data a polynomial regression model.


1 Like

I see.
Thank you so much for making things clearer for me!