Polynomial Regression using ANN

I am using ANN for regression,
feature : “Time”---- float value
Target Value: “Wear damage”----float value

I have trained model with 2 layers with ‘relu’ but at the end when predicting on x_test
its giving me graph of linear regression.

I want to use polynomial regression using ANN
How to do it?

First, with a NN, you typically don’t need “polynomial regression”. The non-linear function in the hidden layer (ReLU in your case) automatically creates non-linear combinations of the input features.

If you aren’t getting a good enough model, you can try using more hidden layer units.

Second, you can always create additional polynomial features yourself, and apply them to the input layer.

yes got it Sir,
but how to create additional polynomial features in hidden layer?
can you guide me?
because currently I have only single feature that is “Time”

You cannot create new polynomial features in the hidden layer. It is hidden - you do not have access to it.

You can only add more inputs, and even then you really don’t need to. Try using more hidden layer units, so it can create more non-linear combinations of the input features.

For example on the input layer, you could take your “time” feature and create “time^2”, then use them with two input units.

Yes sir, I will definitely do it.
I will let you know the results very soon.
Thanks for your great suggestions!!

1 Like