0
votes

I have this doubt when I fit a neural network in a regression problem. I preprocessed the predictors (features) of my train and test data using the methods of Imputers and Scale from sklearn.preprocessing,but I did not preprocessed the class or target of my train data or test data.

In the architecture of my neural network all the layers has relu as activation function except the last layer that has the sigmoid function. I have choosen the sigmoid function for the last layer because the values of the predictions are between 0 and 1.

tl;dr: In summary, my question is: should I deprocess the output of my neuralnet? If I don't use the sigmoid function, the values of my output are < 0 and > 1. In this case, how should I do it?

Thanks

1
can you share the network initialisation code as well, basically the kernel_initializer and loss also matter.Vikash Singh
@Aceconhielo, the last layer must have activation function like sigmoid or softmax in order to predict probabilities. Sigmoid function has values between 0 and 1Mihai Alexandru-Ionut
That is the scope of output layer...to predict probabilities to given classes.Mihai Alexandru-Ionut

1 Answers

0
votes

Usually, if you are doing regression you should use a linear' activation in the last layer. A sigmoid function will 'favor' values closer to 0 and 1, so it would be harder for your model to output intermediate values.

If the distribution of your targets is gaussian or uniform I would go with a linear output layer. De-processing shouldn't be necessary unless you have very large targets.